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.