summaryrefslogtreecommitdiff
path: root/lib/ns.h
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2018-03-26 12:22:18 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2018-04-13 16:40:32 +0200
commit03aff2d8489e91b493ad24b8d8d8918831e156d8 (patch)
tree304e168835778c15f11d2c2ba9d96109e944dcb4 /lib/ns.h
parent0c2bac388029e12e4c21177cda02e72712f28efb (diff)
zebra: add an indirection table for ns_id
This list "table" is created in the case the netns backend for VRF is used. This contains the mapping between the NSID value read from the 'ip netns list' and the ns id external used to create the VRF value from vrf context. This mapping is necessary in order to reserve default 0 value for vrf_default. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'lib/ns.h')
-rw-r--r--lib/ns.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/ns.h b/lib/ns.h
index fac91a40da..ba857b630e 100644
--- a/lib/ns.h
+++ b/lib/ns.h
@@ -46,6 +46,9 @@ struct ns {
/* Identifier, same as the vector index */
ns_id_t ns_id;
+ /* Identifier, mapped on the NSID value */
+ ns_id_t internal_ns_id;
+
/* Name */
char *name;
@@ -100,7 +103,7 @@ extern void ns_terminate(void);
/* API to initialize NETNS managerment
* parameter is the default ns_id
*/
-extern void ns_init_management(ns_id_t ns_id);
+extern void ns_init_management(ns_id_t ns_id, ns_id_t internal_ns_idx);
/*
@@ -133,6 +136,11 @@ extern int ns_have_netns(void);
/* API to get context information of a NS */
extern void *ns_info_lookup(ns_id_t ns_id);
+/* API to map internal ns id value with
+ * user friendly ns id external value
+ */
+extern ns_id_t ns_map_nsid_with_external(ns_id_t ns_id, bool maporunmap);
+
/*
* NS init routine
* should be called from backendx