diff options
Diffstat (limited to 'include/net/ip.h')
-rw-r--r-- | include/net/ip.h | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index 503994a38ed1..890f9725d681 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -61,11 +61,14 @@ struct ipcm_cookie { | |||
61 | struct ip_ra_chain { | 61 | struct ip_ra_chain { |
62 | struct ip_ra_chain *next; | 62 | struct ip_ra_chain *next; |
63 | struct sock *sk; | 63 | struct sock *sk; |
64 | void (*destructor)(struct sock *); | 64 | union { |
65 | void (*destructor)(struct sock *); | ||
66 | struct sock *saved_sk; | ||
67 | }; | ||
68 | struct rcu_head rcu; | ||
65 | }; | 69 | }; |
66 | 70 | ||
67 | extern struct ip_ra_chain *ip_ra_chain; | 71 | extern struct ip_ra_chain *ip_ra_chain; |
68 | extern rwlock_t ip_ra_lock; | ||
69 | 72 | ||
70 | /* IP flags. */ | 73 | /* IP flags. */ |
71 | #define IP_CE 0x8000 /* Flag: "Congestion" */ | 74 | #define IP_CE 0x8000 /* Flag: "Congestion" */ |
@@ -101,7 +104,7 @@ extern int ip_do_nat(struct sk_buff *skb); | |||
101 | extern void ip_send_check(struct iphdr *ip); | 104 | extern void ip_send_check(struct iphdr *ip); |
102 | extern int __ip_local_out(struct sk_buff *skb); | 105 | extern int __ip_local_out(struct sk_buff *skb); |
103 | extern int ip_local_out(struct sk_buff *skb); | 106 | extern int ip_local_out(struct sk_buff *skb); |
104 | extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); | 107 | extern int ip_queue_xmit(struct sk_buff *skb); |
105 | extern void ip_init(void); | 108 | extern void ip_init(void); |
106 | extern int ip_append_data(struct sock *sk, | 109 | extern int ip_append_data(struct sock *sk, |
107 | int getfrag(void *from, char *to, int offset, int len, | 110 | int getfrag(void *from, char *to, int offset, int len, |
@@ -162,12 +165,12 @@ struct ipv4_config { | |||
162 | }; | 165 | }; |
163 | 166 | ||
164 | extern struct ipv4_config ipv4_config; | 167 | extern struct ipv4_config ipv4_config; |
165 | #define IP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.ip_statistics, field) | 168 | #define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field) |
166 | #define IP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.ip_statistics, field) | 169 | #define IP_INC_STATS_BH(net, field) SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field) |
167 | #define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.ip_statistics, field, val) | 170 | #define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val) |
168 | #define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS_BH((net)->mib.ip_statistics, field, val) | 171 | #define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS64_BH((net)->mib.ip_statistics, field, val) |
169 | #define IP_UPD_PO_STATS(net, field, val) SNMP_UPD_PO_STATS((net)->mib.ip_statistics, field, val) | 172 | #define IP_UPD_PO_STATS(net, field, val) SNMP_UPD_PO_STATS64((net)->mib.ip_statistics, field, val) |
170 | #define IP_UPD_PO_STATS_BH(net, field, val) SNMP_UPD_PO_STATS_BH((net)->mib.ip_statistics, field, val) | 173 | #define IP_UPD_PO_STATS_BH(net, field, val) SNMP_UPD_PO_STATS64_BH((net)->mib.ip_statistics, field, val) |
171 | #define NET_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.net_statistics, field) | 174 | #define NET_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.net_statistics, field) |
172 | #define NET_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.net_statistics, field) | 175 | #define NET_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.net_statistics, field) |
173 | #define NET_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->mib.net_statistics, field) | 176 | #define NET_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->mib.net_statistics, field) |
@@ -175,7 +178,15 @@ extern struct ipv4_config ipv4_config; | |||
175 | #define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd) | 178 | #define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd) |
176 | 179 | ||
177 | extern unsigned long snmp_fold_field(void __percpu *mib[], int offt); | 180 | extern unsigned long snmp_fold_field(void __percpu *mib[], int offt); |
178 | extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize); | 181 | #if BITS_PER_LONG==32 |
182 | extern u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t sync_off); | ||
183 | #else | ||
184 | static inline u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp_off) | ||
185 | { | ||
186 | return snmp_fold_field(mib, offt); | ||
187 | } | ||
188 | #endif | ||
189 | extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align); | ||
179 | extern void snmp_mib_free(void __percpu *ptr[2]); | 190 | extern void snmp_mib_free(void __percpu *ptr[2]); |
180 | 191 | ||
181 | extern struct local_ports { | 192 | extern struct local_ports { |
@@ -184,6 +195,12 @@ extern struct local_ports { | |||
184 | } sysctl_local_ports; | 195 | } sysctl_local_ports; |
185 | extern void inet_get_local_port_range(int *low, int *high); | 196 | extern void inet_get_local_port_range(int *low, int *high); |
186 | 197 | ||
198 | extern unsigned long *sysctl_local_reserved_ports; | ||
199 | static inline int inet_is_reserved_local_port(int port) | ||
200 | { | ||
201 | return test_bit(port, sysctl_local_reserved_ports); | ||
202 | } | ||
203 | |||
187 | extern int sysctl_ip_default_ttl; | 204 | extern int sysctl_ip_default_ttl; |
188 | extern int sysctl_ip_nonlocal_bind; | 205 | extern int sysctl_ip_nonlocal_bind; |
189 | 206 | ||
@@ -352,11 +369,11 @@ enum ip_defrag_users { | |||
352 | IP_DEFRAG_LOCAL_DELIVER, | 369 | IP_DEFRAG_LOCAL_DELIVER, |
353 | IP_DEFRAG_CALL_RA_CHAIN, | 370 | IP_DEFRAG_CALL_RA_CHAIN, |
354 | IP_DEFRAG_CONNTRACK_IN, | 371 | IP_DEFRAG_CONNTRACK_IN, |
355 | __IP_DEFRAG_CONNTRACK_IN_END = IP_DEFRAG_CONNTRACK_IN + USHORT_MAX, | 372 | __IP_DEFRAG_CONNTRACK_IN_END = IP_DEFRAG_CONNTRACK_IN + USHRT_MAX, |
356 | IP_DEFRAG_CONNTRACK_OUT, | 373 | IP_DEFRAG_CONNTRACK_OUT, |
357 | __IP_DEFRAG_CONNTRACK_OUT_END = IP_DEFRAG_CONNTRACK_OUT + USHORT_MAX, | 374 | __IP_DEFRAG_CONNTRACK_OUT_END = IP_DEFRAG_CONNTRACK_OUT + USHRT_MAX, |
358 | IP_DEFRAG_CONNTRACK_BRIDGE_IN, | 375 | IP_DEFRAG_CONNTRACK_BRIDGE_IN, |
359 | __IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + USHORT_MAX, | 376 | __IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + USHRT_MAX, |
360 | IP_DEFRAG_VS_IN, | 377 | IP_DEFRAG_VS_IN, |
361 | IP_DEFRAG_VS_OUT, | 378 | IP_DEFRAG_VS_OUT, |
362 | IP_DEFRAG_VS_FWD | 379 | IP_DEFRAG_VS_FWD |
@@ -393,6 +410,7 @@ extern int ip_options_rcv_srr(struct sk_buff *skb); | |||
393 | * Functions provided by ip_sockglue.c | 410 | * Functions provided by ip_sockglue.c |
394 | */ | 411 | */ |
395 | 412 | ||
413 | extern int ip_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | ||
396 | extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); | 414 | extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); |
397 | extern int ip_cmsg_send(struct net *net, | 415 | extern int ip_cmsg_send(struct net *net, |
398 | struct msghdr *msg, struct ipcm_cookie *ipc); | 416 | struct msghdr *msg, struct ipcm_cookie *ipc); |