2 * NET Generic infrastructure for INET connection oriented protocols.
4 * Definitions for inet_connection_sock
6 * Authors: Many people, see the TCP sources
8 * From code originally in TCP
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.
15 #ifndef _INET_CONNECTION_SOCK_H
16 #define _INET_CONNECTION_SOCK_H
19 #include <linux/timer.h>
20 #include <net/request_sock.h>
22 struct inet_bind_bucket
;
25 /** inet_connection_sock - INET connection oriented sock
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
38 struct 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
;
47 __u8 icsk_retransmits
;
50 __u8 icsk_syn_retries
;
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 */
64 static inline struct inet_connection_sock
*inet_csk(const struct sock
*sk
)
66 return (struct inet_connection_sock
*)sk
;
69 extern 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));
73 extern void inet_csk_clear_xmit_timers(struct sock
*sk
);
75 extern struct request_sock
*inet_csk_search_req(const struct sock
*sk
,
76 struct request_sock
***prevp
,
80 extern int inet_csk_get_port(struct inet_hashinfo
*hashinfo
,
81 struct sock
*sk
, unsigned short snum
);
83 extern struct dst_entry
* inet_csk_route_req(struct sock
*sk
,
84 const struct request_sock
*req
);
86 #endif /* _INET_CONNECTION_SOCK_H */