Skip to content

Commit

Permalink
config: port: convert 'logSyncInterval' to the new scheme.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Aug 23, 2015
1 parent 8026663 commit 769a8d3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
9 changes: 2 additions & 7 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ struct config_item config_tab[] = {
PORT_ITEM_INT("delayAsymmetry", 0, INT_MIN, INT_MAX),
GLOB_ITEM_DBL("first_step_threshold", 0.00002, 0.0, DBL_MAX),
PORT_ITEM_INT("logAnnounceInterval", 1, INT8_MIN, INT8_MAX),
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),
GLOB_ITEM_INT("ntpshm_segment", 0, INT_MIN, INT_MAX),
Expand Down Expand Up @@ -264,13 +265,7 @@ static enum parser_result parse_pod_setting(const char *option,

enum parser_result r;

if (!strcmp(option, "logSyncInterval")) {
r = get_ranged_int(value, &val, INT8_MIN, INT8_MAX);
if (r != PARSED_OK)
return r;
pod->logSyncInterval = val;

} else if (!strcmp(option, "logMinDelayReqInterval")) {
if (!strcmp(option, "logMinDelayReqInterval")) {
r = get_ranged_int(value, &val, INT8_MIN, INT8_MAX);
if (r != PARSED_OK)
return r;
Expand Down
1 change: 0 additions & 1 deletion ds.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ struct portDS {
#define FRI_ASAP (-128)

struct port_defaults {
Integer8 logSyncInterval;
Integer8 logMinDelayReqInterval;
Integer8 logMinPdelayReqInterval;
UInteger8 announceReceiptTimeout;
Expand Down
2 changes: 1 addition & 1 deletion port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ static int port_initialize(struct port *p)
p->announceReceiptTimeout = p->pod.announceReceiptTimeout;
p->syncReceiptTimeout = p->pod.syncReceiptTimeout;
p->transportSpecific = p->pod.transportSpecific;
p->logSyncInterval = p->pod.logSyncInterval;
p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval");
p->logMinPdelayReqInterval = p->pod.logMinPdelayReqInterval;
p->neighborPropDelayThresh = p->pod.neighborPropDelayThresh;
p->min_neighbor_prop_delay = p->pod.min_neighbor_prop_delay;
Expand Down
1 change: 0 additions & 1 deletion ptp4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ static struct config cfg_settings = {
},

.pod = {
.logSyncInterval = 0,
.logMinDelayReqInterval = 0,
.logMinPdelayReqInterval = 0,
.announceReceiptTimeout = 3,
Expand Down

0 comments on commit 769a8d3

Please sign in to comment.