0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _LINUX_KOBJECT_NS_H
0017 #define _LINUX_KOBJECT_NS_H
0018
0019 struct sock;
0020 struct kobject;
0021
0022
0023
0024
0025
0026 enum kobj_ns_type {
0027 KOBJ_NS_TYPE_NONE = 0,
0028 KOBJ_NS_TYPE_NET,
0029 KOBJ_NS_TYPES
0030 };
0031
0032
0033
0034
0035
0036
0037
0038
0039 struct kobj_ns_type_operations {
0040 enum kobj_ns_type type;
0041 bool (*current_may_mount)(void);
0042 void *(*grab_current_ns)(void);
0043 const void *(*netlink_ns)(struct sock *sk);
0044 const void *(*initial_ns)(void);
0045 void (*drop_ns)(void *);
0046 };
0047
0048 int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
0049 int kobj_ns_type_registered(enum kobj_ns_type type);
0050 const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
0051 const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);
0052
0053 bool kobj_ns_current_may_mount(enum kobj_ns_type type);
0054 void *kobj_ns_grab_current(enum kobj_ns_type type);
0055 const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
0056 const void *kobj_ns_initial(enum kobj_ns_type type);
0057 void kobj_ns_drop(enum kobj_ns_type type, void *ns);
0058
0059 #endif