From fb2c979182d8370ecc4d3232ab05e5560df9e8c2 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Thu, 23 Nov 2017 23:11:07 -0800 Subject: [PATCH] clock: Introduce a method to get the current dataset. As part of the NetSync Monitor protocol, the port will need to have access to the current data set. This patch adds the appropriate function. Signed-off-by: Richard Cochran --- clock.c | 5 +++++ clock.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/clock.c b/clock.c index 5f13a5a..742a7cb 100644 --- a/clock.c +++ b/clock.c @@ -760,6 +760,11 @@ struct config *clock_config(struct clock *c) return c->config; } +struct currentDS *clock_current_dataset(struct clock *c) +{ + return &c->cur; +} + 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 986d363..64c5131 100644 --- a/clock.h +++ b/clock.h @@ -72,6 +72,13 @@ UInteger8 clock_class(struct clock *c); */ struct config *clock_config(struct clock *c); +/** + * Obtains a reference to the current dataset. + * @param c The clock instance. + * @return A pointer to the current dataset, without fail. + */ +struct currentDS *clock_current_dataset(struct clock *c); + /** * Obtains the required time stamping mode. * @param c The clock instance.