From 8bd4db5996ba1144f659ea5341f1c2727c650bcd Mon Sep 17 00:00:00 2001 From: Steven Luong Date: Mon, 24 Oct 2022 09:10:59 -0700 Subject: vxlan: convert vxlan to a plugin per https://jira.fd.io/browse/VPP-2058 Type: improvement Signed-off-by: Steven Luong Change-Id: Ica0828de218d25ada2d0d1491e373c3b78179ac1 --- src/plugins/nsh/nsh.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/plugins/nsh/nsh.c') diff --git a/src/plugins/nsh/nsh.c b/src/plugins/nsh/nsh.c index ea084e4a553..391fa8dbac5 100644 --- a/src/plugins/nsh/nsh.c +++ b/src/plugins/nsh/nsh.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -188,6 +188,7 @@ nsh_init (vlib_main_t * vm) nsh_main_t *nm = &nsh_main; clib_error_t *error = 0; uword next_node; + vlib_node_registration_t *vxlan4_input, *vxlan6_input; /* Init the main structures from VPP */ nm->vlib_main = vm; @@ -250,8 +251,17 @@ nsh_init (vlib_main_t * vm) nsh_aware_vnf_proxy_node.index); /* Add NSH-Proxy support */ - vlib_node_add_next (vm, vxlan4_input_node.index, nm->nsh_proxy_node_index); - vlib_node_add_next (vm, vxlan6_input_node.index, nm->nsh_proxy_node_index); + vxlan4_input = + vlib_get_plugin_symbol ("vxlan_plugin.so", "vxlan4_input_node"); + vxlan6_input = + vlib_get_plugin_symbol ("vxlan_plugin.so", "vxlan6_input_node"); + if (vxlan4_input == 0 || vxlan6_input == 0) + { + error = clib_error_return (0, "vxlan_plugin.so is not loaded"); + return error; + } + vlib_node_add_next (vm, vxlan4_input->index, nm->nsh_proxy_node_index); + vlib_node_add_next (vm, vxlan6_input->index, nm->nsh_proxy_node_index); /* Add NSH-Classifier support */ vlib_node_add_next (vm, ip4_classify_node.index, -- cgit 1.2.3-korg