mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 21:05:06 -05:00
ntp: add PTP rxfilter
Setting rxfilter to ptp enables timestamping of PTPv2 packets (UDP or all transports). It will be needed for NTP-over-PTP support.
This commit is contained in:
2
conf.c
2
conf.c
@@ -1556,6 +1556,8 @@ parse_hwtimestamp(char *line)
|
|||||||
iface->rxfilter = CNF_HWTS_RXFILTER_NONE;
|
iface->rxfilter = CNF_HWTS_RXFILTER_NONE;
|
||||||
else if (!strcasecmp(filter, "ntp"))
|
else if (!strcasecmp(filter, "ntp"))
|
||||||
iface->rxfilter = CNF_HWTS_RXFILTER_NTP;
|
iface->rxfilter = CNF_HWTS_RXFILTER_NTP;
|
||||||
|
else if (!strcasecmp(filter, "ptp"))
|
||||||
|
iface->rxfilter = CNF_HWTS_RXFILTER_PTP;
|
||||||
else if (!strcasecmp(filter, "all"))
|
else if (!strcasecmp(filter, "all"))
|
||||||
iface->rxfilter = CNF_HWTS_RXFILTER_ALL;
|
iface->rxfilter = CNF_HWTS_RXFILTER_ALL;
|
||||||
else
|
else
|
||||||
|
|||||||
1
conf.h
1
conf.h
@@ -134,6 +134,7 @@ typedef enum {
|
|||||||
CNF_HWTS_RXFILTER_ANY,
|
CNF_HWTS_RXFILTER_ANY,
|
||||||
CNF_HWTS_RXFILTER_NONE,
|
CNF_HWTS_RXFILTER_NONE,
|
||||||
CNF_HWTS_RXFILTER_NTP,
|
CNF_HWTS_RXFILTER_NTP,
|
||||||
|
CNF_HWTS_RXFILTER_PTP,
|
||||||
CNF_HWTS_RXFILTER_ALL,
|
CNF_HWTS_RXFILTER_ALL,
|
||||||
} CNF_HwTs_RxFilter;
|
} CNF_HwTs_RxFilter;
|
||||||
|
|
||||||
|
|||||||
@@ -2416,6 +2416,8 @@ _all_::::
|
|||||||
Enables timestamping of all received packets.
|
Enables timestamping of all received packets.
|
||||||
_ntp_::::
|
_ntp_::::
|
||||||
Enables timestamping of received NTP packets.
|
Enables timestamping of received NTP packets.
|
||||||
|
_ptp_::::
|
||||||
|
Enables timestamping of received PTP packets.
|
||||||
_none_::::
|
_none_::::
|
||||||
Disables timestamping of received packets.
|
Disables timestamping of received packets.
|
||||||
{blank}:::
|
{blank}:::
|
||||||
|
|||||||
@@ -189,6 +189,14 @@ add_interface(CNF_HwTsInterface *conf_iface)
|
|||||||
rx_filter = HWTSTAMP_FILTER_NTP_ALL;
|
rx_filter = HWTSTAMP_FILTER_NTP_ALL;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
case CNF_HWTS_RXFILTER_PTP:
|
||||||
|
if (ts_info.rx_filters & (1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT))
|
||||||
|
rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
|
||||||
|
else if (ts_info.rx_filters & (1 << HWTSTAMP_FILTER_PTP_V2_EVENT))
|
||||||
|
rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
|
||||||
|
else
|
||||||
|
rx_filter = HWTSTAMP_FILTER_NONE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
rx_filter = HWTSTAMP_FILTER_ALL;
|
rx_filter = HWTSTAMP_FILTER_ALL;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user