summaryrefslogtreecommitdiff
path: root/lib/ns.h
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2020-09-18 11:02:30 -0400
committerGitHub <noreply@github.com>2020-09-18 11:02:30 -0400
commit0a6e6613d73ccad69f749f689cc345973a8924fc (patch)
tree135ec46c8f951f6271edf44ad4173a1418acc58a /lib/ns.h
parent38281b61595a3eac33b6f0c3939257b2918567f2 (diff)
parentb0610ff7271eb72b69d50e6850ad9f3fb84dd62d (diff)
Merge pull request #7089 from pguibert6WIND/netns-refactor
Netns refactor
Diffstat (limited to 'lib/ns.h')
-rw-r--r--lib/ns.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/ns.h b/lib/ns.h
index 20e0a38e3b..286ff5b295 100644
--- a/lib/ns.h
+++ b/lib/ns.h
@@ -53,6 +53,11 @@ struct ns {
/* Identifier, mapped on the NSID value */
ns_id_t internal_ns_id;
+ /* Identifier, value of NSID of default netns,
+ * relative value in that local netns
+ */
+ ns_id_t relative_default_ns;
+
/* Name */
char *name;
@@ -120,7 +125,14 @@ int ns_socket(int domain, int type, int protocol, ns_id_t ns_id);
extern char *ns_netns_pathname(struct vty *vty, const char *name);
/* Parse and execute a function on all the NETNS */
-extern void ns_walk_func(int (*func)(struct ns *));
+#define NS_WALK_CONTINUE 0
+#define NS_WALK_STOP 1
+
+extern void ns_walk_func(int (*func)(struct ns *,
+ void *,
+ void **),
+ void *param_in,
+ void **param_out);
/* API to get the NETNS name, from the ns pointer */
extern const char *ns_get_name(struct ns *ns);
@@ -174,7 +186,9 @@ extern struct ns *ns_lookup_name(const char *name);
*/
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 ns_id_t ns_id_get_absolute(ns_id_t ns_id_reference, ns_id_t link_nsid);
extern void ns_disable(struct ns *ns);
+extern struct ns *ns_get_default(void);
#ifdef __cplusplus
}