diff --git a/clock.c b/clock.c index 6d4ee9b..b71bfbe 100644 --- a/clock.c +++ b/clock.c @@ -32,7 +32,6 @@ #include "port.h" #include "servo.h" #include "print.h" -#include "tmv.h" #include "util.h" #define FAULT_RESET_SECONDS 15 @@ -411,6 +410,11 @@ void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx, pr_debug("path delay %10lld %10lld", c->path_delay, pd); } +void clock_peer_delay(struct clock *c, tmv_t ppd) +{ + c->path_delay = ppd; +} + void clock_remove_fda(struct clock *c, struct port *p, struct fdarray fda) { int i, j, k; diff --git a/clock.h b/clock.h index 42ee692..558a3ae 100644 --- a/clock.h +++ b/clock.h @@ -22,6 +22,7 @@ #include "ds.h" #include "servo.h" +#include "tmv.h" #include "transport.h" #define MAX_PORTS 8 @@ -128,6 +129,13 @@ struct PortIdentity clock_parent_identity(struct clock *c); void clock_path_delay(struct clock *c, struct timespec req, struct timestamp rx, Integer64 correction); +/** + * Provide the estimated peer delay from a slave port. + * @param c The clock instance. + * @param ppd The peer delay as measured on a slave port. + */ +void clock_peer_delay(struct clock *c, tmv_t ppd); + /** * Poll for events and dispatch them. * @param c A pointer to a clock instance obtained with clock_create().