]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/ns.h
Merge pull request #5393 from ton31337/fix/update_rib_on_bgp_distance_changes_7.1
[mirror_frr.git] / lib / ns.h
index fac91a40da1c88a167e6d78472216290515f13f6..f3ad83788914cf16db9ca542a70e1d443d37c539 100644 (file)
--- a/lib/ns.h
+++ b/lib/ns.h
 #include "linklist.h"
 #include "vty.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef uint32_t ns_id_t;
 
 /* the default NS ID */
@@ -46,6 +50,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 +107,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 +140,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 map);
+
 /*
  * NS init routine
  * should be called from backendx
@@ -166,4 +178,8 @@ extern int ns_enable(struct ns *ns, void (*func)(ns_id_t, void *));
 extern struct ns *ns_get_created(struct ns *ns, char *name, ns_id_t ns_id);
 extern void ns_disable(struct ns *ns);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /*_ZEBRA_NS_H*/