mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:05:06 -05:00
ntp: add option to select HW RX timestamping filter
Add an rxfilter option to the hwtimestamp directive to select which received packets should be timestamped. It can be set to "none", "ntp", or "all". The default value is ntp, which falls back to all when ntp is not supported.
This commit is contained in:
14
conf.c
14
conf.c
@@ -1259,7 +1259,7 @@ static void
|
||||
parse_hwtimestamp(char *line)
|
||||
{
|
||||
CNF_HwTsInterface *iface;
|
||||
char *p;
|
||||
char *p, filter[5];
|
||||
int n;
|
||||
|
||||
if (!*line) {
|
||||
@@ -1274,6 +1274,7 @@ parse_hwtimestamp(char *line)
|
||||
iface->name = Strdup(p);
|
||||
iface->minpoll = 0;
|
||||
iface->nocrossts = 0;
|
||||
iface->rxfilter = CNF_HWTS_RXFILTER_NTP;
|
||||
iface->precision = 100.0e-9;
|
||||
iface->tx_comp = 0.0;
|
||||
iface->rx_comp = 0.0;
|
||||
@@ -1293,6 +1294,17 @@ parse_hwtimestamp(char *line)
|
||||
} else if (!strcasecmp(p, "txcomp")) {
|
||||
if (sscanf(line, "%lf%n", &iface->tx_comp, &n) != 1)
|
||||
break;
|
||||
} else if (!strcasecmp(p, "rxfilter")) {
|
||||
if (sscanf(line, "%4s%n", filter, &n) != 1)
|
||||
break;
|
||||
if (!strcasecmp(filter, "none"))
|
||||
iface->rxfilter = CNF_HWTS_RXFILTER_NONE;
|
||||
else if (!strcasecmp(filter, "ntp"))
|
||||
iface->rxfilter = CNF_HWTS_RXFILTER_NTP;
|
||||
else if (!strcasecmp(filter, "all"))
|
||||
iface->rxfilter = CNF_HWTS_RXFILTER_ALL;
|
||||
else
|
||||
break;
|
||||
} else if (!strcasecmp(p, "nocrossts")) {
|
||||
n = 0;
|
||||
iface->nocrossts = 1;
|
||||
|
||||
Reference in New Issue
Block a user