From 35227f2d1f55264014430966fe9b6122b5f00c3d Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sat, 15 Aug 2015 11:08:19 +0200 Subject: [PATCH] config: port: convert 'announceReceiptTimeout' to the new scheme. Signed-off-by: Richard Cochran --- config.c | 9 ++------- ds.h | 1 - port.c | 2 +- ptp4l.c | 1 - 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/config.c b/config.c index 833d894..6401e44 100644 --- a/config.c +++ b/config.c @@ -91,6 +91,7 @@ struct config_item { CONFIG_ITEM_INT(label, 1, _default, min, max) struct config_item config_tab[] = { + PORT_ITEM_INT("announceReceiptTimeout", 3, 2, UINT8_MAX), GLOB_ITEM_INT("assume_two_step", 0, 0, 1), GLOB_ITEM_INT("check_fup_sync", 0, 0, 1), PORT_ITEM_INT("delayAsymmetry", 0, INT_MIN, INT_MAX), @@ -267,13 +268,7 @@ static enum parser_result parse_pod_setting(const char *option, enum parser_result r; - if (!strcmp(option, "announceReceiptTimeout")) { - r = get_ranged_uint(value, &uval, 2, UINT8_MAX); - if (r != PARSED_OK) - return r; - pod->announceReceiptTimeout = uval; - - } else if (!strcmp(option, "syncReceiptTimeout")) { + if (!strcmp(option, "syncReceiptTimeout")) { r = get_ranged_uint(value, &uval, 0, UINT8_MAX); if (r != PARSED_OK) return r; diff --git a/ds.h b/ds.h index 94db41b..7652632 100644 --- a/ds.h +++ b/ds.h @@ -125,7 +125,6 @@ struct portDS { #define FRI_ASAP (-128) struct port_defaults { - UInteger8 announceReceiptTimeout; UInteger8 syncReceiptTimeout; UInteger8 transportSpecific; int announce_span; diff --git a/port.c b/port.c index 304b25c..aa8572d 100644 --- a/port.c +++ b/port.c @@ -1447,7 +1447,7 @@ static int port_initialize(struct port *p) p->logMinDelayReqInterval = config_get_int(cfg, p->name, "logMinDelayReqInterval"); p->peerMeanPathDelay = 0; p->logAnnounceInterval = config_get_int(cfg, p->name, "logAnnounceInterval"); - p->announceReceiptTimeout = p->pod.announceReceiptTimeout; + p->announceReceiptTimeout = config_get_int(cfg, p->name, "announceReceiptTimeout"); p->syncReceiptTimeout = p->pod.syncReceiptTimeout; p->transportSpecific = p->pod.transportSpecific; p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval"); diff --git a/ptp4l.c b/ptp4l.c index 8b9531e..cc20236 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -80,7 +80,6 @@ static struct config cfg_settings = { }, .pod = { - .announceReceiptTimeout = 3, .syncReceiptTimeout = 0, .transportSpecific = 0, .announce_span = 1,