diff options
Diffstat (limited to 'include/net/netns')
-rw-r--r-- | include/net/netns/core.h | 16 | ||||
-rw-r--r-- | include/net/netns/dccp.h | 11 | ||||
-rw-r--r-- | include/net/netns/generic.h | 49 | ||||
-rw-r--r-- | include/net/netns/ipv4.h | 11 | ||||
-rw-r--r-- | include/net/netns/ipv6.h | 18 |
5 files changed, 105 insertions, 0 deletions
diff --git a/include/net/netns/core.h b/include/net/netns/core.h new file mode 100644 index 000000000000..24d4be76bbd1 --- /dev/null +++ b/include/net/netns/core.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __NETNS_CORE_H__ | ||
2 | #define __NETNS_CORE_H__ | ||
3 | |||
4 | struct ctl_table_header; | ||
5 | struct prot_inuse; | ||
6 | |||
7 | struct netns_core { | ||
8 | /* core sysctls */ | ||
9 | struct ctl_table_header *sysctl_hdr; | ||
10 | |||
11 | int sysctl_somaxconn; | ||
12 | |||
13 | struct prot_inuse *inuse; | ||
14 | }; | ||
15 | |||
16 | #endif | ||
diff --git a/include/net/netns/dccp.h b/include/net/netns/dccp.h new file mode 100644 index 000000000000..98d2a7ce1f71 --- /dev/null +++ b/include/net/netns/dccp.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef __NETNS_DCCP_H__ | ||
2 | #define __NETNS_DCCP_H__ | ||
3 | |||
4 | struct sock; | ||
5 | |||
6 | struct netns_dccp { | ||
7 | struct sock *v4_ctl_sk; | ||
8 | struct sock *v6_ctl_sk; | ||
9 | }; | ||
10 | |||
11 | #endif | ||
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h new file mode 100644 index 000000000000..0c04fd2a700b --- /dev/null +++ b/include/net/netns/generic.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * generic net pointers | ||
3 | */ | ||
4 | |||
5 | #ifndef __NET_GENERIC_H__ | ||
6 | #define __NET_GENERIC_H__ | ||
7 | |||
8 | #include <linux/rcupdate.h> | ||
9 | |||
10 | /* | ||
11 | * Generic net pointers are to be used by modules to put some private | ||
12 | * stuff on the struct net without explicit struct net modification | ||
13 | * | ||
14 | * The rules are simple: | ||
15 | * 1. register the ops with register_pernet_gen_device to get the id | ||
16 | * of your private pointer; | ||
17 | * 2. call net_assign_generic() to put the private data on the struct | ||
18 | * net (most preferably this should be done in the ->init callback | ||
19 | * of the ops registered); | ||
20 | * 3. do not change this pointer while the net is alive; | ||
21 | * 4. do not try to have any private reference on the net_generic object. | ||
22 | * | ||
23 | * After accomplishing all of the above, the private pointer can be | ||
24 | * accessed with the net_generic() call. | ||
25 | */ | ||
26 | |||
27 | struct net_generic { | ||
28 | unsigned int len; | ||
29 | struct rcu_head rcu; | ||
30 | |||
31 | void *ptr[0]; | ||
32 | }; | ||
33 | |||
34 | static inline void *net_generic(struct net *net, int id) | ||
35 | { | ||
36 | struct net_generic *ng; | ||
37 | void *ptr; | ||
38 | |||
39 | rcu_read_lock(); | ||
40 | ng = rcu_dereference(net->gen); | ||
41 | BUG_ON(id == 0 || id > ng->len); | ||
42 | ptr = ng->ptr[id - 1]; | ||
43 | rcu_read_unlock(); | ||
44 | |||
45 | return ptr; | ||
46 | } | ||
47 | |||
48 | extern int net_assign_generic(struct net *net, int id, void *data); | ||
49 | #endif | ||
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index a9b4f6086294..34ee348a2cf2 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -17,6 +17,7 @@ struct netns_ipv4 { | |||
17 | #ifdef CONFIG_SYSCTL | 17 | #ifdef CONFIG_SYSCTL |
18 | struct ctl_table_header *forw_hdr; | 18 | struct ctl_table_header *forw_hdr; |
19 | struct ctl_table_header *frags_hdr; | 19 | struct ctl_table_header *frags_hdr; |
20 | struct ctl_table_header *ipv4_hdr; | ||
20 | #endif | 21 | #endif |
21 | struct ipv4_devconf *devconf_all; | 22 | struct ipv4_devconf *devconf_all; |
22 | struct ipv4_devconf *devconf_dflt; | 23 | struct ipv4_devconf *devconf_dflt; |
@@ -26,6 +27,9 @@ struct netns_ipv4 { | |||
26 | struct hlist_head *fib_table_hash; | 27 | struct hlist_head *fib_table_hash; |
27 | struct sock *fibnl; | 28 | struct sock *fibnl; |
28 | 29 | ||
30 | struct sock **icmp_sk; | ||
31 | struct sock *tcp_sock; | ||
32 | |||
29 | struct netns_frags frags; | 33 | struct netns_frags frags; |
30 | #ifdef CONFIG_NETFILTER | 34 | #ifdef CONFIG_NETFILTER |
31 | struct xt_table *iptable_filter; | 35 | struct xt_table *iptable_filter; |
@@ -33,5 +37,12 @@ struct netns_ipv4 { | |||
33 | struct xt_table *iptable_raw; | 37 | struct xt_table *iptable_raw; |
34 | struct xt_table *arptable_filter; | 38 | struct xt_table *arptable_filter; |
35 | #endif | 39 | #endif |
40 | |||
41 | int sysctl_icmp_echo_ignore_all; | ||
42 | int sysctl_icmp_echo_ignore_broadcasts; | ||
43 | int sysctl_icmp_ignore_bogus_error_responses; | ||
44 | int sysctl_icmp_ratelimit; | ||
45 | int sysctl_icmp_ratemask; | ||
46 | int sysctl_icmp_errors_use_inbound_ifaddr; | ||
36 | }; | 47 | }; |
37 | #endif | 48 | #endif |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 1dd7de4e4195..ac053be6c256 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
@@ -36,5 +36,23 @@ struct netns_ipv6 { | |||
36 | struct xt_table *ip6table_mangle; | 36 | struct xt_table *ip6table_mangle; |
37 | struct xt_table *ip6table_raw; | 37 | struct xt_table *ip6table_raw; |
38 | #endif | 38 | #endif |
39 | struct rt6_info *ip6_null_entry; | ||
40 | struct rt6_statistics *rt6_stats; | ||
41 | struct timer_list *ip6_fib_timer; | ||
42 | struct hlist_head *fib_table_hash; | ||
43 | struct fib6_table *fib6_main_tbl; | ||
44 | struct dst_ops *ip6_dst_ops; | ||
45 | unsigned int ip6_rt_gc_expire; | ||
46 | unsigned long ip6_rt_last_gc; | ||
47 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | ||
48 | struct rt6_info *ip6_prohibit_entry; | ||
49 | struct rt6_info *ip6_blk_hole_entry; | ||
50 | struct fib6_table *fib6_local_tbl; | ||
51 | struct fib_rules_ops *fib6_rules_ops; | ||
52 | #endif | ||
53 | struct sock **icmp_sk; | ||
54 | struct sock *ndisc_sk; | ||
55 | struct sock *tcp_sk; | ||
56 | struct sock *igmp_sk; | ||
39 | }; | 57 | }; |
40 | #endif | 58 | #endif |