]>
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>
11 #define NETNS_RUN_DIR "/var/run/netns"
12 #define NETNS_ETC_DIR "/etc/netns"
15 #define CLONE_NEWNET 0x40000000 /* New network namespace (lo, device, names sockets, etc) */
19 #define MNT_DETACH 0x00000002 /* Just detach from the tree */
20 #endif /* MNT_DETACH */
22 /* sys/mount.h may be out too old to have these */
28 #define MS_SLAVE (1 << 19)
32 #define MS_SHARED (1 << 20)
36 static inline int setns(int fd
, int nstype
)
39 return syscall(__NR_setns
, fd
, nstype
);
45 #endif /* HAVE_SETNS */
47 int netns_switch(char *netns
);
48 int netns_get_fd(const char *netns
);
49 int netns_foreach(int (*func
)(char *nsname
, void *arg
), void *arg
);
52 int (*func
)(char *nsname
, void *arg
);
56 #endif /* __NAMESPACE_H__ */