This function is intended to be used by phc2sys in order to ignore (ie: not warn) about options in the configuration file specific to ptp4l. Since phc2sys reads from the global section as well as its own specific section, it is important to ensure that phc2sys won't complain about ptp4l options.
Add an array of known strings which all future global options must be added to. Signed-off-by: Jacob Keller <jacob.e.kel...@intel.com> --- config.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ config.h | 2 ++ 2 files changed, 92 insertions(+) diff --git a/config.c b/config.c index 74c9e5fbccda..ee5f251fa6c9 100644 --- a/config.c +++ b/config.c @@ -27,6 +27,96 @@ #include "print.h" #include "util.h" +static const char *all_global_options[] = { + "delayAsymmetry", + "logAnnounceInterval", + "logSyncInterval", + "logMinDelayReqInterval", + "logMinPdelayReqInterval", + "announceReceiptTimeout", + "syncReceiptTimeout", + "transportSpecific", + "path_trace_enabled", + "follow_up_info", + "neighborPropDelayThresh", + "min_neighbor_prop_delay", + "egressLatency", + "ingressLatency", + "fault_badpeernet_interval", + "fault_reset_interval", + "network_transport", + "delay_mechanism", + "delay_filter", + "delay_filter_length", + "boundary_clock_jbod", + "twoStepFlag", + "slaveOnly", + "gmCapable", + "priority1", + "priority2", + "domainNumber", + "clockClass", + "clockAccuracy", + "offsetScaledLogVariance", + "free_running", + "freq_est_interval", + "assume_two_step", + "tx_timestamp_timeout", + "check_fup_sync", + "pi_proportional_const", + "pi_integral_const", + "pi_proportional_scale", + "pi_proportional_exponent", + "pi_proportional_norm_max", + "pi_integral_scale", + "pi_integral_exponent", + "pi_integral_norm_max", + "step_threshold", + "first_step_threshold", + "max_frequency", + "sanity_freq_limit", + "ntpshm_segment", + "ptp_dst_mac", + "p2p_dst_mac", + "udp6_scope", + "uds_address", + "logging_level", + "verbose", + "use_syslog", + "time_stamping", + "delay_mechanism", + "network_transport", + "clock_servo", + "productDescription", + "revisionData", + "userDescription", + "manufacturerIdentity", + "summary_interval", + "kernel_leap", + "timeSource", + "delay_filter", + "delay_filter_length", + "boundary_clock_jbod", + /* NULL indicates end of options */ + NULL, +}; + +/* used by phc2sys to ignore global options meant strictly for ptp4l */ +enum parser_result parse_known_global_options(const char *option) +{ + const char **item = &all_global_options[0]; + + while (*item != NULL) { + if (!strcmp(option, *item)) + return PARSED_OK; + + item++; + } + + /* we didn't find option in the list */ + return NOT_PARSED; +} + static enum parser_result parse_pod_setting(const char *option, const char *value, struct port_defaults *pod) diff --git a/config.h b/config.h index c870e42ef162..99aa75435218 100644 --- a/config.h +++ b/config.h @@ -95,9 +95,11 @@ struct config { int verbose; }; +enum parser_result parse_known_global_options(const char *option); int config_read(char *name, struct config *cfg); struct interface *config_create_interface(char *name, struct config *cfg); void config_init_interface(struct interface *iface, struct config *cfg); void config_destroy(struct config *cfg); + #endif -- 2.1.2.555.gfbecd99 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel