phc2sys: Add option to set path to ptp4l UDS.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Remove socket when closing UDS transport.

[RC: added cast to sockaddr to avoid compiler warning. ]

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Move signal handling to util.c.

This will be useful in phc2sys and pmc.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Close client UDS transport before exit.

In pmc and phc2sys handle terminating signals and close the UDS
transport before exit to remove the sockets in /var/run.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Append PID to client UDS paths.

This allows running multiple phc2sys and pmc instances at the same time.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Add option to set NTP SHM segment number.

Instead of setting it to the PTP domain number, add a new option to
ptp4l and phc2sys to set it as needed. The default value is 0. This
allows multiple ptp4l/phc2sys instances running in the same domain.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>