Add a new configuration section phc2sys which is ignored by ptp4l. It
may be worth adding a "port:" prefix to all per-port configuration in
the configuration file (and deprecate the old syntax) in order to allow
full expression of subsections and port names. Currently it will not be
possible for a network device name to match a subsection name. This is
not a large problem at present, however.

Signed-off-by: Jacob Keller <jacob.e.kel...@intel.com>
---
 config.c | 2 ++
 util.c   | 2 ++
 util.h   | 1 +
 3 files changed, 5 insertions(+)

diff --git a/config.c b/config.c
index 7e783f3f7f88..74c9e5fbccda 100644
--- a/config.c
+++ b/config.c
@@ -664,6 +664,8 @@ int config_read(char *name, struct config *cfg)
                case UNKNOWN_SECTION:
                        fprintf(stderr, "line %d is not in a section\n", 
line_num);
                        goto parse_error;
+               /* ignore phc2sys specific configuration */
+               case PHC2SYS_SECTION:
                default:
                        continue;
                }
diff --git a/util.c b/util.c
index 861d1269bdd9..1991892b36c2 100644
--- a/util.c
+++ b/util.c
@@ -221,6 +221,8 @@ enum parser_result parse_section_line(char *s, enum 
config_section *section)
 {
        if (!strcasecmp(s, "[global]")) {
                *section = GLOBAL_SECTION;
+       } else if (!strcasecmp(s, "[phc2sys]")) {
+               *section = PHC2SYS_SECTION;
        } else if (s[0] == '[') {
                char c;
                *section = PORT_SECTION;
diff --git a/util.h b/util.h
index 3f2863899b3d..ac5eb89c655e 100644
--- a/util.h
+++ b/util.h
@@ -141,6 +141,7 @@ enum parser_result {
 enum config_section {
        GLOBAL_SECTION,
        PORT_SECTION,
+       PHC2SYS_SECTION,
        UNKNOWN_SECTION,
 };
 
-- 
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

Reply via email to