diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-26 12:22:18 +0200 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-13 16:40:32 +0200 |
| commit | 03aff2d8489e91b493ad24b8d8d8918831e156d8 (patch) | |
| tree | 304e168835778c15f11d2c2ba9d96109e944dcb4 /lib/ns.h | |
| parent | 0c2bac388029e12e4c21177cda02e72712f28efb (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.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 |
