config: port: convert 'path_trace_enabled' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
54f45063df
commit
e1dcf8ea11
9
config.c
9
config.c
|
@ -103,6 +103,7 @@ struct config_item config_tab[] = {
|
||||||
GLOB_ITEM_INT("logging_level", LOG_INFO, PRINT_LEVEL_MIN, PRINT_LEVEL_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("max_frequency", 900000000, 0, INT_MAX),
|
||||||
GLOB_ITEM_INT("ntpshm_segment", 0, INT_MIN, 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),
|
GLOB_ITEM_DBL("pi_integral_const", 0.0, 0.0, DBL_MAX),
|
||||||
GLOB_ITEM_DBL("pi_integral_exponent", 0.4, -DBL_MAX, DBL_MAX),
|
GLOB_ITEM_DBL("pi_integral_exponent", 0.4, -DBL_MAX, DBL_MAX),
|
||||||
GLOB_ITEM_DBL("pi_integral_norm_max", 0.3, DBL_MIN, 2.0),
|
GLOB_ITEM_DBL("pi_integral_norm_max", 0.3, DBL_MIN, 2.0),
|
||||||
|
@ -270,13 +271,7 @@ static enum parser_result parse_pod_setting(const char *option,
|
||||||
|
|
||||||
enum parser_result r;
|
enum parser_result r;
|
||||||
|
|
||||||
if (!strcmp(option, "path_trace_enabled")) {
|
if (!strcmp(option, "follow_up_info")) {
|
||||||
r = get_ranged_int(value, &val, 0, 1);
|
|
||||||
if (r != PARSED_OK)
|
|
||||||
return r;
|
|
||||||
pod->path_trace_enabled = val;
|
|
||||||
|
|
||||||
} else if (!strcmp(option, "follow_up_info")) {
|
|
||||||
r = get_ranged_int(value, &val, 0, 1);
|
r = get_ranged_int(value, &val, 0, 1);
|
||||||
if (r != PARSED_OK)
|
if (r != PARSED_OK)
|
||||||
return r;
|
return r;
|
||||||
|
|
1
ds.h
1
ds.h
|
@ -125,7 +125,6 @@ struct portDS {
|
||||||
#define FRI_ASAP (-128)
|
#define FRI_ASAP (-128)
|
||||||
|
|
||||||
struct port_defaults {
|
struct port_defaults {
|
||||||
int path_trace_enabled;
|
|
||||||
int follow_up_info;
|
int follow_up_info;
|
||||||
int freq_est_interval; /*log seconds*/
|
int freq_est_interval; /*log seconds*/
|
||||||
struct fault_interval flt_interval_pertype[FT_CNT];
|
struct fault_interval flt_interval_pertype[FT_CNT];
|
||||||
|
|
8
port.c
8
port.c
|
@ -111,6 +111,7 @@ struct port {
|
||||||
Integer8 logMinPdelayReqInterval;
|
Integer8 logMinPdelayReqInterval;
|
||||||
UInteger32 neighborPropDelayThresh;
|
UInteger32 neighborPropDelayThresh;
|
||||||
int min_neighbor_prop_delay;
|
int min_neighbor_prop_delay;
|
||||||
|
int path_trace_enabled;
|
||||||
enum fault_type last_fault_type;
|
enum fault_type last_fault_type;
|
||||||
unsigned int versionNumber; /*UInteger4*/
|
unsigned int versionNumber; /*UInteger4*/
|
||||||
/* foreignMasterDS */
|
/* foreignMasterDS */
|
||||||
|
@ -484,7 +485,7 @@ static int path_trace_ignore(struct port *p, struct ptp_message *m)
|
||||||
struct path_trace_tlv *ptt;
|
struct path_trace_tlv *ptt;
|
||||||
int i, cnt;
|
int i, cnt;
|
||||||
|
|
||||||
if (!p->pod.path_trace_enabled) {
|
if (!p->path_trace_enabled) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (msg_type(m) != ANNOUNCE) {
|
if (msg_type(m) != ANNOUNCE) {
|
||||||
|
@ -1249,7 +1250,7 @@ static int port_tx_announce(struct port *p)
|
||||||
pdulen = sizeof(struct announce_msg);
|
pdulen = sizeof(struct announce_msg);
|
||||||
msg->hwts.type = p->timestamping;
|
msg->hwts.type = p->timestamping;
|
||||||
|
|
||||||
if (p->pod.path_trace_enabled)
|
if (p->path_trace_enabled)
|
||||||
pdulen += path_trace_append(p, msg, dad);
|
pdulen += path_trace_append(p, msg, dad);
|
||||||
|
|
||||||
msg->header.tsmt = ANNOUNCE | p->transportSpecific;
|
msg->header.tsmt = ANNOUNCE | p->transportSpecific;
|
||||||
|
@ -1529,7 +1530,7 @@ static int update_current_master(struct port *p, struct ptp_message *m)
|
||||||
tds.timeSource = m->announce.timeSource;
|
tds.timeSource = m->announce.timeSource;
|
||||||
clock_update_time_properties(p->clock, tds);
|
clock_update_time_properties(p->clock, tds);
|
||||||
}
|
}
|
||||||
if (p->pod.path_trace_enabled) {
|
if (p->path_trace_enabled) {
|
||||||
ptt = (struct path_trace_tlv *) m->announce.suffix;
|
ptt = (struct path_trace_tlv *) m->announce.suffix;
|
||||||
dad = clock_parent_ds(p->clock);
|
dad = clock_parent_ds(p->clock);
|
||||||
memcpy(dad->ptl, ptt->cid, ptt->length);
|
memcpy(dad->ptl, ptt->cid, ptt->length);
|
||||||
|
@ -2530,6 +2531,7 @@ struct port *port_open(int phc_index,
|
||||||
p->name = interface->name;
|
p->name = interface->name;
|
||||||
p->asymmetry = config_get_int(cfg, p->name, "delayAsymmetry");
|
p->asymmetry = config_get_int(cfg, p->name, "delayAsymmetry");
|
||||||
p->asymmetry <<= 16;
|
p->asymmetry <<= 16;
|
||||||
|
p->path_trace_enabled = config_get_int(cfg, p->name, "path_trace_enabled");
|
||||||
p->clock = clock;
|
p->clock = clock;
|
||||||
p->trp = transport_create(cfg, interface->transport);
|
p->trp = transport_create(cfg, interface->transport);
|
||||||
if (!p->trp)
|
if (!p->trp)
|
||||||
|
|
1
ptp4l.c
1
ptp4l.c
|
@ -80,7 +80,6 @@ static struct config cfg_settings = {
|
||||||
},
|
},
|
||||||
|
|
||||||
.pod = {
|
.pod = {
|
||||||
.path_trace_enabled = 0,
|
|
||||||
.follow_up_info = 0,
|
.follow_up_info = 0,
|
||||||
.freq_est_interval = 1,
|
.freq_est_interval = 1,
|
||||||
/* Default to very a large neighborPropDelay threshold */
|
/* Default to very a large neighborPropDelay threshold */
|
||||||
|
|
Loading…
Reference in New Issue