diff options
Diffstat (limited to 'include/net/udp.h')
-rw-r--r-- | include/net/udp.h | 109 |
1 files changed, 55 insertions, 54 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index ef2e0b7843a0..a24f0f3e107f 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -79,7 +79,7 @@ struct udp_table { | |||
79 | unsigned int log; | 79 | unsigned int log; |
80 | }; | 80 | }; |
81 | extern struct udp_table udp_table; | 81 | extern struct udp_table udp_table; |
82 | extern void udp_table_init(struct udp_table *, const char *); | 82 | void udp_table_init(struct udp_table *, const char *); |
83 | static inline struct udp_hslot *udp_hashslot(struct udp_table *table, | 83 | static inline struct udp_hslot *udp_hashslot(struct udp_table *table, |
84 | struct net *net, unsigned int num) | 84 | struct net *net, unsigned int num) |
85 | { | 85 | { |
@@ -162,52 +162,53 @@ static inline void udp_lib_hash(struct sock *sk) | |||
162 | BUG(); | 162 | BUG(); |
163 | } | 163 | } |
164 | 164 | ||
165 | extern void udp_lib_unhash(struct sock *sk); | 165 | void udp_lib_unhash(struct sock *sk); |
166 | extern void udp_lib_rehash(struct sock *sk, u16 new_hash); | 166 | void udp_lib_rehash(struct sock *sk, u16 new_hash); |
167 | 167 | ||
168 | static inline void udp_lib_close(struct sock *sk, long timeout) | 168 | static inline void udp_lib_close(struct sock *sk, long timeout) |
169 | { | 169 | { |
170 | sk_common_release(sk); | 170 | sk_common_release(sk); |
171 | } | 171 | } |
172 | 172 | ||
173 | extern int udp_lib_get_port(struct sock *sk, unsigned short snum, | 173 | int udp_lib_get_port(struct sock *sk, unsigned short snum, |
174 | int (*)(const struct sock *,const struct sock *), | 174 | int (*)(const struct sock *, const struct sock *), |
175 | unsigned int hash2_nulladdr); | 175 | unsigned int hash2_nulladdr); |
176 | 176 | ||
177 | /* net/ipv4/udp.c */ | 177 | /* net/ipv4/udp.c */ |
178 | extern int udp_get_port(struct sock *sk, unsigned short snum, | 178 | void udp_v4_early_demux(struct sk_buff *skb); |
179 | int (*saddr_cmp)(const struct sock *, | 179 | int udp_get_port(struct sock *sk, unsigned short snum, |
180 | const struct sock *)); | 180 | int (*saddr_cmp)(const struct sock *, |
181 | extern void udp_err(struct sk_buff *, u32); | 181 | const struct sock *)); |
182 | extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, | 182 | void udp_err(struct sk_buff *, u32); |
183 | struct msghdr *msg, size_t len); | 183 | int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
184 | extern int udp_push_pending_frames(struct sock *sk); | 184 | size_t len); |
185 | extern void udp_flush_pending_frames(struct sock *sk); | 185 | int udp_push_pending_frames(struct sock *sk); |
186 | extern void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst); | 186 | void udp_flush_pending_frames(struct sock *sk); |
187 | extern int udp_rcv(struct sk_buff *skb); | 187 | void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst); |
188 | extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); | 188 | int udp_rcv(struct sk_buff *skb); |
189 | extern int udp_disconnect(struct sock *sk, int flags); | 189 | int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
190 | extern unsigned int udp_poll(struct file *file, struct socket *sock, | 190 | int udp_disconnect(struct sock *sk, int flags); |
191 | poll_table *wait); | 191 | unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait); |
192 | extern struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, | 192 | struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, |
193 | netdev_features_t features); | 193 | netdev_features_t features); |
194 | extern int udp_lib_getsockopt(struct sock *sk, int level, int optname, | 194 | int udp_lib_getsockopt(struct sock *sk, int level, int optname, |
195 | char __user *optval, int __user *optlen); | 195 | char __user *optval, int __user *optlen); |
196 | extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, | 196 | int udp_lib_setsockopt(struct sock *sk, int level, int optname, |
197 | char __user *optval, unsigned int optlen, | 197 | char __user *optval, unsigned int optlen, |
198 | int (*push_pending_frames)(struct sock *)); | 198 | int (*push_pending_frames)(struct sock *)); |
199 | extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, | 199 | struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, |
200 | __be32 daddr, __be16 dport, | 200 | __be32 daddr, __be16 dport, int dif); |
201 | int dif); | 201 | struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, |
202 | extern struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, | 202 | __be32 daddr, __be16 dport, int dif, |
203 | __be32 daddr, __be16 dport, | 203 | struct udp_table *tbl); |
204 | int dif, struct udp_table *tbl); | 204 | struct sock *udp6_lib_lookup(struct net *net, |
205 | extern struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport, | 205 | const struct in6_addr *saddr, __be16 sport, |
206 | const struct in6_addr *daddr, __be16 dport, | 206 | const struct in6_addr *daddr, __be16 dport, |
207 | int dif); | 207 | int dif); |
208 | extern struct sock *__udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport, | 208 | struct sock *__udp6_lib_lookup(struct net *net, |
209 | const struct in6_addr *daddr, __be16 dport, | 209 | const struct in6_addr *saddr, __be16 sport, |
210 | int dif, struct udp_table *tbl); | 210 | const struct in6_addr *daddr, __be16 dport, |
211 | int dif, struct udp_table *tbl); | ||
211 | 212 | ||
212 | /* | 213 | /* |
213 | * SNMP statistics for UDP and UDP-Lite | 214 | * SNMP statistics for UDP and UDP-Lite |
@@ -229,13 +230,13 @@ extern struct sock *__udp6_lib_lookup(struct net *net, const struct in6_addr *sa | |||
229 | } while(0) | 230 | } while(0) |
230 | 231 | ||
231 | #if IS_ENABLED(CONFIG_IPV6) | 232 | #if IS_ENABLED(CONFIG_IPV6) |
232 | #define UDPX_INC_STATS_BH(sk, field) \ | 233 | #define UDPX_INC_STATS_BH(sk, field) \ |
233 | do { \ | 234 | do { \ |
234 | if ((sk)->sk_family == AF_INET) \ | 235 | if ((sk)->sk_family == AF_INET) \ |
235 | UDP_INC_STATS_BH(sock_net(sk), field, 0); \ | 236 | UDP_INC_STATS_BH(sock_net(sk), field, 0); \ |
236 | else \ | 237 | else \ |
237 | UDP6_INC_STATS_BH(sock_net(sk), field, 0); \ | 238 | UDP6_INC_STATS_BH(sock_net(sk), field, 0); \ |
238 | } while (0); | 239 | } while (0) |
239 | #else | 240 | #else |
240 | #define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(sock_net(sk), field, 0) | 241 | #define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(sock_net(sk), field, 0) |
241 | #endif | 242 | #endif |
@@ -259,19 +260,19 @@ struct udp_iter_state { | |||
259 | }; | 260 | }; |
260 | 261 | ||
261 | #ifdef CONFIG_PROC_FS | 262 | #ifdef CONFIG_PROC_FS |
262 | extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo); | 263 | int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo); |
263 | extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo); | 264 | void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo); |
264 | 265 | ||
265 | extern int udp4_proc_init(void); | 266 | int udp4_proc_init(void); |
266 | extern void udp4_proc_exit(void); | 267 | void udp4_proc_exit(void); |
267 | #endif | 268 | #endif |
268 | 269 | ||
269 | extern int udpv4_offload_init(void); | 270 | int udpv4_offload_init(void); |
270 | 271 | ||
271 | extern void udp_init(void); | 272 | void udp_init(void); |
272 | 273 | ||
273 | extern void udp_encap_enable(void); | 274 | void udp_encap_enable(void); |
274 | #if IS_ENABLED(CONFIG_IPV6) | 275 | #if IS_ENABLED(CONFIG_IPV6) |
275 | extern void udpv6_encap_enable(void); | 276 | void udpv6_encap_enable(void); |
276 | #endif | 277 | #endif |
277 | #endif /* _UDP_H */ | 278 | #endif /* _UDP_H */ |