conf: add minpoll option to hwtimestamp directive

This commit is contained in:
Miroslav Lichvar
2017-01-19 12:59:06 +01:00
parent 9800e397fb
commit 510784077f
4 changed files with 16 additions and 2 deletions

6
conf.c
View File

@@ -1259,6 +1259,7 @@ parse_hwtimestamp(char *line)
iface = ARR_GetNewElement(hwts_interfaces);
iface->name = Strdup(p);
iface->minpoll = 0;
iface->precision = 100.0e-9;
iface->tx_comp = 0.0;
iface->rx_comp = 0.0;
@@ -1266,7 +1267,10 @@ parse_hwtimestamp(char *line)
for (p = line; *p; line += n, p = line) {
line = CPS_SplitWord(line);
if (!strcasecmp(p, "precision")) {
if (!strcasecmp(p, "minpoll")) {
if (sscanf(line, "%d%n", &iface->minpoll, &n) != 1)
break;
} else if (!strcasecmp(p, "precision")) {
if (sscanf(line, "%lf%n", &iface->precision, &n) != 1)
break;
} else if (!strcasecmp(p, "rxcomp")) {