This function allows the ports to read configuration variables without
changing the port method signatures.

Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
---
 clock.c | 5 +++++
 clock.h | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/clock.c b/clock.c
index 1569108..a47e1e9 100644
--- a/clock.c
+++ b/clock.c
@@ -755,6 +755,11 @@ UInteger8 clock_class(struct clock *c)
        return c->dds.clockQuality.clockClass;
 }
 
+struct config *clock_config(struct clock *c)
+{
+       return c->config;
+}
+
 static int clock_add_port(struct clock *c, int phc_index,
                          enum timestamp_type timestamping,
                          struct interface *iface)
diff --git a/clock.h b/clock.h
index 1e6cd98..d7377fe 100644
--- a/clock.h
+++ b/clock.h
@@ -58,6 +58,13 @@ struct port *clock_best_port(struct clock *c);
 UInteger8 clock_class(struct clock *c);
 
 /**
+ * Obtains a reference to the configuration database.
+ * @param c  The clock instance.
+ * @return   A pointer to the configuration, without fail.
+ */
+struct config *clock_config(struct clock *c);
+
+/**
  * Create a clock instance. There can only be one clock in any system,
  * so subsequent calls will destroy the previous clock instance.
  *
-- 
2.1.4


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

Reply via email to