The config code was simplistic at first and has grown many warts over
time.  The pointers to global variables are rather gross, and it is
hard to add new options, especially port specific ones.  The number of
configuration options is sure to grow larger over time.

This series addresses the issues by implementing a hash table based
implementation.  Adding a new option is as simple as putting a call to
config_add_TYPE() into the config_init function, and then calling
config_global/port_item() at the usage site.

The existing code has not been changed, but many if not all of the
legacy options can be converted to the new system.  Once this is done,
the config code will be much more compact and maintainable.

Review and comments are most welcome.

Thanks,
Richard


Richard Cochran (9):
  clock: store the configuration in the clock data structure.
  clock: add a method to obtain the configuration.
  pmc: require a configuration for creating a PMC instance.
  transport: store the configuration in the transport data structure.
  Introduce a simple hash table implementation.
  config: Add a hash table into the data structure.
  config: introduce a new API for reading configuration settings.
  config: add an option for specifying the UDP TTL.
  udp: configure the socket with the TTL option.

 clock.c             |  14 ++++-
 clock.h             |  15 ++++-
 config.c            | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 config.h            |  32 +++++++++++
 hash.c              | 113 ++++++++++++++++++++++++++++++++++++++
 hash.h              |  59 ++++++++++++++++++++
 makefile            |  12 ++--
 phc2sys.c           |  13 +++--
 pmc.c               |   6 +-
 pmc_common.c        |   9 +--
 pmc_common.h        |   8 ++-
 port.c              |   2 +-
 ptp4l.c             |   6 +-
 transport.c         |   7 ++-
 transport.h         |   6 +-
 transport_private.h |   1 +
 udp.c               |  20 ++++++-
 17 files changed, 439 insertions(+), 38 deletions(-)
 create mode 100644 hash.c
 create mode 100644 hash.h

-- 
2.1.4


------------------------------------------------------------------------------
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to