1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #ifndef _LINUX_KOBJECT_NS_H
17 #define _LINUX_KOBJECT_NS_H
18
19 struct sock;
20 struct kobject;
21
22
23
24
25
26 enum kobj_ns_type {
27 KOBJ_NS_TYPE_NONE = 0,
28 KOBJ_NS_TYPE_NET,
29 KOBJ_NS_TYPES
30 };
31
32
33
34
35
36
37
38
39 struct kobj_ns_type_operations {
40 enum kobj_ns_type type;
41 bool (*current_may_mount)(void);
42 void *(*grab_current_ns)(void);
43 const void *(*netlink_ns)(struct sock *sk);
44 const void *(*initial_ns)(void);
45 void (*drop_ns)(void *);
46 };
47
48 int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
49 int kobj_ns_type_registered(enum kobj_ns_type type);
50 const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
51 const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);
52
53 bool kobj_ns_current_may_mount(enum kobj_ns_type type);
54 void *kobj_ns_grab_current(enum kobj_ns_type type);
55 const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
56 const void *kobj_ns_initial(enum kobj_ns_type type);
57 void kobj_ns_drop(enum kobj_ns_type type, void *ns);
58
59 #endif