]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - include/namespace.h
Allow to configure /var/run/netns directory
[mirror_iproute2.git] / include / namespace.h
index 5add9d266b7dffd5f6314516b5ecc5b2c9ab59a1..e47f9b5d49d12fae39be243763d2a87df0446f7a 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef __NAMESPACE_H__
 #define __NAMESPACE_H__ 1
 
@@ -7,8 +8,13 @@
 #include <sys/syscall.h>
 #include <errno.h>
 
+#ifndef NETNS_RUN_DIR
 #define NETNS_RUN_DIR "/var/run/netns"
+#endif
+
+#ifndef NETNS_ETC_DIR
 #define NETNS_ETC_DIR "/etc/netns"
+#endif
 
 #ifndef CLONE_NEWNET
 #define CLONE_NEWNET 0x40000000        /* New network namespace (lo, device, names sockets, etc) */
@@ -43,9 +49,9 @@ static inline int setns(int fd, int nstype)
 }
 #endif /* HAVE_SETNS */
 
-extern int netns_switch(char *netns);
-extern int netns_get_fd(const char *netns);
-extern int netns_foreach(int (*func)(char *nsname, void *arg), void *arg);
+int netns_switch(char *netns);
+int netns_get_fd(const char *netns);
+int netns_foreach(int (*func)(char *nsname, void *arg), void *arg);
 
 struct netns_func {
        int (*func)(char *nsname, void *arg);