aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/request_sock.h
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/request_sock.h
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/request_sock.h')
-rw-r--r--include/net/request_sock.h34
1 files changed, 17 insertions, 17 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 */