diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-03 03:08:04 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-03 03:08:04 +0200 |
commit | 48f77c26dcb4a9e8d09e718f1b16e6b97c04d9b9 (patch) | |
tree | 97c5c77b15b82e5ba68f0b60abb04151ca78821a /src/babel.h | |
parent | 8ca5dead7f2870ae7a3ea40f40bec5cb9acde2d0 (diff) | |
download | babel-48f77c26dcb4a9e8d09e718f1b16e6b97c04d9b9.tar babel-48f77c26dcb4a9e8d09e718f1b16e6b97c04d9b9.zip |
Add gp_babel_since helper
Diffstat (limited to 'src/babel.h')
-rw-r--r-- | src/babel.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/babel.h b/src/babel.h index 93a3bcd..0b0b4d4 100644 --- a/src/babel.h +++ b/src/babel.h @@ -152,6 +152,13 @@ static inline bool gp_babel_less(uint16_t a, uint16_t b) { return (diff < 0); } +static inline int64_t gp_babel_since(gmrf_context_t *ctx, gmrf_time_t t) { + if (t == gmrf_time_unspec) + return INT64_MAX; + + return (gmrf_now(ctx->gmrf) - t)/10; +} + static inline bool gp_babel_is_metric_better(gp_babel_metric_seqno_t ms1, gp_babel_metric_seqno_t ms2) { if (ms1.metric == GP_BABEL_INFINITY) return false; |