config: port: convert 'neighborPropDelayThresh' to new scheme.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2015-08-15 13:15:59 +02:00
parent ffa7d49df6
commit 7895466de1
4 changed files with 3 additions and 14 deletions

View File

@ -104,6 +104,7 @@ struct config_item config_tab[] = {
PORT_ITEM_INT("logSyncInterval", 0, INT8_MIN, INT8_MAX),
GLOB_ITEM_INT("logging_level", LOG_INFO, PRINT_LEVEL_MIN, PRINT_LEVEL_MAX),
GLOB_ITEM_INT("max_frequency", 900000000, 0, INT_MAX),
PORT_ITEM_INT("neighborPropDelayThresh", 20000000, 0, INT_MAX),
GLOB_ITEM_INT("ntpshm_segment", 0, INT_MIN, INT_MAX),
PORT_ITEM_INT("path_trace_enabled", 0, 0, 1),
GLOB_ITEM_DBL("pi_integral_const", 0.0, 0.0, DBL_MAX),
@ -269,17 +270,9 @@ static enum parser_result parse_pod_setting(const char *option,
struct port_defaults *pod)
{
int val;
unsigned int uval;
enum parser_result r;
if (!strcmp(option, "neighborPropDelayThresh")) {
r = get_ranged_uint(value, &uval, 0, UINT32_MAX);
if (r != PARSED_OK)
return r;
pod->neighborPropDelayThresh = uval;
} else if (!strcmp(option, "min_neighbor_prop_delay")) {
if (!strcmp(option, "min_neighbor_prop_delay")) {
r = get_ranged_int(value, &val, INT_MIN, -1);
if (r != PARSED_OK)
return r;

1
ds.h
View File

@ -125,7 +125,6 @@ struct portDS {
struct port_defaults {
struct fault_interval flt_interval_pertype[FT_CNT];
UInteger32 neighborPropDelayThresh; /*nanoseconds*/
int min_neighbor_prop_delay; /*nanoseconds*/
int tx_timestamp_offset; /*nanoseconds*/
int rx_timestamp_offset; /*nanoseconds*/

2
port.c
View File

@ -1457,7 +1457,7 @@ static int port_initialize(struct port *p)
p->transportSpecific <<= 4;
p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval");
p->logMinPdelayReqInterval = config_get_int(cfg, p->name, "logMinPdelayReqInterval");
p->neighborPropDelayThresh = p->pod.neighborPropDelayThresh;
p->neighborPropDelayThresh = config_get_int(cfg, p->name, "neighborPropDelayThresh");
p->min_neighbor_prop_delay = p->pod.min_neighbor_prop_delay;
for (i = 0; i < N_TIMER_FDS; i++) {

View File

@ -79,9 +79,6 @@ static struct config cfg_settings = {
},
.pod = {
/* Default to very a large neighborPropDelay threshold */
.neighborPropDelayThresh = 20000000,
.min_neighbor_prop_delay = -20000000,
.tx_timestamp_offset = 0,
.rx_timestamp_offset = 0,
},