2012-01-26 15:27:00 +04:00
|
|
|
#ifndef __CR_NS_H__
|
|
|
|
#define __CR_NS_H__
|
2012-06-19 15:53:00 +04:00
|
|
|
|
|
|
|
#include "crtools.h"
|
2012-10-08 18:59:36 +04:00
|
|
|
#include "pstree.h"
|
2013-05-18 04:00:05 +04:00
|
|
|
#include "files.h"
|
2012-06-19 15:53:00 +04:00
|
|
|
|
2013-01-15 23:24:01 +04:00
|
|
|
struct ns_desc {
|
2013-05-15 00:37:44 +04:00
|
|
|
unsigned int cflag;
|
|
|
|
char *str;
|
2013-05-20 13:30:17 +04:00
|
|
|
size_t len;
|
2013-01-15 23:24:01 +04:00
|
|
|
};
|
|
|
|
|
2013-05-20 13:30:17 +04:00
|
|
|
#define NS_DESC_ENTRY(_cflag, _str) \
|
|
|
|
{ \
|
|
|
|
.cflag = _cflag, \
|
|
|
|
.str = _str, \
|
|
|
|
.len = sizeof(_str) - 1, \
|
|
|
|
}
|
|
|
|
|
2013-05-18 04:00:05 +04:00
|
|
|
extern bool check_ns_proc(struct fd_link *link);
|
|
|
|
|
2013-05-15 00:37:44 +04:00
|
|
|
extern struct ns_desc pid_ns_desc;
|
2013-05-20 13:30:17 +04:00
|
|
|
extern struct ns_desc user_ns_desc;
|
2013-05-15 00:37:44 +04:00
|
|
|
extern unsigned long current_ns_mask;
|
|
|
|
|
2013-05-18 04:00:05 +04:00
|
|
|
extern int dump_ns_file(struct fd_parms *p, int lfd, const int fdinfo);
|
|
|
|
extern int collect_ns_files(void);
|
|
|
|
|
2013-05-15 00:37:44 +04:00
|
|
|
int dump_namespaces(struct pid *pid, unsigned int ns_flags);
|
|
|
|
int prepare_namespace(int pid, unsigned long clone_flags);
|
2013-05-28 21:11:13 +04:00
|
|
|
int try_show_namespaces(int pid);
|
2013-05-15 00:37:44 +04:00
|
|
|
|
2013-01-15 23:24:01 +04:00
|
|
|
int switch_ns(int pid, struct ns_desc *nd, int *rst);
|
|
|
|
int restore_ns(int rst, struct ns_desc *nd);
|
2012-12-25 22:40:24 +04:00
|
|
|
|
2013-01-18 13:18:33 +04:00
|
|
|
int dump_task_ns_ids(struct pstree_item *);
|
|
|
|
|
2012-12-25 22:40:24 +04:00
|
|
|
#endif /* __CR_NS_H__ */
|