aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip.h')
-rw-r--r--include/net/ip.h44
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 {
61struct ip_ra_chain { 61struct 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
67extern struct ip_ra_chain *ip_ra_chain; 71extern struct ip_ra_chain *ip_ra_chain;
68extern 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);
101extern void ip_send_check(struct iphdr *ip); 104extern void ip_send_check(struct iphdr *ip);
102extern int __ip_local_out(struct sk_buff *skb); 105extern int __ip_local_out(struct sk_buff *skb);
103extern int ip_local_out(struct sk_buff *skb); 106extern int ip_local_out(struct sk_buff *skb);
104extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); 107extern int ip_queue_xmit(struct sk_buff *skb);
105extern void ip_init(void); 108extern void ip_init(void);
106extern int ip_append_data(struct sock *sk, 109extern 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
164extern struct ipv4_config ipv4_config; 167extern 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
177extern unsigned long snmp_fold_field(void __percpu *mib[], int offt); 180extern unsigned long snmp_fold_field(void __percpu *mib[], int offt);
178extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize); 181#if BITS_PER_LONG==32
182extern u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t sync_off);
183#else
184static 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
189extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align);
179extern void snmp_mib_free(void __percpu *ptr[2]); 190extern void snmp_mib_free(void __percpu *ptr[2]);
180 191
181extern struct local_ports { 192extern struct local_ports {
@@ -184,6 +195,12 @@ extern struct local_ports {
184} sysctl_local_ports; 195} sysctl_local_ports;
185extern void inet_get_local_port_range(int *low, int *high); 196extern void inet_get_local_port_range(int *low, int *high);
186 197
198extern unsigned long *sysctl_local_reserved_ports;
199static inline int inet_is_reserved_local_port(int port)
200{
201 return test_bit(port, sysctl_local_reserved_ports);
202}
203
187extern int sysctl_ip_default_ttl; 204extern int sysctl_ip_default_ttl;
188extern int sysctl_ip_nonlocal_bind; 205extern 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
413extern int ip_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
396extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); 414extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb);
397extern int ip_cmsg_send(struct net *net, 415extern int ip_cmsg_send(struct net *net,
398 struct msghdr *msg, struct ipcm_cookie *ipc); 416 struct msghdr *msg, struct ipcm_cookie *ipc);