From 9d929fe424e6e0ab260f198b03c17a2409152fd8 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sat, 15 Aug 2015 19:34:36 +0200 Subject: [PATCH] config: convert 'offsetScaledLogVariance' to the new scheme. Signed-off-by: Richard Cochran --- config.c | 7 +------ ptp4l.c | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/config.c b/config.c index e14156b..afb3879 100644 --- a/config.c +++ b/config.c @@ -118,6 +118,7 @@ struct config_item config_tab[] = { PORT_ITEM_INT("min_neighbor_prop_delay", -20000000, INT_MIN, -1), PORT_ITEM_INT("neighborPropDelayThresh", 20000000, 0, 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), GLOB_ITEM_DBL("pi_integral_const", 0.0, 0.0, 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; 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")) { if (MAC_LEN != sscanf(value, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5])) diff --git a/ptp4l.c b/ptp4l.c index f3df299..32c022d 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -44,7 +44,6 @@ static struct config cfg_settings = { .dds = { .dds = { - .clockQuality.offsetScaledLogVariance = 0xffff, .domainNumber = 0, }, .clock_desc = { @@ -223,6 +222,8 @@ int main(int argc, char *argv[]) ds->clockQuality.clockClass = config_get_int(cfg, NULL, "clockClass"); 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")) { ds->flags |= DDS_SLAVE_ONLY;