Skip to content

Commit

Permalink
clock: Introduce a method to get the current dataset.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
richardcochran committed Mar 8, 2018
1 parent 9d48046 commit fb2c979
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fb2c979

Please sign in to comment.