config: port: convert 'ingressLatency' to the new scheme.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2015-08-15 13:28:54 +02:00
parent a19318b413
commit 83e26ec68b
4 changed files with 5 additions and 13 deletions

View File

@ -99,6 +99,7 @@ struct config_item config_tab[] = {
GLOB_ITEM_DBL("first_step_threshold", 0.00002, 0.0, DBL_MAX),
PORT_ITEM_INT("follow_up_info", 0, 0, 1),
PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
PORT_ITEM_INT("ingressLatency", 0, INT_MIN, INT_MAX),
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),
@ -274,13 +275,7 @@ static enum parser_result parse_pod_setting(const char *option,
int val;
enum parser_result r;
if (!strcmp(option, "ingressLatency")) {
r = get_ranged_int(value, &val, INT_MIN, INT_MAX);
if (r != PARSED_OK)
return r;
pod->rx_timestamp_offset = val;
} else if (!strcmp(option, "fault_badpeernet_interval")) {
if (!strcmp(option, "fault_badpeernet_interval")) {
pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].type = FTMO_LINEAR_SECONDS;
if (!strcasecmp("ASAP", value)) {
pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].val = 0;

1
ds.h
View File

@ -125,7 +125,6 @@ struct portDS {
struct port_defaults {
struct fault_interval flt_interval_pertype[FT_CNT];
int rx_timestamp_offset; /*nanoseconds*/
};
#endif

4
port.c
View File

@ -114,6 +114,7 @@ struct port {
int freq_est_interval;
int min_neighbor_prop_delay;
int path_trace_enabled;
int rx_timestamp_offset;
int tx_timestamp_offset;
enum fault_type last_fault_type;
unsigned int versionNumber; /*UInteger4*/
@ -2238,7 +2239,7 @@ enum fsm_event port_event(struct port *p, int fd_index)
return EV_NONE;
}
if (msg_sots_valid(msg)) {
ts_add(&msg->hwts.ts, -p->pod.rx_timestamp_offset);
ts_add(&msg->hwts.ts, -p->rx_timestamp_offset);
clock_check_ts(p->clock, msg->hwts.ts);
}
if (port_ignore(p, msg)) {
@ -2537,6 +2538,7 @@ struct port *port_open(int phc_index,
p->follow_up_info = config_get_int(cfg, p->name, "follow_up_info");
p->freq_est_interval = config_get_int(cfg, p->name, "freq_est_interval");
p->path_trace_enabled = config_get_int(cfg, p->name, "path_trace_enabled");
p->rx_timestamp_offset = config_get_int(cfg, p->name, "ingressLatency");
p->tx_timestamp_offset = config_get_int(cfg, p->name, "egressLatency");
p->clock = clock;
p->trp = transport_create(cfg, interface->transport);

View File

@ -78,10 +78,6 @@ static struct config cfg_settings = {
.boundary_clock_jbod = 0,
},
.pod = {
.rx_timestamp_offset = 0,
},
.timestamping = TS_HARDWARE,
.dm = DM_E2E,
.transport = TRANS_UDP_IPV4,