Move some code which can be shared between PTP management clients to a new file. Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>