]>
git.proxmox.com Git - mirror_iproute2.git/blob - include/namespace.h
1 #ifndef __NAMESPACE_H__
2 #define __NAMESPACE_H__ 1
7 #include <sys/syscall.h>
10 #define NETNS_RUN_DIR "/var/run/netns"
11 #define NETNS_ETC_DIR "/etc/netns"
14 #define CLONE_NEWNET 0x40000000 /* New network namespace (lo, device, names sockets, etc) */
18 #define MNT_DETACH 0x00000002 /* Just detach from the tree */
19 #endif /* MNT_DETACH */
21 /* sys/mount.h may be out too old to have these */
27 #define MS_SLAVE (1 << 19)
31 #define MS_SHARED (1 << 20)
35 static inline int setns(int fd
, int nstype
)
38 return syscall(__NR_setns
, fd
, nstype
);
44 #endif /* HAVE_SETNS */
46 int netns_switch(char *netns
);
47 int netns_get_fd(const char *netns
);
48 int netns_foreach(int (*func
)(char *nsname
, void *arg
), void *arg
);
51 int (*func
)(char *nsname
, void *arg
);
55 #endif /* __NAMESPACE_H__ */