aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2005-06-19 01:47:21 -0400
committerDavid S. Miller <davem@davemloft.net>2005-06-19 01:47:21 -0400
commit60236fdd08b2169045a3bbfc5ffe1576e6c3c17b (patch)
tree4541c682cc72daf560ec516e2b5868089a88b6ea /include/net
parent2e6599cb899ba4b133f42cbf9d2b1883d2dc583a (diff)
[NET] Rename open_request to request_sock
Ok, this one just renames some stuff to have a better namespace and to dissassociate it from TCP: struct open_request -> struct request_sock tcp_openreq_alloc -> reqsk_alloc tcp_openreq_free -> reqsk_free tcp_openreq_fastfree -> __reqsk_free With this most of the infrastructure closely resembles a struct sock methods subset. Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/request_sock.h34
-rw-r--r--include/net/sock.h4
-rw-r--r--include/net/tcp.h30
-rw-r--r--include/net/tcp_ecn.h6
4 files changed, 37 insertions, 37 deletions
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index 9502f5587931..08a8fd1d1610 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -19,28 +19,28 @@
19#include <linux/types.h> 19#include <linux/types.h>
20#include <net/sock.h> 20#include <net/sock.h>
21 21
22struct open_request; 22struct request_sock;
23struct sk_buff; 23struct sk_buff;
24struct dst_entry; 24struct dst_entry;
25struct proto; 25struct proto;
26 26
27struct or_calltable { 27struct request_sock_ops {
28 int family; 28 int family;
29 kmem_cache_t *slab; 29 kmem_cache_t *slab;
30 int obj_size; 30 int obj_size;
31 int (*rtx_syn_ack)(struct sock *sk, 31 int (*rtx_syn_ack)(struct sock *sk,
32 struct open_request *req, 32 struct request_sock *req,
33 struct dst_entry *dst); 33 struct dst_entry *dst);
34 void (*send_ack)(struct sk_buff *skb, 34 void (*send_ack)(struct sk_buff *skb,
35 struct open_request *req); 35 struct request_sock *req);
36 void (*send_reset)(struct sk_buff *skb); 36 void (*send_reset)(struct sk_buff *skb);
37 void (*destructor)(struct open_request *req); 37 void (*destructor)(struct request_sock *req);
38}; 38};
39 39
40/* struct open_request - mini sock to represent a connection request 40/* struct request_sock - mini sock to represent a connection request
41 */ 41 */
42struct open_request { 42struct request_sock {
43 struct open_request *dl_next; /* Must be first member! */ 43 struct request_sock *dl_next; /* Must be first member! */
44 u16 mss; 44 u16 mss;
45 u8 retrans; 45 u8 retrans;
46 u8 __pad; 46 u8 __pad;
@@ -49,29 +49,29 @@ struct open_request {
49 u32 rcv_wnd; /* rcv_wnd offered first time */ 49 u32 rcv_wnd; /* rcv_wnd offered first time */
50 u32 ts_recent; 50 u32 ts_recent;
51 unsigned long expires; 51 unsigned long expires;
52 struct or_calltable *class; 52 struct request_sock_ops *rsk_ops;
53 struct sock *sk; 53 struct sock *sk;
54}; 54};
55 55
56static inline struct open_request *tcp_openreq_alloc(struct or_calltable *class) 56static inline struct request_sock *reqsk_alloc(struct request_sock_ops *ops)
57{ 57{
58 struct open_request *req = kmem_cache_alloc(class->slab, SLAB_ATOMIC); 58 struct request_sock *req = kmem_cache_alloc(ops->slab, SLAB_ATOMIC);
59 59
60 if (req != NULL) 60 if (req != NULL)
61 req->class = class; 61 req->rsk_ops = ops;
62 62
63 return req; 63 return req;
64} 64}
65 65
66static inline void tcp_openreq_fastfree(struct open_request *req) 66static inline void __reqsk_free(struct request_sock *req)
67{ 67{
68 kmem_cache_free(req->class->slab, req); 68 kmem_cache_free(req->rsk_ops->slab, req);
69} 69}
70 70
71static inline void tcp_openreq_free(struct open_request *req) 71static inline void reqsk_free(struct request_sock *req)
72{ 72{
73 req->class->destructor(req); 73 req->rsk_ops->destructor(req);
74 tcp_openreq_fastfree(req); 74 __reqsk_free(req);
75} 75}
76 76
77#endif /* _REQUEST_SOCK_H */ 77#endif /* _REQUEST_SOCK_H */
diff --git a/include/net/sock.h b/include/net/sock.h
index 6919276af8af..e593af5b1ecc 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -484,7 +484,7 @@ extern void sk_stream_kill_queues(struct sock *sk);
484 484
485extern int sk_wait_data(struct sock *sk, long *timeo); 485extern int sk_wait_data(struct sock *sk, long *timeo);
486 486
487struct or_calltable; 487struct request_sock_ops;
488 488
489/* Networking protocol blocks we attach to sockets. 489/* Networking protocol blocks we attach to sockets.
490 * socket layer -> transport layer interface 490 * socket layer -> transport layer interface
@@ -549,7 +549,7 @@ struct proto {
549 kmem_cache_t *slab; 549 kmem_cache_t *slab;
550 unsigned int obj_size; 550 unsigned int obj_size;
551 551
552 struct or_calltable *rsk_prot; 552 struct request_sock_ops *rsk_prot;
553 553
554 struct module *owner; 554 struct module *owner;
555 555
diff --git a/include/net/tcp.h b/include/net/tcp.h
index d438ba566b89..6663086a5e35 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -641,7 +641,7 @@ struct tcp_func {
641 641
642 struct sock * (*syn_recv_sock) (struct sock *sk, 642 struct sock * (*syn_recv_sock) (struct sock *sk,
643 struct sk_buff *skb, 643 struct sk_buff *skb,
644 struct open_request *req, 644 struct request_sock *req,
645 struct dst_entry *dst); 645 struct dst_entry *dst);
646 646
647 int (*remember_stamp) (struct sock *sk); 647 int (*remember_stamp) (struct sock *sk);
@@ -785,8 +785,8 @@ extern enum tcp_tw_status tcp_timewait_state_process(struct tcp_tw_bucket *tw,
785 unsigned len); 785 unsigned len);
786 786
787extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, 787extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb,
788 struct open_request *req, 788 struct request_sock *req,
789 struct open_request **prev); 789 struct request_sock **prev);
790extern int tcp_child_process(struct sock *parent, 790extern int tcp_child_process(struct sock *parent,
791 struct sock *child, 791 struct sock *child,
792 struct sk_buff *skb); 792 struct sk_buff *skb);
@@ -836,12 +836,12 @@ extern int tcp_v4_conn_request(struct sock *sk,
836 struct sk_buff *skb); 836 struct sk_buff *skb);
837 837
838extern struct sock * tcp_create_openreq_child(struct sock *sk, 838extern struct sock * tcp_create_openreq_child(struct sock *sk,
839 struct open_request *req, 839 struct request_sock *req,
840 struct sk_buff *skb); 840 struct sk_buff *skb);
841 841
842extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, 842extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk,
843 struct sk_buff *skb, 843 struct sk_buff *skb,
844 struct open_request *req, 844 struct request_sock *req,
845 struct dst_entry *dst); 845 struct dst_entry *dst);
846 846
847extern int tcp_v4_do_rcv(struct sock *sk, 847extern int tcp_v4_do_rcv(struct sock *sk,
@@ -855,7 +855,7 @@ extern int tcp_connect(struct sock *sk);
855 855
856extern struct sk_buff * tcp_make_synack(struct sock *sk, 856extern struct sk_buff * tcp_make_synack(struct sock *sk,
857 struct dst_entry *dst, 857 struct dst_entry *dst,
858 struct open_request *req); 858 struct request_sock *req);
859 859
860extern int tcp_disconnect(struct sock *sk, int flags); 860extern int tcp_disconnect(struct sock *sk, int flags);
861 861
@@ -1683,7 +1683,7 @@ static inline int tcp_full_space(const struct sock *sk)
1683 return tcp_win_from_space(sk->sk_rcvbuf); 1683 return tcp_win_from_space(sk->sk_rcvbuf);
1684} 1684}
1685 1685
1686static inline void tcp_acceptq_queue(struct sock *sk, struct open_request *req, 1686static inline void tcp_acceptq_queue(struct sock *sk, struct request_sock *req,
1687 struct sock *child) 1687 struct sock *child)
1688{ 1688{
1689 struct tcp_sock *tp = tcp_sk(sk); 1689 struct tcp_sock *tp = tcp_sk(sk);
@@ -1707,11 +1707,11 @@ struct tcp_listen_opt
1707 int qlen_young; 1707 int qlen_young;
1708 int clock_hand; 1708 int clock_hand;
1709 u32 hash_rnd; 1709 u32 hash_rnd;
1710 struct open_request *syn_table[TCP_SYNQ_HSIZE]; 1710 struct request_sock *syn_table[TCP_SYNQ_HSIZE];
1711}; 1711};
1712 1712
1713static inline void 1713static inline void
1714tcp_synq_removed(struct sock *sk, struct open_request *req) 1714tcp_synq_removed(struct sock *sk, struct request_sock *req)
1715{ 1715{
1716 struct tcp_listen_opt *lopt = tcp_sk(sk)->listen_opt; 1716 struct tcp_listen_opt *lopt = tcp_sk(sk)->listen_opt;
1717 1717
@@ -1745,23 +1745,23 @@ static inline int tcp_synq_is_full(struct sock *sk)
1745 return tcp_synq_len(sk) >> tcp_sk(sk)->listen_opt->max_qlen_log; 1745 return tcp_synq_len(sk) >> tcp_sk(sk)->listen_opt->max_qlen_log;
1746} 1746}
1747 1747
1748static inline void tcp_synq_unlink(struct tcp_sock *tp, struct open_request *req, 1748static inline void tcp_synq_unlink(struct tcp_sock *tp, struct request_sock *req,
1749 struct open_request **prev) 1749 struct request_sock **prev)
1750{ 1750{
1751 write_lock(&tp->syn_wait_lock); 1751 write_lock(&tp->syn_wait_lock);
1752 *prev = req->dl_next; 1752 *prev = req->dl_next;
1753 write_unlock(&tp->syn_wait_lock); 1753 write_unlock(&tp->syn_wait_lock);
1754} 1754}
1755 1755
1756static inline void tcp_synq_drop(struct sock *sk, struct open_request *req, 1756static inline void tcp_synq_drop(struct sock *sk, struct request_sock *req,
1757 struct open_request **prev) 1757 struct request_sock **prev)
1758{ 1758{
1759 tcp_synq_unlink(tcp_sk(sk), req, prev); 1759 tcp_synq_unlink(tcp_sk(sk), req, prev);
1760 tcp_synq_removed(sk, req); 1760 tcp_synq_removed(sk, req);
1761 tcp_openreq_free(req); 1761 reqsk_free(req);
1762} 1762}
1763 1763
1764static __inline__ void tcp_openreq_init(struct open_request *req, 1764static __inline__ void tcp_openreq_init(struct request_sock *req,
1765 struct tcp_options_received *rx_opt, 1765 struct tcp_options_received *rx_opt,
1766 struct sk_buff *skb) 1766 struct sk_buff *skb)
1767{ 1767{
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h
index 94ad970e844a..64980ee8c92a 100644
--- a/include/net/tcp_ecn.h
+++ b/include/net/tcp_ecn.h
@@ -39,7 +39,7 @@ static inline void TCP_ECN_send_syn(struct sock *sk, struct tcp_sock *tp,
39} 39}
40 40
41static __inline__ void 41static __inline__ void
42TCP_ECN_make_synack(struct open_request *req, struct tcphdr *th) 42TCP_ECN_make_synack(struct request_sock *req, struct tcphdr *th)
43{ 43{
44 if (inet_rsk(req)->ecn_ok) 44 if (inet_rsk(req)->ecn_ok)
45 th->ece = 1; 45 th->ece = 1;
@@ -112,13 +112,13 @@ static inline int TCP_ECN_rcv_ecn_echo(struct tcp_sock *tp, struct tcphdr *th)
112} 112}
113 113
114static inline void TCP_ECN_openreq_child(struct tcp_sock *tp, 114static inline void TCP_ECN_openreq_child(struct tcp_sock *tp,
115 struct open_request *req) 115 struct request_sock *req)
116{ 116{
117 tp->ecn_flags = inet_rsk(req)->ecn_ok ? TCP_ECN_OK : 0; 117 tp->ecn_flags = inet_rsk(req)->ecn_ok ? TCP_ECN_OK : 0;
118} 118}
119 119
120static __inline__ void 120static __inline__ void
121TCP_ECN_create_request(struct open_request *req, struct tcphdr *th) 121TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th)
122{ 122{
123 if (sysctl_tcp_ecn && th->ece && th->cwr) 123 if (sysctl_tcp_ecn && th->ece && th->cwr)
124 inet_rsk(req)->ecn_ok = 1; 124 inet_rsk(req)->ecn_ok = 1;