From 8d6d74cdf43d7560eab3cf609cab27e5deb816e0 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 20 Feb 2020 09:45:16 +0000 Subject: vlib: Punt reason allocation listener enable/disable callback Type: improvement allow clients that allocate punt reasons to pass a callback function that is invoked when the first/last client registers to use/listen on that punt reason. This allows the client to perform some necessary configs that might not otherwise be enabled. IPSec uses this callback to register the ESP proto and UDP handling nodes, that would not otherwise be enabled unless a tunnel was present. Change-Id: I9759349903f21ffeeb253d4271e619e6bf46054b Signed-off-by: Neale Ranns --- src/plugins/unittest/punt_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/unittest') diff --git a/src/plugins/unittest/punt_test.c b/src/plugins/unittest/punt_test.c index 4a7503687db..431624fbea0 100644 --- a/src/plugins/unittest/punt_test.c +++ b/src/plugins/unittest/punt_test.c @@ -317,9 +317,11 @@ punt_test (vlib_main_t * vm, punt_hdl = vlib_punt_client_register ("test"); rc = - vlib_punt_reason_alloc (punt_hdl, "reason-v4", &punt_reason_v4); + vlib_punt_reason_alloc (punt_hdl, "reason-v4", + NULL, NULL, &punt_reason_v4); rc |= - vlib_punt_reason_alloc (punt_hdl, "reason-v6", &punt_reason_v6); + vlib_punt_reason_alloc (punt_hdl, "reason-v6", + NULL, NULL, &punt_reason_v6); ASSERT (!rc); vnet_feature_enable_disable ("ip4-unicast", -- cgit 1.2.3-korg