Explicitly detect and handle changes of the peer's port id by resetting asCapable and the port's nrate

This patch also changes port_capable() to reset the port's nrate every time asCapable changes
from true to false.

Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
Rename set_tmo() to set_tmo_log(), add set_tmo_lin()

Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
Add support for multiple fault types

Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
Add support for FT_BAD_PEER_NETWORK

Handle reception of >=3 sequential multiple pdelay responses from
distinct peers as a fault of type FT_BAD_PEER_NETWORK.

Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
phc2sys: Update sync offset periodically with -w.

Modify the pmc to allow non-blocking operation. Run it on each clock
update to have the sync offset updated from currentUtcOffset with every
other call.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Move clock_adjtime wrapping to clockadj.c.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
phc2sys: Handle leap seconds.

Update the currentUtcOffset and leap61/59 values at one minute
interval. When a leap second is detected, set the STA_INS/STA_DEL
bit for the system clock.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Add missing conversions from tmv_t to nanoseconds.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
ptp4l: Handle leap seconds.

Extend the clock_utc_correct function to handle leap seconds announced
in the time properties data set. With software time stamping, it sets the
STA_INS/STA_DEL bit for the system clock. Clock updates are suspended
in the last second of the day.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Add options to not apply leap seconds in kernel.

Add kernel_leap option for ptp4l and -x option for phc2sys to disable
setting of the STA_INS/STA_DEL bit to slowly correct the one-second
offset by servo.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Merge branch 'mlichvar_leap'

Fixed up trivial conflict in the makefile.

Conflicts:
	makefile