Commit 53d3176b authored by Changli Gao's avatar Changli Gao Committed by David S. Miller

net: cleanups

remove useless blanks.
Signed-off-by: default avatarChangli 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: default avatarDavid S. Miller <davem@davemloft.net>
parent dbe000ed
#ifndef _INET_COMMON_H #ifndef _INET_COMMON_H
#define _INET_COMMON_H #define _INET_COMMON_H
extern const struct proto_ops inet_stream_ops; extern const struct proto_ops inet_stream_ops;
extern const struct proto_ops inet_dgram_ops; extern const struct proto_ops inet_dgram_ops;
/* /*
* INET4 prototypes used by INET6 * INET4 prototypes used by INET6
...@@ -13,37 +13,24 @@ struct sock; ...@@ -13,37 +13,24 @@ struct sock;
struct sockaddr; struct sockaddr;
struct socket; struct socket;
extern int inet_release(struct socket *sock); extern int inet_release(struct socket *sock);
extern int inet_stream_connect(struct socket *sock, extern int inet_stream_connect(struct socket *sock, struct sockaddr * uaddr,
struct sockaddr * uaddr, int addr_len, int flags);
int addr_len, int flags); extern int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr,
extern int inet_dgram_connect(struct socket *sock, int addr_len, int flags);
struct sockaddr * uaddr, extern int inet_accept(struct socket *sock, struct socket *newsock, int flags);
int addr_len, int flags); extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock,
extern int inet_accept(struct socket *sock, struct msghdr *msg, size_t size);
struct socket *newsock, int flags); extern int inet_shutdown(struct socket *sock, int how);
extern int inet_sendmsg(struct kiocb *iocb, extern int inet_listen(struct socket *sock, int backlog);
struct socket *sock, extern void inet_sock_destruct(struct sock *sk);
struct msghdr *msg, extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
size_t size); extern int inet_getname(struct socket *sock, struct sockaddr *uaddr,
extern int inet_shutdown(struct socket *sock, int how); int *uaddr_len, int peer);
extern int inet_listen(struct socket *sock, int backlog); extern int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
extern int inet_ctl_sock_create(struct sock **sk, unsigned short family,
extern void inet_sock_destruct(struct sock *sk); unsigned short type, unsigned char protocol,
struct net *net);
extern int inet_bind(struct socket *sock,
struct sockaddr *uaddr, int addr_len);
extern int inet_getname(struct socket *sock,
struct sockaddr *uaddr,
int *uaddr_len, int peer);
extern int inet_ioctl(struct socket *sock,
unsigned int cmd, unsigned long arg);
extern int inet_ctl_sock_create(struct sock **sk,
unsigned short family,
unsigned short type,
unsigned char protocol,
struct net *net);
static inline void inet_ctl_sock_destroy(struct sock *sk) static inline void inet_ctl_sock_destroy(struct sock *sk)
{ {
...@@ -51,5 +38,3 @@ static inline void inet_ctl_sock_destroy(struct sock *sk) ...@@ -51,5 +38,3 @@ static inline void inet_ctl_sock_destroy(struct sock *sk)
} }
#endif #endif
...@@ -296,45 +296,30 @@ extern struct proto tcp_prot; ...@@ -296,45 +296,30 @@ extern struct proto tcp_prot;
#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val)
#define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val)
extern void tcp_v4_err(struct sk_buff *skb, u32); extern void tcp_v4_err(struct sk_buff *skb, u32);
extern void tcp_shutdown (struct sock *sk, int how); extern void tcp_shutdown (struct sock *sk, int how);
extern int tcp_v4_rcv(struct sk_buff *skb); extern int tcp_v4_rcv(struct sk_buff *skb);
extern int tcp_v4_remember_stamp(struct sock *sk); extern int tcp_v4_remember_stamp(struct sock *sk);
extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw);
extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); extern int tcp_sendmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size);
extern int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, extern ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset,
struct msghdr *msg, size_t size); size_t size, int flags);
extern ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags); extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
extern int tcp_ioctl(struct sock *sk, struct tcphdr *th, unsigned len);
int cmd, extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
unsigned long arg); struct tcphdr *th, unsigned len);
extern void tcp_rcv_space_adjust(struct sock *sk);
extern int tcp_rcv_state_process(struct sock *sk, extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
struct sk_buff *skb, extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp);
struct tcphdr *th, extern void tcp_twsk_destructor(struct sock *sk);
unsigned len); extern ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
extern int tcp_rcv_established(struct sock *sk, unsigned int flags);
struct sk_buff *skb,
struct tcphdr *th,
unsigned len);
extern void tcp_rcv_space_adjust(struct sock *sk);
extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
extern int tcp_twsk_unique(struct sock *sk,
struct sock *sktw, void *twp);
extern void tcp_twsk_destructor(struct sock *sk);
extern ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len, unsigned int flags);
static inline void tcp_dec_quickack_mode(struct sock *sk, static inline void tcp_dec_quickack_mode(struct sock *sk,
const unsigned int pkts) const unsigned int pkts)
...@@ -372,88 +357,59 @@ enum tcp_tw_status { ...@@ -372,88 +357,59 @@ enum tcp_tw_status {
}; };
extern enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock *tw, extern enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock *tw,
struct sk_buff *skb, struct sk_buff *skb,
const struct tcphdr *th); const struct tcphdr *th);
extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb,
extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, struct request_sock *req,
struct request_sock *req, struct request_sock **prev);
struct request_sock **prev); extern int tcp_child_process(struct sock *parent, struct sock *child,
extern int tcp_child_process(struct sock *parent, struct sk_buff *skb);
struct sock *child, extern int tcp_use_frto(struct sock *sk);
struct sk_buff *skb); extern void tcp_enter_frto(struct sock *sk);
extern int tcp_use_frto(struct sock *sk); extern void tcp_enter_loss(struct sock *sk, int how);
extern void tcp_enter_frto(struct sock *sk); extern void tcp_clear_retrans(struct tcp_sock *tp);
extern void tcp_enter_loss(struct sock *sk, int how); extern void tcp_update_metrics(struct sock *sk);
extern void tcp_clear_retrans(struct tcp_sock *tp); extern void tcp_close(struct sock *sk, long timeout);
extern void tcp_update_metrics(struct sock *sk); extern unsigned int tcp_poll(struct file * file, struct socket *sock,
struct poll_table_struct *wait);
extern void tcp_close(struct sock *sk, extern int tcp_getsockopt(struct sock *sk, int level, int optname,
long timeout); char __user *optval, int __user *optlen);
extern unsigned int tcp_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait); extern int tcp_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen);
extern int tcp_getsockopt(struct sock *sk, int level, extern int compat_tcp_getsockopt(struct sock *sk, int level, int optname,
int optname, char __user *optval, int __user *optlen);
char __user *optval, extern int compat_tcp_setsockopt(struct sock *sk, int level, int optname,
int __user *optlen); char __user *optval, unsigned int optlen);
extern int tcp_setsockopt(struct sock *sk, int level, extern void tcp_set_keepalive(struct sock *sk, int val);
int optname, char __user *optval, extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req);
unsigned int optlen); extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
extern int compat_tcp_getsockopt(struct sock *sk, size_t len, int nonblock, int flags, int *addr_len);
int level, int optname, extern void tcp_parse_options(struct sk_buff *skb,
char __user *optval, int __user *optlen); struct tcp_options_received *opt_rx, u8 **hvpp,
extern int compat_tcp_setsockopt(struct sock *sk, int estab);
int level, int optname, extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
char __user *optval, unsigned int optlen);
extern void tcp_set_keepalive(struct sock *sk, int val);
extern void tcp_syn_ack_timeout(struct sock *sk,
struct request_sock *req);
extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg,
size_t len, int nonblock,
int flags, int *addr_len);
extern void tcp_parse_options(struct sk_buff *skb,
struct tcp_options_received *opt_rx,
u8 **hvpp,
int estab);
extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
/* /*
* TCP v4 functions exported for the inet6 API * TCP v4 functions exported for the inet6 API
*/ */
extern void tcp_v4_send_check(struct sock *sk, extern void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb);
struct sk_buff *skb); extern int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb);
extern struct sock * tcp_create_openreq_child(struct sock *sk,
extern int tcp_v4_conn_request(struct sock *sk, struct request_sock *req,
struct sk_buff *skb);
extern struct sock * tcp_create_openreq_child(struct sock *sk,
struct request_sock *req,
struct sk_buff *skb);
extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk,
struct sk_buff *skb,
struct request_sock *req,
struct dst_entry *dst);
extern int tcp_v4_do_rcv(struct sock *sk,
struct sk_buff *skb); struct sk_buff *skb);
extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
extern int tcp_v4_connect(struct sock *sk, struct request_sock *req,
struct sockaddr *uaddr, struct dst_entry *dst);
int addr_len); extern int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb);
extern int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr,
extern int tcp_connect(struct sock *sk); int addr_len);
extern int tcp_connect(struct sock *sk);
extern struct sk_buff * tcp_make_synack(struct sock *sk, extern struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst,
struct dst_entry *dst, struct request_sock *req,
struct request_sock *req, struct request_values *rvp);
struct request_values *rvp); extern int tcp_disconnect(struct sock *sk, int flags);
extern int tcp_disconnect(struct sock *sk, int flags);
/* From syncookies.c */ /* From syncookies.c */
...@@ -485,10 +441,10 @@ extern int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int); ...@@ -485,10 +441,10 @@ extern int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int);
extern void tcp_send_probe0(struct sock *); extern void tcp_send_probe0(struct sock *);
extern void tcp_send_partial(struct sock *); extern void tcp_send_partial(struct sock *);
extern int tcp_write_wakeup(struct sock *); extern int tcp_write_wakeup(struct sock *);
extern void tcp_send_fin(struct sock *sk); extern void tcp_send_fin(struct sock *sk);
extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); extern void tcp_send_active_reset(struct sock *sk, gfp_t priority);
extern int tcp_send_synack(struct sock *); extern int tcp_send_synack(struct sock *);
extern void tcp_push_one(struct sock *, unsigned int mss_now); extern void tcp_push_one(struct sock *, unsigned int mss_now);
extern void tcp_send_ack(struct sock *sk); extern void tcp_send_ack(struct sock *sk);
extern void tcp_send_delayed_ack(struct sock *sk); extern void tcp_send_delayed_ack(struct sock *sk);
...@@ -592,7 +548,7 @@ static inline u32 tcp_receive_window(const struct tcp_sock *tp) ...@@ -592,7 +548,7 @@ static inline u32 tcp_receive_window(const struct tcp_sock *tp)
* scaling applied to the result. The caller does these things * scaling applied to the result. The caller does these things
* if necessary. This is a "raw" window selection. * if necessary. This is a "raw" window selection.
*/ */
extern u32 __tcp_select_window(struct sock *sk); extern u32 __tcp_select_window(struct sock *sk);
/* TCP timestamps are only 32-bits, this causes a slight /* TCP timestamps are only 32-bits, this causes a slight
* complication on 64-bit systems since we store a snapshot * complication on 64-bit systems since we store a snapshot
...@@ -1174,22 +1130,14 @@ struct tcp_md5sig_pool { ...@@ -1174,22 +1130,14 @@ struct tcp_md5sig_pool {
#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ #define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */
/* - functions */ /* - functions */
extern int tcp_v4_md5_hash_skb(char *md5_hash, extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key,
struct tcp_md5sig_key *key, struct sock *sk, struct request_sock *req,
struct sock *sk, struct sk_buff *skb);
struct request_sock *req, extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk,
struct sk_buff *skb); struct sock *addr_sk);
extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey,
extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, u8 newkeylen);
struct sock *addr_sk); extern int tcp_v4_md5_do_del(struct sock *sk, __be32 addr);
extern int tcp_v4_md5_do_add(struct sock *sk,
__be32 addr,
u8 *newkey,
u8 newkeylen);
extern int tcp_v4_md5_do_del(struct sock *sk,
__be32 addr);
#ifdef CONFIG_TCP_MD5SIG #ifdef CONFIG_TCP_MD5SIG
#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \ #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,10 +1150,10 @@ extern int tcp_v4_md5_do_del(struct sock *sk,
#endif #endif
extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *);
extern void tcp_free_md5sig_pool(void); extern void tcp_free_md5sig_pool(void);
extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void);
extern void tcp_put_md5sig_pool(void); extern void tcp_put_md5sig_pool(void);
extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *);
extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, extern 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); ...@@ -1433,7 +1381,7 @@ extern int tcp_gro_complete(struct sk_buff *skb);
extern int tcp4_gro_complete(struct sk_buff *skb); extern int tcp4_gro_complete(struct sk_buff *skb);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
extern int tcp4_proc_init(void); extern int tcp4_proc_init(void);
extern void tcp4_proc_exit(void); extern void tcp4_proc_exit(void);
#endif #endif
......
...@@ -157,30 +157,28 @@ static inline void udp_lib_close(struct sock *sk, long timeout) ...@@ -157,30 +157,28 @@ static inline void udp_lib_close(struct sock *sk, long timeout)
sk_common_release(sk); sk_common_release(sk);
} }
extern int udp_lib_get_port(struct sock *sk, unsigned short snum, extern int udp_lib_get_port(struct sock *sk, unsigned short snum,
int (*)(const struct sock *,const struct sock *), int (*)(const struct sock *,const struct sock *),
unsigned int hash2_nulladdr); unsigned int hash2_nulladdr);
/* net/ipv4/udp.c */ /* net/ipv4/udp.c */
extern int udp_get_port(struct sock *sk, unsigned short snum, extern int udp_get_port(struct sock *sk, unsigned short snum,
int (*saddr_cmp)(const struct sock *, const struct sock *)); int (*saddr_cmp)(const struct sock *,
extern void udp_err(struct sk_buff *, u32); const struct sock *));
extern void udp_err(struct sk_buff *, u32);
extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg, size_t len); struct msghdr *msg, size_t len);
extern void udp_flush_pending_frames(struct sock *sk); extern void udp_flush_pending_frames(struct sock *sk);
extern int udp_rcv(struct sk_buff *skb);
extern int udp_rcv(struct sk_buff *skb); extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); extern int udp_disconnect(struct sock *sk, int flags);
extern int udp_disconnect(struct sock *sk, int flags);
extern unsigned int udp_poll(struct file *file, struct socket *sock, extern unsigned int udp_poll(struct file *file, struct socket *sock,
poll_table *wait); poll_table *wait);
extern int udp_lib_getsockopt(struct sock *sk, int level, int optname, extern int udp_lib_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen); char __user *optval, int __user *optlen);
extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, extern int udp_lib_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen, char __user *optval, unsigned int optlen,
int (*push_pending_frames)(struct sock *)); int (*push_pending_frames)(struct sock *));
extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
__be32 daddr, __be16 dport, __be32 daddr, __be16 dport,
int dif); int dif);
...@@ -236,7 +234,7 @@ struct udp_iter_state { ...@@ -236,7 +234,7 @@ struct udp_iter_state {
extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo); extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo);
extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo); extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo);
extern int udp4_proc_init(void); extern int udp4_proc_init(void);
extern void udp4_proc_exit(void); extern void udp4_proc_exit(void);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment