]>
git.proxmox.com Git - mirror_iproute2.git/blob - include/namespace.h
1 #ifndef __NAMESPACE_H__
2 #define __NAMESPACE_H__ 1
6 #include <sys/syscall.h>
9 #define NETNS_RUN_DIR "/var/run/netns"
10 #define NETNS_ETC_DIR "/etc/netns"
13 #define CLONE_NEWNET 0x40000000 /* New network namespace (lo, device, names sockets, etc) */
17 #define MNT_DETACH 0x00000002 /* Just detach from the tree */
18 #endif /* MNT_DETACH */
20 /* sys/mount.h may be out too old to have these */
26 #define MS_SLAVE (1 << 19)
30 #define MS_SHARED (1 << 20)
34 static inline int setns(int fd
, int nstype
)
37 return syscall(__NR_setns
, fd
, nstype
);
43 #endif /* HAVE_SETNS */
45 extern int netns_switch(char *netns
);
46 extern int netns_get_fd(const char *netns
);
48 #endif /* __NAMESPACE_H__ */