aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/net_namespace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r--include/net/net_namespace.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index a1202841aadd..bd10a7908993 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -28,6 +28,10 @@ struct ctl_table_header;
28struct net_generic; 28struct net_generic;
29struct sock; 29struct sock;
30 30
31
32#define NETDEV_HASHBITS 8
33#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS)
34
31struct net { 35struct net {
32 atomic_t count; /* To decided when the network 36 atomic_t count; /* To decided when the network
33 * namespace should be freed. 37 * namespace should be freed.
@@ -38,7 +42,8 @@ struct net {
38 */ 42 */
39#endif 43#endif
40 struct list_head list; /* list of network namespaces */ 44 struct list_head list; /* list of network namespaces */
41 struct work_struct work; /* work struct for freeing */ 45 struct list_head cleanup_list; /* namespaces on death row */
46 struct list_head exit_list; /* Use only net_mutex */
42 47
43 struct proc_dir_entry *proc_net; 48 struct proc_dir_entry *proc_net;
44 struct proc_dir_entry *proc_net_stat; 49 struct proc_dir_entry *proc_net_stat;
@@ -76,11 +81,13 @@ struct net {
76#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 81#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
77 struct netns_ct ct; 82 struct netns_ct ct;
78#endif 83#endif
84 struct sock *nfnl;
85 struct sock *nfnl_stash;
79#endif 86#endif
80#ifdef CONFIG_XFRM 87#ifdef CONFIG_XFRM
81 struct netns_xfrm xfrm; 88 struct netns_xfrm xfrm;
82#endif 89#endif
83#ifdef CONFIG_WIRELESS_EXT 90#ifdef CONFIG_WEXT_CORE
84 struct sk_buff_head wext_nlevents; 91 struct sk_buff_head wext_nlevents;
85#endif 92#endif
86 struct net_generic *gen; 93 struct net_generic *gen;
@@ -93,14 +100,9 @@ struct net {
93extern struct net init_net; 100extern struct net init_net;
94 101
95#ifdef CONFIG_NET 102#ifdef CONFIG_NET
96#define INIT_NET_NS(net_ns) .net_ns = &init_net,
97
98extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); 103extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns);
99 104
100#else /* CONFIG_NET */ 105#else /* CONFIG_NET */
101
102#define INIT_NET_NS(net_ns)
103
104static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) 106static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns)
105{ 107{
106 /* There is nothing to copy so this is a noop */ 108 /* There is nothing to copy so this is a noop */
@@ -232,6 +234,9 @@ struct pernet_operations {
232 struct list_head list; 234 struct list_head list;
233 int (*init)(struct net *net); 235 int (*init)(struct net *net);
234 void (*exit)(struct net *net); 236 void (*exit)(struct net *net);
237 void (*exit_batch)(struct list_head *net_exit_list);
238 int *id;
239 size_t size;
235}; 240};
236 241
237/* 242/*
@@ -255,12 +260,8 @@ struct pernet_operations {
255 */ 260 */
256extern int register_pernet_subsys(struct pernet_operations *); 261extern int register_pernet_subsys(struct pernet_operations *);
257extern void unregister_pernet_subsys(struct pernet_operations *); 262extern void unregister_pernet_subsys(struct pernet_operations *);
258extern int register_pernet_gen_subsys(int *id, struct pernet_operations *);
259extern void unregister_pernet_gen_subsys(int id, struct pernet_operations *);
260extern int register_pernet_device(struct pernet_operations *); 263extern int register_pernet_device(struct pernet_operations *);
261extern void unregister_pernet_device(struct pernet_operations *); 264extern void unregister_pernet_device(struct pernet_operations *);
262extern int register_pernet_gen_device(int *id, struct pernet_operations *);
263extern void unregister_pernet_gen_device(int id, struct pernet_operations *);
264 265
265struct ctl_path; 266struct ctl_path;
266struct ctl_table; 267struct ctl_table;