From ef3c11ca93b651611af33ab3e5d64217504d221d Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Mon, 14 Oct 2019 11:26:15 -0400 Subject: mactime: add the "mactime.json" builtin URL If the http static server plugin is enabled, register the name "mactime.json" with the server. Visiting /mactime.json produces a json brain-dump of the mactime table. Type: feature Signed-off-by: Dave Barach Change-Id: Ie39b0c776675864a85251b8c07fbf719d399f6de --- src/plugins/mactime/mactime.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins/mactime/mactime.c') diff --git a/src/plugins/mactime/mactime.c b/src/plugins/mactime/mactime.c index 06fa7084f99..cd2f5091c7b 100644 --- a/src/plugins/mactime/mactime.c +++ b/src/plugins/mactime/mactime.c @@ -64,6 +64,7 @@ mactime_enable_disable (mactime_main_t * mm, u32 sw_if_index, { vnet_sw_interface_t *sw; int rv = 0; + static u8 url_init_done; feature_init (mm); @@ -81,6 +82,12 @@ mactime_enable_disable (mactime_main_t * mm, u32 sw_if_index, sw_if_index, enable_disable, 0, 0); vnet_feature_enable_disable ("interface-output", "mactime-tx", sw_if_index, enable_disable, 0, 0); + if (url_init_done == 0) + { + mactime_url_init (mm->vlib_main); + url_init_done = 1; + } + return rv; } -- cgit 1.2.3-korg