ntp: update NTP-over-PTP support

Update the support for NTP over PTP to the latest specification
(currently in the RFC editor queue). Switch the NTP TLV to the
organization-specific TLV using the IANA OUI and assigned TLV
subtype 0x1. The Network Correction extension field has been
assigned type 0x10A. The extfield option accepts F324 as an alias
for 10A to not break existing configurations. Drop the experimental
status.
This commit is contained in:
Miroslav Lichvar
2025-11-26 12:14:08 +01:00
parent 73f6657dfd
commit 007a1ae4fe
12 changed files with 94 additions and 82 deletions

10
ptp.h
View File

@@ -36,7 +36,9 @@
#define PTP_TYPE_SYNC 0
#define PTP_TYPE_DELAY_REQ 1
#define PTP_FLAG_UNICAST (1 << (2 + 8))
#define PTP_TLV_NTP 0x2023
#define PTP_TLV_ORGEXT2 0x0003
#define PTP_TLV_ORGEXT21 0x8000
#define PTP_IANA_TLV_NTP_MSG "\x00\x00\x5E\x00\x00\x01"
typedef struct {
uint8_t type;
@@ -56,12 +58,14 @@ typedef struct {
typedef struct {
uint16_t type;
uint16_t length;
} PTP_TlvHeader;
uint8_t org_id_subtype[6];
uint16_t pad;
} PTP_TlvNtpHeader;
typedef struct {
PTP_Header header;
uint8_t origin_ts[10];
PTP_TlvHeader tlv_header;
PTP_TlvNtpHeader tlv_header;
NTP_Packet ntp_msg;
} PTP_NtpMessage;