aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/igmp/igmp_timer.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-11-13 13:27:18 +0000
committerOle Trøan <otroan@employees.org>2018-11-13 14:45:40 +0000
commite82eb635b1377c2b14d28127a121eabd10b3b83d (patch)
treec152b97a71b8e44a3a5b7918f69cfe492bdfb06d /src/plugins/igmp/igmp_timer.c
parent5d9df1db07969fea8f391bd48ba14cceb840da1e (diff)
IGMP: improve CLI debug output
Change-Id: If88fc3acdba1f73b3e8be94d8014556c5239596c Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/plugins/igmp/igmp_timer.c')
-rw-r--r--src/plugins/igmp/igmp_timer.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/plugins/igmp/igmp_timer.c b/src/plugins/igmp/igmp_timer.c
index 278b7db917e..afa0c3693c9 100644
--- a/src/plugins/igmp/igmp_timer.c
+++ b/src/plugins/igmp/igmp_timer.c
@@ -232,6 +232,28 @@ igmp_timer_retire (igmp_timer_id_t * tid)
IGMP_PROCESS_EVENT_UPDATE_TIMER, 0);
}
+u8 *
+format_igmp_timer_id (u8 * s, va_list * args)
+{
+ igmp_timer_id_t tid = va_arg (*args, igmp_timer_id_t);
+ igmp_timer_t *timer;
+
+ if (IGMP_TIMER_ID_INVALID == tid)
+ {
+ s = format (s, "not-running");
+ }
+ else
+ {
+ timer = pool_elt_at_index (timer_pool, tid);
+
+ s =
+ format (s, "[expires-in:%f]",
+ timer->exp_time - vlib_time_now (vlib_get_main ()));
+ }
+
+ return (s);
+}
+
/*
* fd.io coding-style-patch-verification: ON
*