aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_connection_sock.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2005-08-09 23:10:42 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:43:19 -0400
commit463c84b97f24010a67cd871746d6a7e4c925a5f9 (patch)
tree48df67ede4ebb5d12b3c0ae55d72531574bd51a6 /include/net/inet_connection_sock.h
parent87d11ceb9deb7a3f13fdee6e89d9bb6be7d27a71 (diff)
[NET]: Introduce inet_connection_sock
This creates struct inet_connection_sock, moving members out of struct tcp_sock that are shareable with other INET connection oriented protocols, such as DCCP, that in my private tree already uses most of these members. The functions that operate on these members were renamed, using a inet_csk_ prefix while not being moved yet to a new file, so as to ease the review of these changes. Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet_connection_sock.h')
-rw-r--r--include/net/inet_connection_sock.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
new file mode 100644
index 000000000000..ef609396e41b
--- /dev/null
+++ b/include/net/inet_connection_sock.h
@@ -0,0 +1,86 @@
1/*
2 * NET Generic infrastructure for INET connection oriented protocols.
3 *
4 * Definitions for inet_connection_sock
5 *
6 * Authors: Many people, see the TCP sources
7 *
8 * From code originally in TCP
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15#ifndef _INET_CONNECTION_SOCK_H
16#define _INET_CONNECTION_SOCK_H
17
18#include <linux/ip.h>
19#include <linux/timer.h>
20#include <net/request_sock.h>
21
22struct inet_bind_bucket;
23struct inet_hashinfo;
24
25/** inet_connection_sock - INET connection oriented sock
26 *
27 * @icsk_accept_queue: FIFO of established children
28 * @icsk_bind_hash: Bind node
29 * @icsk_timeout: Timeout
30 * @icsk_retransmit_timer: Resend (no ack)
31 * @icsk_rto: Retransmit timeout
32 * @icsk_retransmits: Number of unrecovered [RTO] timeouts
33 * @icsk_pending: Scheduled timer event
34 * @icsk_backoff: Backoff
35 * @icsk_syn_retries: Number of allowed SYN (or equivalent) retries
36 * @icsk_ack: Delayed ACK control data
37 */
38struct inet_connection_sock {
39 /* inet_sock has to be the first member! */
40 struct inet_sock icsk_inet;
41 struct request_sock_queue icsk_accept_queue;
42 struct inet_bind_bucket *icsk_bind_hash;
43 unsigned long icsk_timeout;
44 struct timer_list icsk_retransmit_timer;
45 struct timer_list icsk_delack_timer;
46 __u32 icsk_rto;
47 __u8 icsk_retransmits;
48 __u8 icsk_pending;
49 __u8 icsk_backoff;
50 __u8 icsk_syn_retries;
51 struct {
52 __u8 pending; /* ACK is pending */
53 __u8 quick; /* Scheduled number of quick acks */
54 __u8 pingpong; /* The session is interactive */
55 __u8 blocked; /* Delayed ACK was blocked by socket lock */
56 __u32 ato; /* Predicted tick of soft clock */
57 unsigned long timeout; /* Currently scheduled timeout */
58 __u32 lrcvtime; /* timestamp of last received data packet */
59 __u16 last_seg_size; /* Size of last incoming segment */
60 __u16 rcv_mss; /* MSS used for delayed ACK decisions */
61 } icsk_ack;
62};
63
64static inline struct inet_connection_sock *inet_csk(const struct sock *sk)
65{
66 return (struct inet_connection_sock *)sk;
67}
68
69extern void inet_csk_init_xmit_timers(struct sock *sk,
70 void (*retransmit_handler)(unsigned long),
71 void (*delack_handler)(unsigned long),
72 void (*keepalive_handler)(unsigned long));
73extern void inet_csk_clear_xmit_timers(struct sock *sk);
74
75extern struct request_sock *inet_csk_search_req(const struct sock *sk,
76 struct request_sock ***prevp,
77 const __u16 rport,
78 const __u32 raddr,
79 const __u32 laddr);
80extern int inet_csk_get_port(struct inet_hashinfo *hashinfo,
81 struct sock *sk, unsigned short snum);
82
83extern struct dst_entry* inet_csk_route_req(struct sock *sk,
84 const struct request_sock *req);
85
86#endif /* _INET_CONNECTION_SOCK_H */