From 36550e415cbfdbb23b25e65fba35a9074c80ec0d Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sun, 26 Nov 2017 19:19:15 -0800 Subject: [PATCH] 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 --- clock.c | 5 +++++ clock.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/clock.c b/clock.c index 742a7cb..199c0cb 100644 --- a/clock.c +++ b/clock.c @@ -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; diff --git a/clock.h b/clock.h index 64c5131..94d4ad0 100644 --- a/clock.h +++ b/clock.h @@ -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.