aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/mactime/mactime.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-10-14 11:26:15 -0400
committerDamjan Marion <dmarion@me.com>2019-10-14 22:42:49 +0000
commitef3c11ca93b651611af33ab3e5d64217504d221d (patch)
treebbfcd40ab4fd6e884b6f9bf2b2deea7038aa52de /src/plugins/mactime/mactime.c
parent8d829f6c480cdd6536537fc49356baa1878b9570 (diff)
mactime: add the "mactime.json" builtin URL
If the http static server plugin is enabled, register the name "mactime.json" with the server. Visiting <web-root>/mactime.json produces a json brain-dump of the mactime table. Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ie39b0c776675864a85251b8c07fbf719d399f6de
Diffstat (limited to 'src/plugins/mactime/mactime.c')
-rw-r--r--src/plugins/mactime/mactime.c7
1 files changed, 7 insertions, 0 deletions
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;
}