aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-07-10 16:41:06 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-12 23:21:45 -0400
commit53d3176b282cc105493babb0fef36c8b873f6201 (patch)
tree2571bb37b0e292b7b2fbbd6b056661584260c9bf /include
parentdbe000ed3f3033e8e6321d79023c827faf649c4d (diff)
net: cleanups
remove useless blanks. Signed-off-by: Changli Gao <xiaosuo@gmail.com> ---- include/net/inet_common.h | 55 ++++------- include/net/tcp.h | 222 +++++++++++++++++----------------------------- include/net/udp.h | 38 +++---- 3 files changed, 123 insertions(+), 192 deletions(-) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/inet_common.h55
-rw-r--r--include/net/tcp.h222
-rw-r--r--include/net/udp.h38
3 files changed, 123 insertions, 192 deletions
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index 18c773286b91..140c1ec9f8a2 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -1,8 +1,8 @@
1#ifndef _INET_COMMON_H 1#ifndef _INET_COMMON_H
2#define _INET_COMMON_H 2#define _INET_COMMON_H
3 3
4extern const struct proto_ops inet_stream_ops; 4extern const struct proto_ops inet_stream_ops;
5extern const struct proto_ops inet_dgram_ops; 5extern const struct proto_ops inet_dgram_ops;
6 6
7/* 7/*
8 * INET4 prototypes used by INET6 8 * INET4 prototypes used by INET6
@@ -13,37 +13,24 @@ struct sock;
13struct sockaddr; 13struct sockaddr;
14struct socket; 14struct socket;
15 15
16extern int inet_release(struct socket *sock); 16extern int inet_release(struct socket *sock);
17extern int inet_stream_connect(struct socket *sock, 17extern int inet_stream_connect(struct socket *sock, struct sockaddr * uaddr,
18 struct sockaddr * uaddr, 18 int addr_len, int flags);
19 int addr_len, int flags); 19extern int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr,
20extern int inet_dgram_connect(struct socket *sock, 20 int addr_len, int flags);
21 struct sockaddr * uaddr, 21extern int inet_accept(struct socket *sock, struct socket *newsock, int flags);
22 int addr_len, int flags); 22extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock,
23extern int inet_accept(struct socket *sock, 23 struct msghdr *msg, size_t size);
24 struct socket *newsock, int flags); 24extern int inet_shutdown(struct socket *sock, int how);
25extern int inet_sendmsg(struct kiocb *iocb, 25extern int inet_listen(struct socket *sock, int backlog);
26 struct socket *sock, 26extern void inet_sock_destruct(struct sock *sk);
27 struct msghdr *msg, 27extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
28 size_t size); 28extern int inet_getname(struct socket *sock, struct sockaddr *uaddr,
29extern int inet_shutdown(struct socket *sock, int how); 29 int *uaddr_len, int peer);
30extern int inet_listen(struct socket *sock, int backlog); 30extern int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
31 31extern int inet_ctl_sock_create(struct sock **sk, unsigned short family,
32extern void inet_sock_destruct(struct sock *sk); 32 unsigned short type, unsigned char protocol,
33 33 struct net *net);
34extern int inet_bind(struct socket *sock,
35 struct sockaddr *uaddr, int addr_len);
36extern int inet_getname(struct socket *sock,
37 struct sockaddr *uaddr,
38 int *uaddr_len, int peer);
39extern int inet_ioctl(struct socket *sock,
40 unsigned int cmd, unsigned long arg);
41
42extern int inet_ctl_sock_create(struct sock **sk,
43 unsigned short family,
44 unsigned short type,
45 unsigned char protocol,
46 struct net *net);
47 34
48static inline void inet_ctl_sock_destroy(struct sock *sk) 35static inline void inet_ctl_sock_destroy(struct sock *sk)
49{ 36{
@@ -51,5 +38,3 @@ static inline void inet_ctl_sock_destroy(struct sock *sk)
51} 38}
52 39
53#endif 40#endif
54
55
diff --git a/include/net/tcp.h b/include/net/tcp.h
index c2f96c2cc89c..33ce5242a17a 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -296,45 +296,30 @@ extern struct proto tcp_prot;
296#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) 296#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val)
297#define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) 297#define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val)
298 298
299extern void tcp_v4_err(struct sk_buff *skb, u32); 299extern void tcp_v4_err(struct sk_buff *skb, u32);
300 300
301extern void tcp_shutdown (struct sock *sk, int how); 301extern void tcp_shutdown (struct sock *sk, int how);
302 302
303extern int tcp_v4_rcv(struct sk_buff *skb); 303extern int tcp_v4_rcv(struct sk_buff *skb);
304 304
305extern int tcp_v4_remember_stamp(struct sock *sk); 305extern int tcp_v4_remember_stamp(struct sock *sk);
306 306extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw);
307extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); 307extern int tcp_sendmsg(struct kiocb *iocb, struct socket *sock,
308 308 struct msghdr *msg, size_t size);
309extern int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, 309extern ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset,
310 struct msghdr *msg, size_t size); 310 size_t size, int flags);
311extern ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags); 311extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
312 312extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
313extern int tcp_ioctl(struct sock *sk, 313 struct tcphdr *th, unsigned len);
314 int cmd, 314extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
315 unsigned long arg); 315 struct tcphdr *th, unsigned len);
316 316extern void tcp_rcv_space_adjust(struct sock *sk);
317extern int tcp_rcv_state_process(struct sock *sk, 317extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
318 struct sk_buff *skb, 318extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp);
319 struct tcphdr *th, 319extern void tcp_twsk_destructor(struct sock *sk);
320 unsigned len); 320extern ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos,
321 321 struct pipe_inode_info *pipe, size_t len,
322extern int tcp_rcv_established(struct sock *sk, 322 unsigned int flags);
323 struct sk_buff *skb,
324 struct tcphdr *th,
325 unsigned len);
326
327extern void tcp_rcv_space_adjust(struct sock *sk);
328
329extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
330
331extern int tcp_twsk_unique(struct sock *sk,
332 struct sock *sktw, void *twp);
333
334extern void tcp_twsk_destructor(struct sock *sk);
335
336extern ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos,
337 struct pipe_inode_info *pipe, size_t len, unsigned int flags);
338 323
339static inline void tcp_dec_quickack_mode(struct sock *sk, 324static inline void tcp_dec_quickack_mode(struct sock *sk,
340 const unsigned int pkts) 325 const unsigned int pkts)
@@ -372,88 +357,59 @@ enum tcp_tw_status {
372}; 357};
373 358
374 359
375extern enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock *tw, 360extern enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock *tw,
376 struct sk_buff *skb, 361 struct sk_buff *skb,
377 const struct tcphdr *th); 362 const struct tcphdr *th);
378 363extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb,
379extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, 364 struct request_sock *req,
380 struct request_sock *req, 365 struct request_sock **prev);
381 struct request_sock **prev); 366extern int tcp_child_process(struct sock *parent, struct sock *child,
382extern int tcp_child_process(struct sock *parent, 367 struct sk_buff *skb);
383 struct sock *child, 368extern int tcp_use_frto(struct sock *sk);
384 struct sk_buff *skb); 369extern void tcp_enter_frto(struct sock *sk);
385extern int tcp_use_frto(struct sock *sk); 370extern void tcp_enter_loss(struct sock *sk, int how);
386extern void tcp_enter_frto(struct sock *sk); 371extern void tcp_clear_retrans(struct tcp_sock *tp);
387extern void tcp_enter_loss(struct sock *sk, int how); 372extern void tcp_update_metrics(struct sock *sk);
388extern void tcp_clear_retrans(struct tcp_sock *tp); 373extern void tcp_close(struct sock *sk, long timeout);
389extern void tcp_update_metrics(struct sock *sk); 374extern unsigned int tcp_poll(struct file * file, struct socket *sock,
390 375 struct poll_table_struct *wait);
391extern void tcp_close(struct sock *sk, 376extern int tcp_getsockopt(struct sock *sk, int level, int optname,
392 long timeout); 377 char __user *optval, int __user *optlen);
393extern unsigned int tcp_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait); 378extern int tcp_setsockopt(struct sock *sk, int level, int optname,
394 379 char __user *optval, unsigned int optlen);
395extern int tcp_getsockopt(struct sock *sk, int level, 380extern int compat_tcp_getsockopt(struct sock *sk, int level, int optname,
396 int optname, 381 char __user *optval, int __user *optlen);
397 char __user *optval, 382extern int compat_tcp_setsockopt(struct sock *sk, int level, int optname,
398 int __user *optlen); 383 char __user *optval, unsigned int optlen);
399extern int tcp_setsockopt(struct sock *sk, int level, 384extern void tcp_set_keepalive(struct sock *sk, int val);
400 int optname, char __user *optval, 385extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req);
401 unsigned int optlen); 386extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
402extern int compat_tcp_getsockopt(struct sock *sk, 387 size_t len, int nonblock, int flags, int *addr_len);
403 int level, int optname, 388extern void tcp_parse_options(struct sk_buff *skb,
404 char __user *optval, int __user *optlen); 389 struct tcp_options_received *opt_rx, u8 **hvpp,
405extern int compat_tcp_setsockopt(struct sock *sk, 390 int estab);
406 int level, int optname, 391extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
407 char __user *optval, unsigned int optlen);
408extern void tcp_set_keepalive(struct sock *sk, int val);
409extern void tcp_syn_ack_timeout(struct sock *sk,
410 struct request_sock *req);
411extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk,
412 struct msghdr *msg,
413 size_t len, int nonblock,
414 int flags, int *addr_len);
415
416extern void tcp_parse_options(struct sk_buff *skb,
417 struct tcp_options_received *opt_rx,
418 u8 **hvpp,
419 int estab);
420
421extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
422 392
423/* 393/*
424 * TCP v4 functions exported for the inet6 API 394 * TCP v4 functions exported for the inet6 API
425 */ 395 */
426 396
427extern void tcp_v4_send_check(struct sock *sk, 397extern void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb);
428 struct sk_buff *skb); 398extern int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb);
429 399extern struct sock * tcp_create_openreq_child(struct sock *sk,
430extern int tcp_v4_conn_request(struct sock *sk, 400 struct request_sock *req,
431 struct sk_buff *skb);
432
433extern struct sock * tcp_create_openreq_child(struct sock *sk,
434 struct request_sock *req,
435 struct sk_buff *skb);
436
437extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk,
438 struct sk_buff *skb,
439 struct request_sock *req,
440 struct dst_entry *dst);
441
442extern int tcp_v4_do_rcv(struct sock *sk,
443 struct sk_buff *skb); 401 struct sk_buff *skb);
444 402extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
445extern int tcp_v4_connect(struct sock *sk, 403 struct request_sock *req,
446 struct sockaddr *uaddr, 404 struct dst_entry *dst);
447 int addr_len); 405extern int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb);
448 406extern int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr,
449extern int tcp_connect(struct sock *sk); 407 int addr_len);
450 408extern int tcp_connect(struct sock *sk);
451extern struct sk_buff * tcp_make_synack(struct sock *sk, 409extern struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst,
452 struct dst_entry *dst, 410 struct request_sock *req,
453 struct request_sock *req, 411 struct request_values *rvp);
454 struct request_values *rvp); 412extern int tcp_disconnect(struct sock *sk, int flags);
455
456extern int tcp_disconnect(struct sock *sk, int flags);
457 413
458 414
459/* From syncookies.c */ 415/* From syncookies.c */
@@ -485,10 +441,10 @@ extern int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int);
485 441
486extern void tcp_send_probe0(struct sock *); 442extern void tcp_send_probe0(struct sock *);
487extern void tcp_send_partial(struct sock *); 443extern void tcp_send_partial(struct sock *);
488extern int tcp_write_wakeup(struct sock *); 444extern int tcp_write_wakeup(struct sock *);
489extern void tcp_send_fin(struct sock *sk); 445extern void tcp_send_fin(struct sock *sk);
490extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); 446extern void tcp_send_active_reset(struct sock *sk, gfp_t priority);
491extern int tcp_send_synack(struct sock *); 447extern int tcp_send_synack(struct sock *);
492extern void tcp_push_one(struct sock *, unsigned int mss_now); 448extern void tcp_push_one(struct sock *, unsigned int mss_now);
493extern void tcp_send_ack(struct sock *sk); 449extern void tcp_send_ack(struct sock *sk);
494extern void tcp_send_delayed_ack(struct sock *sk); 450extern void tcp_send_delayed_ack(struct sock *sk);
@@ -592,7 +548,7 @@ static inline u32 tcp_receive_window(const struct tcp_sock *tp)
592 * scaling applied to the result. The caller does these things 548 * scaling applied to the result. The caller does these things
593 * if necessary. This is a "raw" window selection. 549 * if necessary. This is a "raw" window selection.
594 */ 550 */
595extern u32 __tcp_select_window(struct sock *sk); 551extern u32 __tcp_select_window(struct sock *sk);
596 552
597/* TCP timestamps are only 32-bits, this causes a slight 553/* TCP timestamps are only 32-bits, this causes a slight
598 * complication on 64-bit systems since we store a snapshot 554 * complication on 64-bit systems since we store a snapshot
@@ -1174,22 +1130,14 @@ struct tcp_md5sig_pool {
1174#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ 1130#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */
1175 1131
1176/* - functions */ 1132/* - functions */
1177extern int tcp_v4_md5_hash_skb(char *md5_hash, 1133extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key,
1178 struct tcp_md5sig_key *key, 1134 struct sock *sk, struct request_sock *req,
1179 struct sock *sk, 1135 struct sk_buff *skb);
1180 struct request_sock *req, 1136extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk,
1181 struct sk_buff *skb); 1137 struct sock *addr_sk);
1182 1138extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey,
1183extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, 1139 u8 newkeylen);
1184 struct sock *addr_sk); 1140extern int tcp_v4_md5_do_del(struct sock *sk, __be32 addr);
1185
1186extern int tcp_v4_md5_do_add(struct sock *sk,
1187 __be32 addr,
1188 u8 *newkey,
1189 u8 newkeylen);
1190
1191extern int tcp_v4_md5_do_del(struct sock *sk,
1192 __be32 addr);
1193 1141
1194#ifdef CONFIG_TCP_MD5SIG 1142#ifdef CONFIG_TCP_MD5SIG
1195#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \ 1143#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \
@@ -1202,10 +1150,10 @@ extern int tcp_v4_md5_do_del(struct sock *sk,
1202#endif 1150#endif
1203 1151
1204extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); 1152extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *);
1205extern void tcp_free_md5sig_pool(void); 1153extern void tcp_free_md5sig_pool(void);
1206 1154
1207extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); 1155extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void);
1208extern void tcp_put_md5sig_pool(void); 1156extern void tcp_put_md5sig_pool(void);
1209 1157
1210extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); 1158extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *);
1211extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, 1159extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *,
@@ -1433,7 +1381,7 @@ extern int tcp_gro_complete(struct sk_buff *skb);
1433extern int tcp4_gro_complete(struct sk_buff *skb); 1381extern int tcp4_gro_complete(struct sk_buff *skb);
1434 1382
1435#ifdef CONFIG_PROC_FS 1383#ifdef CONFIG_PROC_FS
1436extern int tcp4_proc_init(void); 1384extern int tcp4_proc_init(void);
1437extern void tcp4_proc_exit(void); 1385extern void tcp4_proc_exit(void);
1438#endif 1386#endif
1439 1387
diff --git a/include/net/udp.h b/include/net/udp.h
index 5348d80b25bb..7abdf305da50 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -157,30 +157,28 @@ static inline void udp_lib_close(struct sock *sk, long timeout)
157 sk_common_release(sk); 157 sk_common_release(sk);
158} 158}
159 159
160extern int udp_lib_get_port(struct sock *sk, unsigned short snum, 160extern int udp_lib_get_port(struct sock *sk, unsigned short snum,
161 int (*)(const struct sock *,const struct sock *), 161 int (*)(const struct sock *,const struct sock *),
162 unsigned int hash2_nulladdr); 162 unsigned int hash2_nulladdr);
163 163
164/* net/ipv4/udp.c */ 164/* net/ipv4/udp.c */
165extern int udp_get_port(struct sock *sk, unsigned short snum, 165extern int udp_get_port(struct sock *sk, unsigned short snum,
166 int (*saddr_cmp)(const struct sock *, const struct sock *)); 166 int (*saddr_cmp)(const struct sock *,
167extern void udp_err(struct sk_buff *, u32); 167 const struct sock *));
168 168extern void udp_err(struct sk_buff *, u32);
169extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, 169extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
170 struct msghdr *msg, size_t len); 170 struct msghdr *msg, size_t len);
171extern void udp_flush_pending_frames(struct sock *sk); 171extern void udp_flush_pending_frames(struct sock *sk);
172 172extern int udp_rcv(struct sk_buff *skb);
173extern int udp_rcv(struct sk_buff *skb); 173extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
174extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); 174extern int udp_disconnect(struct sock *sk, int flags);
175extern int udp_disconnect(struct sock *sk, int flags);
176extern unsigned int udp_poll(struct file *file, struct socket *sock, 175extern unsigned int udp_poll(struct file *file, struct socket *sock,
177 poll_table *wait); 176 poll_table *wait);
178extern int udp_lib_getsockopt(struct sock *sk, int level, int optname, 177extern int udp_lib_getsockopt(struct sock *sk, int level, int optname,
179 char __user *optval, int __user *optlen); 178 char __user *optval, int __user *optlen);
180extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, 179extern int udp_lib_setsockopt(struct sock *sk, int level, int optname,
181 char __user *optval, unsigned int optlen, 180 char __user *optval, unsigned int optlen,
182 int (*push_pending_frames)(struct sock *)); 181 int (*push_pending_frames)(struct sock *));
183
184extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, 182extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
185 __be32 daddr, __be16 dport, 183 __be32 daddr, __be16 dport,
186 int dif); 184 int dif);
@@ -236,7 +234,7 @@ struct udp_iter_state {
236extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo); 234extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo);
237extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo); 235extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo);
238 236
239extern int udp4_proc_init(void); 237extern int udp4_proc_init(void);
240extern void udp4_proc_exit(void); 238extern void udp4_proc_exit(void);
241#endif 239#endif
242 240