Skip to content

Commit

Permalink
net: cleanups
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
xiaosuo authored and davem330 committed Jul 13, 2010
1 parent dbe000e commit 53d3176
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 192 deletions.
55 changes: 20 additions & 35 deletions include/net/inet_common.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef _INET_COMMON_H
#define _INET_COMMON_H

extern const struct proto_ops inet_stream_ops;
extern const struct proto_ops inet_dgram_ops;
extern const struct proto_ops inet_stream_ops;
extern const struct proto_ops inet_dgram_ops;

/*
* INET4 prototypes used by INET6
Expand All @@ -13,43 +13,28 @@ struct sock;
struct sockaddr;
struct socket;

extern int inet_release(struct socket *sock);
extern int inet_stream_connect(struct socket *sock,
struct sockaddr * uaddr,
int addr_len, int flags);
extern int inet_dgram_connect(struct socket *sock,
struct sockaddr * uaddr,
int addr_len, int flags);
extern int inet_accept(struct socket *sock,
struct socket *newsock, int flags);
extern int inet_sendmsg(struct kiocb *iocb,
struct socket *sock,
struct msghdr *msg,
size_t size);
extern int inet_shutdown(struct socket *sock, int how);
extern int inet_listen(struct socket *sock, int backlog);

extern void inet_sock_destruct(struct sock *sk);

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);
extern int inet_release(struct socket *sock);
extern int inet_stream_connect(struct socket *sock, struct sockaddr * uaddr,
int addr_len, int flags);
extern int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr,
int addr_len, int flags);
extern int inet_accept(struct socket *sock, struct socket *newsock, int flags);
extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size);
extern int inet_shutdown(struct socket *sock, int how);
extern int inet_listen(struct socket *sock, int backlog);
extern void inet_sock_destruct(struct sock *sk);
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)
{
sk_release_kernel(sk);
}

#endif


222 changes: 85 additions & 137 deletions include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(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_shutdown (struct sock *sk, int how);

extern int tcp_v4_rcv(struct sk_buff *skb);

extern int tcp_v4_remember_stamp(struct sock *sk);

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 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,
struct tcphdr *th,
unsigned len);

extern int tcp_rcv_established(struct sock *sk,
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);
extern void tcp_v4_err(struct sk_buff *skb, u32);

extern void tcp_shutdown (struct sock *sk, int how);

extern int tcp_v4_rcv(struct sk_buff *skb);

extern int tcp_v4_remember_stamp(struct sock *sk);
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 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,
struct tcphdr *th, unsigned len);
extern int tcp_rcv_established(struct sock *sk, 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,
const unsigned int pkts)
Expand Down Expand Up @@ -372,88 +357,59 @@ enum tcp_tw_status {
};


extern enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock *tw,
struct sk_buff *skb,
const struct tcphdr *th);

extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb,
struct request_sock *req,
struct request_sock **prev);
extern int tcp_child_process(struct sock *parent,
struct sock *child,
struct sk_buff *skb);
extern int tcp_use_frto(struct sock *sk);
extern void tcp_enter_frto(struct sock *sk);
extern void tcp_enter_loss(struct sock *sk, int how);
extern void tcp_clear_retrans(struct tcp_sock *tp);
extern void tcp_update_metrics(struct sock *sk);

extern void tcp_close(struct sock *sk,
long timeout);
extern unsigned int tcp_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait);

extern int tcp_getsockopt(struct sock *sk, int level,
int optname,
char __user *optval,
int __user *optlen);
extern int tcp_setsockopt(struct sock *sk, int level,
int optname, char __user *optval,
unsigned int optlen);
extern int compat_tcp_getsockopt(struct sock *sk,
int level, int optname,
char __user *optval, int __user *optlen);
extern int compat_tcp_setsockopt(struct sock *sk,
int level, int optname,
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);
extern enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock *tw,
struct sk_buff *skb,
const struct tcphdr *th);
extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb,
struct request_sock *req,
struct request_sock **prev);
extern int tcp_child_process(struct sock *parent, struct sock *child,
struct sk_buff *skb);
extern int tcp_use_frto(struct sock *sk);
extern void tcp_enter_frto(struct sock *sk);
extern void tcp_enter_loss(struct sock *sk, int how);
extern void tcp_clear_retrans(struct tcp_sock *tp);
extern void tcp_update_metrics(struct sock *sk);
extern void tcp_close(struct sock *sk, long timeout);
extern unsigned int tcp_poll(struct file * file, struct socket *sock,
struct poll_table_struct *wait);
extern int tcp_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen);
extern int tcp_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen);
extern int compat_tcp_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen);
extern int compat_tcp_setsockopt(struct sock *sk, int level, int optname,
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
*/

extern void tcp_v4_send_check(struct sock *sk,
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,
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,
extern void tcp_v4_send_check(struct sock *sk, 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,
struct request_sock *req,
struct sk_buff *skb);

extern int tcp_v4_connect(struct sock *sk,
struct sockaddr *uaddr,
int addr_len);

extern int tcp_connect(struct sock *sk);

extern struct sk_buff * tcp_make_synack(struct sock *sk,
struct dst_entry *dst,
struct request_sock *req,
struct request_values *rvp);

extern int tcp_disconnect(struct sock *sk, int flags);
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);
extern int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr,
int addr_len);
extern int tcp_connect(struct sock *sk);
extern struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst,
struct request_sock *req,
struct request_values *rvp);
extern int tcp_disconnect(struct sock *sk, int flags);


/* From syncookies.c */
Expand Down Expand Up @@ -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_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_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_send_ack(struct sock *sk);
extern void tcp_send_delayed_ack(struct sock *sk);
Expand Down Expand Up @@ -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
* 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
* complication on 64-bit systems since we store a snapshot
Expand Down Expand Up @@ -1174,22 +1130,14 @@ struct tcp_md5sig_pool {
#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */

/* - functions */
extern int tcp_v4_md5_hash_skb(char *md5_hash,
struct tcp_md5sig_key *key,
struct sock *sk,
struct request_sock *req,
struct sk_buff *skb);

extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
struct sock *addr_sk);

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);
extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key,
struct sock *sk, struct request_sock *req,
struct sk_buff *skb);
extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk,
struct sock *addr_sk);
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
#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \
Expand All @@ -1202,10 +1150,10 @@ extern int tcp_v4_md5_do_del(struct sock *sk,
#endif

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 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_skb_data(struct tcp_md5sig_pool *, struct sk_buff *,
Expand Down Expand Up @@ -1433,7 +1381,7 @@ extern int tcp_gro_complete(struct sk_buff *skb);
extern int tcp4_gro_complete(struct sk_buff *skb);

#ifdef CONFIG_PROC_FS
extern int tcp4_proc_init(void);
extern int tcp4_proc_init(void);
extern void tcp4_proc_exit(void);
#endif

Expand Down
Loading

0 comments on commit 53d3176

Please sign in to comment.