Add an all purpose, single byte management TLV.

Many of the single field management messages have just two bytes, one for
the data value and one for padding. This patch adds a structure that can
be used for all of these management IDs.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the priority1 management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the priority2 management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the domain management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the slave_only management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the clock_accuracy management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the traceability management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the timescale management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the log announce interval management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the announce receipt timeout management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the log sync interval management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the version number management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the delay mechanism management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Add support for the log peer delay interval management request.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Align the message buffer to eight bytes.

The 'struct ptp_message" includes a 64 bit integer field, ts.pdu.sec,
and this must be aligned to an eight byte boundary for armv5 machines.
Although the compiler puts the field at the right offset, we spoil this
by packing the struct with 20 bytes of head room. This patch fixes the
issue by realigning the message buffer.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
pmc: avoid printing invalid data from empty TLVs

Also adds additional null-check to bin2str to avoid crashing on empty
messages.

Signed-off-by: Geoff Salmon <gsalmon@se-instruments.com>
Implement neighborPropDelayThresh check in port_capable()

Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
Free peer delay responses and followup messages when sending a new peer delay request

If messages are not freed, it is possible (with purposely crafted traffic) to trigger
a peer delay calculation which will use message's data from the previous round.

Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
Log changes to asCapable

Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
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>