clock: Introduce a method to obtain the last synchronization time.

The NetSync Monitor protocol will require us to report the time stamp of
the last synchronization.  This patch adds new the method.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2017-11-26 19:19:15 -08:00
parent fb2c979182
commit 36550e415c
2 changed files with 12 additions and 0 deletions

View File

@ -1287,6 +1287,11 @@ static void clock_forward_mgmt_msg(struct clock *c, struct port *p, struct ptp_m
}
}
tmv_t clock_ingress_time(struct clock *c)
{
return c->ingress_ts;
}
int clock_manage(struct clock *c, struct port *p, struct ptp_message *msg)
{
int changed = 0, res, answers;

View File

@ -156,6 +156,13 @@ struct ClockIdentity clock_identity(struct clock *c);
*/
void clock_fda_changed(struct clock *c);
/**
* Obtains the time of the latest synchronization.
* @param c The clock instance.
* @return The local time stamp of the last received Sync message.
*/
tmv_t clock_ingress_time(struct clock *c);
/**
* Manage the clock according to a given message.
* @param c The clock instance.