* | domain No | rsvd1 | flag Field |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Correction NS |
- * | Correction Sub NS |
+ * + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | | Correction Sub NS |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved2 |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
u_int len = length;
uint16_t msg_len, flags, port_id, seq_id;
uint8_t foct, domain_no, msg_type, v1_compat, rsvd1, lm_int, control;
- uint32_t ns_corr, sns_corr, rsvd2;
+ uint64_t ns_corr;
+ uint16_t sns_corr;
+ uint32_t rsvd2;
uint64_t clk_id;
foct = GET_U_1(bp);
/* flags */
len -= 2; bp += 2; flags = GET_BE_U_2(bp); ND_PRINT(", Flags [%s]", bittok2str(ptp_flag_values, "none", flags));
- /* correction NS */
- len -= 2; bp += 2; ns_corr = GET_BE_U_4(bp); ND_PRINT(", NS correction : %u", ns_corr);
+ /* correction NS (48 bits) */
+ len -= 2; bp += 2; ns_corr = GET_BE_U_6(bp); ND_PRINT(", NS correction : %"PRIu64, ns_corr);
- /* correction sub NS */
- len -= 4; bp += 4; sns_corr = GET_BE_U_4(bp); ND_PRINT(", sub NS correction : %u", sns_corr);
+ /* correction sub NS (16 bits) */
+ len -= 6; bp += 6; sns_corr = GET_BE_U_2(bp); ND_PRINT(", sub NS correction : %u", sns_corr);
/* Reserved 2 */
- len -= 4; bp += 4; rsvd2 = GET_BE_U_4(bp); ND_PRINT(", reserved2 : %u", rsvd2);
+ len -= 2; bp += 2; rsvd2 = GET_BE_U_4(bp); ND_PRINT(", reserved2 : %u", rsvd2);
/* clock identity */
len -= 4; bp += 4; clk_id = GET_BE_U_8(bp); ND_PRINT(", clock identity : 0x%"PRIx64, clk_id);
--- /dev/null
+ 1 17:52:26.679146 IP 4.5.0.2.319 > 2.2.2.2.319: PTPv2, v1 compat : no, msg type : delay req msg, length : 44, domain : 44, reserved1 : 0, Flags [unicast], NS correction : 0, sub NS correction : 0, reserved2 : 0, clock identity : 0xa0369ffffe856e8a, port id : 1, seq id : 1203, control : 1 (delay req msg), log message interval : 127, originTimeStamp : 0 seconds, 0 nanoseconds
+ 2 17:52:26.679265 IP 2.2.2.2.320 > 4.5.0.2.320: PTPv2, v1 compat : no, msg type : delay resp msg, length : 54, domain : 44, reserved1 : 0, Flags [unicast], NS correction : 36035, sub NS correction : 0, reserved2 : 0, clock identity : 0xe8c57affff01313f, port id : 3, seq id : 1203, control : 3 (peer delay resp msg), log message interval : 127, receiveTimeStamp : 1665510783 seconds, 679015501 nanoseconds, port identity : 0xa0369ffffe856e8a, port id : 1
+ 3 17:52:26.682034 IP 2.2.2.2.319 > 4.5.0.2.319: PTPv2, v1 compat : no, msg type : sync msg, length : 44, domain : 44, reserved1 : 0, Flags [unicast], NS correction : 105045, sub NS correction : 0, reserved2 : 0, clock identity : 0xe8c57affff01313f, port id : 3, seq id : 1213, control : 0 (sync msg), log message interval : 127, originTimeStamp : 1665510783 seconds, 681548698 nanoseconds