diff --git a/config.c b/config.c index 2c10158..7cc3ca5 100644 --- a/config.c +++ b/config.c @@ -96,6 +96,7 @@ struct config_item config_tab[] = { GLOB_ITEM_INT("check_fup_sync", 0, 0, 1), PORT_ITEM_INT("delayAsymmetry", 0, INT_MIN, INT_MAX), GLOB_ITEM_DBL("first_step_threshold", 0.00002, 0.0, DBL_MAX), + PORT_ITEM_INT("follow_up_info", 0, 0, 1), PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX), PORT_ITEM_INT("logMinDelayReqInterval", 0, INT8_MIN, INT8_MAX), PORT_ITEM_INT("logMinPdelayReqInterval", 0, INT8_MIN, INT8_MAX), @@ -271,13 +272,7 @@ static enum parser_result parse_pod_setting(const char *option, enum parser_result r; - if (!strcmp(option, "follow_up_info")) { - r = get_ranged_int(value, &val, 0, 1); - if (r != PARSED_OK) - return r; - pod->follow_up_info = val; - - } else if (!strcmp(option, "neighborPropDelayThresh")) { + if (!strcmp(option, "neighborPropDelayThresh")) { r = get_ranged_uint(value, &uval, 0, UINT32_MAX); if (r != PARSED_OK) return r; diff --git a/ds.h b/ds.h index f1a0170..eae0fd1 100644 --- a/ds.h +++ b/ds.h @@ -125,7 +125,6 @@ struct portDS { #define FRI_ASAP (-128) struct port_defaults { - int follow_up_info; int freq_est_interval; /*log seconds*/ struct fault_interval flt_interval_pertype[FT_CNT]; UInteger32 neighborPropDelayThresh; /*nanoseconds*/ diff --git a/port.c b/port.c index bb1fd4b..f186917 100644 --- a/port.c +++ b/port.c @@ -110,6 +110,7 @@ struct port { Enumeration8 delayMechanism; Integer8 logMinPdelayReqInterval; UInteger32 neighborPropDelayThresh; + int follow_up_info; int min_neighbor_prop_delay; int path_trace_enabled; enum fault_type last_fault_type; @@ -654,7 +655,7 @@ static int port_sync_incapable(struct port *p) static int port_is_ieee8021as(struct port *p) { - return p->pod.follow_up_info ? 1 : 0; + return p->follow_up_info ? 1 : 0; } static void port_management_send_error(struct port *p, struct port *ingress, @@ -1334,7 +1335,7 @@ static int port_tx_sync(struct port *p) pdulen = sizeof(struct follow_up_msg); fup->hwts.type = p->timestamping; - if (p->pod.follow_up_info) + if (p->follow_up_info) pdulen += follow_up_info_append(p, fup); fup->header.tsmt = FOLLOW_UP | p->transportSpecific; @@ -1687,7 +1688,7 @@ static void process_follow_up(struct port *p, struct ptp_message *m) if (memcmp(&master, &m->header.sourcePortIdentity, sizeof(master))) return; - if (p->pod.follow_up_info) { + if (p->follow_up_info) { struct follow_up_info_tlv *fui = follow_up_info_extract(m); if (!fui) return; @@ -1861,7 +1862,7 @@ calc: p->peerMeanPathDelay = tmv_to_TimeInterval(p->peer_delay); - if (p->pod.follow_up_info) + if (p->follow_up_info) port_nrate_calculate(p, t3c, t4); if (p->state == PS_UNCALIBRATED || p->state == PS_SLAVE) { @@ -2531,6 +2532,7 @@ struct port *port_open(int phc_index, p->name = interface->name; p->asymmetry = config_get_int(cfg, p->name, "delayAsymmetry"); p->asymmetry <<= 16; + p->follow_up_info = config_get_int(cfg, p->name, "follow_up_info"); p->path_trace_enabled = config_get_int(cfg, p->name, "path_trace_enabled"); p->clock = clock; p->trp = transport_create(cfg, interface->transport); diff --git a/ptp4l.c b/ptp4l.c index ba189a4..faa13da 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -80,7 +80,6 @@ static struct config cfg_settings = { }, .pod = { - .follow_up_info = 0, .freq_est_interval = 1, /* Default to very a large neighborPropDelay threshold */ .neighborPropDelayThresh = 20000000,