15 #ifndef _INET_CONNECTION_SOCK_H
16 #define _INET_CONNECTION_SOCK_H
18 #include <linux/compiler.h>
19 #include <linux/string.h>
21 #include <linux/poll.h>
26 #define INET_CSK_DEBUG 1
29 #undef INET_CSK_CLEAR_TIMERS
51 char __user *optval,
unsigned int optlen);
56 int level,
int optname,
57 char __user *optval,
unsigned int optlen);
59 int level,
int optname,
130 #define ICSK_CA_PRIV_SIZE (16 * sizeof(u32))
133 #define ICSK_TIME_RETRANS 1
134 #define ICSK_TIME_DACK 2
135 #define ICSK_TIME_PROBE0 3
142 static inline void *inet_csk_ca(
const struct sock *
sk)
144 return (
void *)inet_csk(sk)->icsk_ca_priv;
159 void (*retransmit_handler)(
unsigned long),
160 void (*delack_handler)(
unsigned long),
161 void (*keepalive_handler)(
unsigned long));
164 static inline void inet_csk_schedule_ack(
struct sock *sk)
169 static inline int inet_csk_ack_scheduled(
const struct sock *sk)
174 static inline void inet_csk_delack_init(
struct sock *sk)
176 memset(&inet_csk(sk)->icsk_ack, 0,
sizeof(inet_csk(sk)->icsk_ack));
182 #ifdef INET_CSK_DEBUG
186 static inline void inet_csk_clear_xmit_timer(
struct sock *sk,
const int what)
192 #ifdef INET_CSK_CLEAR_TIMERS
197 #ifdef INET_CSK_CLEAR_TIMERS
201 #ifdef INET_CSK_DEBUG
203 pr_debug(
"%s", inet_csk_timer_bug_msg);
211 static inline void inet_csk_reset_xmit_timer(
struct sock *sk,
const int what,
213 const unsigned long max_when)
217 if (when > max_when) {
218 #ifdef INET_CSK_DEBUG
219 pr_debug(
"reset_xmit_timer: sk=%p %d when=0x%lx, caller=%p\n",
234 #ifdef INET_CSK_DEBUG
236 pr_debug(
"%s", inet_csk_timer_bug_msg);
259 static inline void inet_csk_reqsk_queue_add(
struct sock *sk,
263 reqsk_queue_add(&inet_csk(sk)->icsk_accept_queue, req, sk, child);
268 unsigned long timeout);
270 static inline void inet_csk_reqsk_queue_removed(
struct sock *sk,
273 if (reqsk_queue_removed(&inet_csk(sk)->icsk_accept_queue, req) == 0)
277 static inline void inet_csk_reqsk_queue_added(
struct sock *sk,
278 const unsigned long timeout)
280 if (reqsk_queue_added(&inet_csk(sk)->icsk_accept_queue) == 0)
284 static inline int inet_csk_reqsk_queue_len(
const struct sock *sk)
286 return reqsk_queue_len(&inet_csk(sk)->icsk_accept_queue);
289 static inline int inet_csk_reqsk_queue_young(
const struct sock *sk)
291 return reqsk_queue_len_young(&inet_csk(sk)->icsk_accept_queue);
294 static inline int inet_csk_reqsk_queue_is_full(
const struct sock *sk)
296 return reqsk_queue_is_full(&inet_csk(sk)->icsk_accept_queue);
299 static inline void inet_csk_reqsk_queue_unlink(
struct sock *sk,
303 reqsk_queue_unlink(&inet_csk(sk)->icsk_accept_queue, req, prev);
306 static inline void inet_csk_reqsk_queue_drop(
struct sock *sk,
310 inet_csk_reqsk_queue_unlink(sk, req, prev);
311 inet_csk_reqsk_queue_removed(sk, req);
317 const unsigned long timeout,
318 const unsigned long max_rto);
325 static inline unsigned int inet_csk_listen_poll(
const struct sock *sk)
327 return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ?
337 char __user *optval,
int __user *optlen);
339 char __user *optval,
unsigned int optlen);