]>
git.proxmox.com Git - mirror_iproute2.git/blob - include/namespace.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NAMESPACE_H__
3 #define __NAMESPACE_H__ 1
8 #include <sys/syscall.h>
12 #define NETNS_RUN_DIR "/var/run/netns"
16 #define NETNS_ETC_DIR "/etc/netns"
20 #define CLONE_NEWNET 0x40000000 /* New network namespace (lo, device, names sockets, etc) */
24 #define MNT_DETACH 0x00000002 /* Just detach from the tree */
25 #endif /* MNT_DETACH */
27 /* sys/mount.h may be out too old to have these */
33 #define MS_SLAVE (1 << 19)
37 #define MS_SHARED (1 << 20)
41 static inline int setns(int fd
, int nstype
)
44 return syscall(__NR_setns
, fd
, nstype
);
50 #endif /* HAVE_SETNS */
52 int netns_switch(char *netns
);
53 int netns_get_fd(const char *netns
);
54 int netns_foreach(int (*func
)(char *nsname
, void *arg
), void *arg
);
57 int (*func
)(char *nsname
, void *arg
);
61 #endif /* __NAMESPACE_H__ */