]>
git.proxmox.com Git - mirror_iproute2.git/blob - include/namespace.h
1 #ifndef __NAMESPACE_H__
2 #define __NAMESPACE_H__ 1
8 #define NETNS_RUN_DIR "/var/run/netns"
9 #define NETNS_ETC_DIR "/etc/netns"
12 #define CLONE_NEWNET 0x40000000 /* New network namespace (lo, device, names sockets, etc) */
16 #define MNT_DETACH 0x00000002 /* Just detach from the tree */
17 #endif /* MNT_DETACH */
19 /* sys/mount.h may be out too old to have these */
25 #define MS_SLAVE (1 << 19)
29 #define MS_SHARED (1 << 20)
33 static int setns(int fd
, int nstype
)
36 return syscall(__NR_setns
, fd
, nstype
);
42 #endif /* HAVE_SETNS */
44 extern int netns_switch(char *netns
);
45 extern int netns_get_fd(const char *netns
);
47 #endif /* __NAMESPACE_H__ */