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 <richardcochran@gmail.com>
master
Richard Cochran 2017-11-23 23:11:07 -08:00
parent 9d48046e95
commit fb2c979182
2 changed files with 12 additions and 0 deletions

View File

@ -760,6 +760,11 @@ struct config *clock_config(struct clock *c)
return c->config; 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, static int clock_add_port(struct clock *c, int phc_index,
enum timestamp_type timestamping, enum timestamp_type timestamping,
struct interface *iface) struct interface *iface)

View File

@ -72,6 +72,13 @@ UInteger8 clock_class(struct clock *c);
*/ */
struct config *clock_config(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. * Obtains the required time stamping mode.
* @param c The clock instance. * @param c The clock instance.