aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/udp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/udp.h')
-rw-r--r--include/net/udp.h109
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};
81extern struct udp_table udp_table; 81extern struct udp_table udp_table;
82extern void udp_table_init(struct udp_table *, const char *); 82void udp_table_init(struct udp_table *, const char *);
83static inline struct udp_hslot *udp_hashslot(struct udp_table *table, 83static 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
165extern void udp_lib_unhash(struct sock *sk); 165void udp_lib_unhash(struct sock *sk);
166extern void udp_lib_rehash(struct sock *sk, u16 new_hash); 166void udp_lib_rehash(struct sock *sk, u16 new_hash);
167 167
168static inline void udp_lib_close(struct sock *sk, long timeout) 168static 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
173extern int udp_lib_get_port(struct sock *sk, unsigned short snum, 173int 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 */
178extern int udp_get_port(struct sock *sk, unsigned short snum, 178void udp_v4_early_demux(struct sk_buff *skb);
179 int (*saddr_cmp)(const struct sock *, 179int udp_get_port(struct sock *sk, unsigned short snum,
180 const struct sock *)); 180 int (*saddr_cmp)(const struct sock *,
181extern void udp_err(struct sk_buff *, u32); 181 const struct sock *));
182extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, 182void udp_err(struct sk_buff *, u32);
183 struct msghdr *msg, size_t len); 183int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
184extern int udp_push_pending_frames(struct sock *sk); 184 size_t len);
185extern void udp_flush_pending_frames(struct sock *sk); 185int udp_push_pending_frames(struct sock *sk);
186extern void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst); 186void udp_flush_pending_frames(struct sock *sk);
187extern int udp_rcv(struct sk_buff *skb); 187void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst);
188extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); 188int udp_rcv(struct sk_buff *skb);
189extern int udp_disconnect(struct sock *sk, int flags); 189int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
190extern unsigned int udp_poll(struct file *file, struct socket *sock, 190int udp_disconnect(struct sock *sk, int flags);
191 poll_table *wait); 191unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait);
192extern struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, 192struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
193 netdev_features_t features); 193 netdev_features_t features);
194extern int udp_lib_getsockopt(struct sock *sk, int level, int optname, 194int udp_lib_getsockopt(struct sock *sk, int level, int optname,
195 char __user *optval, int __user *optlen); 195 char __user *optval, int __user *optlen);
196extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, 196int 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 *));
199extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, 199struct 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); 201struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
202extern 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); 204struct sock *udp6_lib_lookup(struct net *net,
205extern 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);
208extern struct sock *__udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport, 208struct 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 { \ 234do { \
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
262extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo); 263int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo);
263extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo); 264void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo);
264 265
265extern int udp4_proc_init(void); 266int udp4_proc_init(void);
266extern void udp4_proc_exit(void); 267void udp4_proc_exit(void);
267#endif 268#endif
268 269
269extern int udpv4_offload_init(void); 270int udpv4_offload_init(void);
270 271
271extern void udp_init(void); 272void udp_init(void);
272 273
273extern void udp_encap_enable(void); 274void udp_encap_enable(void);
274#if IS_ENABLED(CONFIG_IPV6) 275#if IS_ENABLED(CONFIG_IPV6)
275extern void udpv6_encap_enable(void); 276void udpv6_encap_enable(void);
276#endif 277#endif
277#endif /* _UDP_H */ 278#endif /* _UDP_H */