aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/udp.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-29 06:54:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-29 06:54:01 -0500
commit0ba6c33bcddc64a54b5f1c25a696c4767dc76292 (patch)
tree62e616f97a4762d8e75bf732e4827af2d15d52c5 /include/net/udp.h
parent21af0297c7e56024a5ccc4d8ad2a590f9ec371ba (diff)
parent85040bcb4643cba578839e953f25e2d1965d83d0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.25: (1470 commits) [IPV6] ADDRLABEL: Fix double free on label deletion. [PPP]: Sparse warning fixes. [IPV4] fib_trie: remove unneeded NULL check [IPV4] fib_trie: More whitespace cleanup. [NET_SCHED]: Use nla_policy for attribute validation in ematches [NET_SCHED]: Use nla_policy for attribute validation in actions [NET_SCHED]: Use nla_policy for attribute validation in classifiers [NET_SCHED]: Use nla_policy for attribute validation in packet schedulers [NET_SCHED]: sch_api: introduce constant for rate table size [NET_SCHED]: Use typeful attribute parsing helpers [NET_SCHED]: Use typeful attribute construction helpers [NET_SCHED]: Use NLA_PUT_STRING for string dumping [NET_SCHED]: Use nla_nest_start/nla_nest_end [NET_SCHED]: Propagate nla_parse return value [NET_SCHED]: act_api: use PTR_ERR in tcf_action_init/tcf_action_get [NET_SCHED]: act_api: use nlmsg_parse [NET_SCHED]: act_api: fix netlink API conversion bug [NET_SCHED]: sch_netem: use nla_parse_nested_compat [NET_SCHED]: sch_atm: fix format string warning [NETNS]: Add namespace for ICMP replying code. ...
Diffstat (limited to 'include/net/udp.h')
-rw-r--r--include/net/udp.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index 98755ebaf163..c6669c0a74c7 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -65,6 +65,13 @@ extern rwlock_t udp_hash_lock;
65 65
66extern struct proto udp_prot; 66extern struct proto udp_prot;
67 67
68extern atomic_t udp_memory_allocated;
69
70/* sysctl variables for udp */
71extern int sysctl_udp_mem[3];
72extern int sysctl_udp_rmem_min;
73extern int sysctl_udp_wmem_min;
74
68struct sk_buff; 75struct sk_buff;
69 76
70/* 77/*
@@ -108,7 +115,7 @@ static inline void udp_lib_unhash(struct sock *sk)
108 write_lock_bh(&udp_hash_lock); 115 write_lock_bh(&udp_hash_lock);
109 if (sk_del_node_init(sk)) { 116 if (sk_del_node_init(sk)) {
110 inet_sk(sk)->num = 0; 117 inet_sk(sk)->num = 0;
111 sock_prot_dec_use(sk->sk_prot); 118 sock_prot_inuse_add(sk->sk_prot, -1);
112 } 119 }
113 write_unlock_bh(&udp_hash_lock); 120 write_unlock_bh(&udp_hash_lock);
114} 121}
@@ -139,6 +146,12 @@ extern int udp_lib_setsockopt(struct sock *sk, int level, int optname,
139 int (*push_pending_frames)(struct sock *)); 146 int (*push_pending_frames)(struct sock *));
140 147
141DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); 148DECLARE_SNMP_STAT(struct udp_mib, udp_statistics);
149DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6);
150
151/* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */
152DECLARE_SNMP_STAT(struct udp_mib, udplite_statistics);
153DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
154
142/* 155/*
143 * SNMP statistics for UDP and UDP-Lite 156 * SNMP statistics for UDP and UDP-Lite
144 */ 157 */
@@ -149,6 +162,25 @@ DECLARE_SNMP_STAT(struct udp_mib, udp_statistics);
149 if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \ 162 if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \
150 else SNMP_INC_STATS_BH(udp_statistics, field); } while(0) 163 else SNMP_INC_STATS_BH(udp_statistics, field); } while(0)
151 164
165#define UDP6_INC_STATS_BH(field, is_udplite) do { \
166 if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \
167 else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0)
168#define UDP6_INC_STATS_USER(field, is_udplite) do { \
169 if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \
170 else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0)
171
172#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
173#define UDPX_INC_STATS_BH(sk, field) \
174 do { \
175 if ((sk)->sk_family == AF_INET) \
176 UDP_INC_STATS_BH(field, 0); \
177 else \
178 UDP6_INC_STATS_BH(field, 0); \
179 } while (0);
180#else
181#define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(field, 0)
182#endif
183
152/* /proc */ 184/* /proc */
153struct udp_seq_afinfo { 185struct udp_seq_afinfo {
154 struct module *owner; 186 struct module *owner;
@@ -173,4 +205,6 @@ extern void udp_proc_unregister(struct udp_seq_afinfo *afinfo);
173extern int udp4_proc_init(void); 205extern int udp4_proc_init(void);
174extern void udp4_proc_exit(void); 206extern void udp4_proc_exit(void);
175#endif 207#endif
208
209extern void udp_init(void);
176#endif /* _UDP_H */ 210#endif /* _UDP_H */