config: convert 'offsetScaledLogVariance' to the new scheme.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2015-08-15 19:34:36 +02:00
parent 4e27856c8b
commit 9d929fe424
2 changed files with 3 additions and 7 deletions

View File

@ -118,6 +118,7 @@ struct config_item config_tab[] = {
PORT_ITEM_INT("min_neighbor_prop_delay", -20000000, INT_MIN, -1), PORT_ITEM_INT("min_neighbor_prop_delay", -20000000, INT_MIN, -1),
PORT_ITEM_INT("neighborPropDelayThresh", 20000000, 0, INT_MAX), PORT_ITEM_INT("neighborPropDelayThresh", 20000000, 0, INT_MAX),
GLOB_ITEM_INT("ntpshm_segment", 0, INT_MIN, INT_MAX), GLOB_ITEM_INT("ntpshm_segment", 0, INT_MIN, INT_MAX),
GLOB_ITEM_INT("offsetScaledLogVariance", 0xffff, 0, UINT16_MAX),
PORT_ITEM_INT("path_trace_enabled", 0, 0, 1), 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),
@ -406,12 +407,6 @@ static enum parser_result parse_global_setting(const char *option,
return r; return r;
dds->domainNumber = uval; dds->domainNumber = uval;
} else if (!strcmp(option, "offsetScaledLogVariance")) {
r = get_ranged_uint(value, &uval, 0, UINT16_MAX);
if (r != PARSED_OK)
return r;
dds->clockQuality.offsetScaledLogVariance = uval;
} else if (!strcmp(option, "ptp_dst_mac")) { } else if (!strcmp(option, "ptp_dst_mac")) {
if (MAC_LEN != sscanf(value, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", if (MAC_LEN != sscanf(value, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
&mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5])) &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]))

View File

@ -44,7 +44,6 @@ static struct config cfg_settings = {
.dds = { .dds = {
.dds = { .dds = {
.clockQuality.offsetScaledLogVariance = 0xffff,
.domainNumber = 0, .domainNumber = 0,
}, },
.clock_desc = { .clock_desc = {
@ -223,6 +222,8 @@ int main(int argc, char *argv[])
ds->clockQuality.clockClass = config_get_int(cfg, NULL, "clockClass"); ds->clockQuality.clockClass = config_get_int(cfg, NULL, "clockClass");
ds->clockQuality.clockAccuracy = config_get_int(cfg, NULL, "clockAccuracy"); ds->clockQuality.clockAccuracy = config_get_int(cfg, NULL, "clockAccuracy");
ds->clockQuality.offsetScaledLogVariance =
config_get_int(cfg, NULL, "offsetScaledLogVariance");
if (config_get_int(cfg, NULL, "slaveOnly")) { if (config_get_int(cfg, NULL, "slaveOnly")) {
ds->flags |= DDS_SLAVE_ONLY; ds->flags |= DDS_SLAVE_ONLY;