diff options
Diffstat (limited to 'include/net/udp.h')
-rw-r--r-- | include/net/udp.h | 36 |
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 | ||
66 | extern struct proto udp_prot; | 66 | extern struct proto udp_prot; |
67 | 67 | ||
68 | extern atomic_t udp_memory_allocated; | ||
69 | |||
70 | /* sysctl variables for udp */ | ||
71 | extern int sysctl_udp_mem[3]; | ||
72 | extern int sysctl_udp_rmem_min; | ||
73 | extern int sysctl_udp_wmem_min; | ||
74 | |||
68 | struct sk_buff; | 75 | struct 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 | ||
141 | DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); | 148 | DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); |
149 | DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); | ||
150 | |||
151 | /* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */ | ||
152 | DECLARE_SNMP_STAT(struct udp_mib, udplite_statistics); | ||
153 | DECLARE_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 */ |
153 | struct udp_seq_afinfo { | 185 | struct 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); | |||
173 | extern int udp4_proc_init(void); | 205 | extern int udp4_proc_init(void); |
174 | extern void udp4_proc_exit(void); | 206 | extern void udp4_proc_exit(void); |
175 | #endif | 207 | #endif |
208 | |||
209 | extern void udp_init(void); | ||
176 | #endif /* _UDP_H */ | 210 | #endif /* _UDP_H */ |