diff --git a/clock.c b/clock.c index 08f0c42..30348dd 100644 --- a/clock.c +++ b/clock.c @@ -1187,6 +1187,11 @@ void clock_follow_up_info(struct clock *c, struct follow_up_info_tlv *f) sizeof(c->status.lastGmPhaseChange)); } +int clock_free_running(struct clock *c) +{ + return c->free_running ? 1 : 0; +} + int clock_gm_capable(struct clock *c) { return c->grand_master_capable; diff --git a/clock.h b/clock.h index d6a79bd..efde27f 100644 --- a/clock.h +++ b/clock.h @@ -141,6 +141,13 @@ struct port *clock_first_port(struct clock *c); */ void clock_follow_up_info(struct clock *c, struct follow_up_info_tlv *f); +/** + * Determine if a clock is free running or not. + * @param c The clock instance. + * @return One if the clock is free running or zero otherwise. + */ +int clock_free_running(struct clock *c); + /** * Obtain the gmCapable flag from a clock's default data set. * This function is specific to the 802.1AS standard.