aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tcp.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/linux/tcp.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/linux/tcp.h')
-rw-r--r--include/linux/tcp.h39
1 files changed, 7 insertions, 32 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 5d295b1b3de7..800930fac388 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -177,8 +177,8 @@ struct tcp_info
177 177
178#include <linux/config.h> 178#include <linux/config.h>
179#include <linux/skbuff.h> 179#include <linux/skbuff.h>
180#include <linux/ip.h>
181#include <net/sock.h> 180#include <net/sock.h>
181#include <net/inet_connection_sock.h>
182#include <net/inet_timewait_sock.h> 182#include <net/inet_timewait_sock.h>
183 183
184/* This defines a selective acknowledgement block. */ 184/* This defines a selective acknowledgement block. */
@@ -219,8 +219,8 @@ static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
219} 219}
220 220
221struct tcp_sock { 221struct tcp_sock {
222 /* inet_sock has to be the first member of tcp_sock */ 222 /* inet_connection_sock has to be the first member of tcp_sock */
223 struct inet_sock inet; 223 struct inet_connection_sock inet_conn;
224 int tcp_header_len; /* Bytes of tcp header to send */ 224 int tcp_header_len; /* Bytes of tcp header to send */
225 225
226/* 226/*
@@ -241,18 +241,6 @@ struct tcp_sock {
241 __u32 snd_sml; /* Last byte of the most recently transmitted small packet */ 241 __u32 snd_sml; /* Last byte of the most recently transmitted small packet */
242 __u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ 242 __u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
243 __u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ 243 __u32 lsndtime; /* timestamp of last sent data packet (for restart window) */
244 /* Delayed ACK control data */
245 struct {
246 __u8 pending; /* ACK is pending */
247 __u8 quick; /* Scheduled number of quick acks */
248 __u8 pingpong; /* The session is interactive */
249 __u8 blocked; /* Delayed ACK was blocked by socket lock*/
250 __u32 ato; /* Predicted tick of soft clock */
251 unsigned long timeout; /* Currently scheduled timeout */
252 __u32 lrcvtime; /* timestamp of last received data packet*/
253 __u16 last_seg_size; /* Size of last incoming segment */
254 __u16 rcv_mss; /* MSS used for delayed ACK decisions */
255 } ack;
256 244
257 /* Data for direct copy to user */ 245 /* Data for direct copy to user */
258 struct { 246 struct {
@@ -271,8 +259,8 @@ struct tcp_sock {
271 __u16 xmit_size_goal; /* Goal for segmenting output packets */ 259 __u16 xmit_size_goal; /* Goal for segmenting output packets */
272 __u16 ext_header_len; /* Network protocol overhead (IP/IPv6 options) */ 260 __u16 ext_header_len; /* Network protocol overhead (IP/IPv6 options) */
273 __u8 ca_state; /* State of fast-retransmit machine */ 261 __u8 ca_state; /* State of fast-retransmit machine */
274 __u8 retransmits; /* Number of unrecovered RTO timeouts. */
275 262
263 __u8 keepalive_probes; /* num of allowed keep alive probes */
276 __u16 advmss; /* Advertised MSS */ 264 __u16 advmss; /* Advertised MSS */
277 __u32 window_clamp; /* Maximal window to advertise */ 265 __u32 window_clamp; /* Maximal window to advertise */
278 __u32 rcv_ssthresh; /* Current window clamp */ 266 __u32 rcv_ssthresh; /* Current window clamp */
@@ -281,7 +269,7 @@ struct tcp_sock {
281 __u8 reordering; /* Packet reordering metric. */ 269 __u8 reordering; /* Packet reordering metric. */
282 __u8 frto_counter; /* Number of new acks after RTO */ 270 __u8 frto_counter; /* Number of new acks after RTO */
283 271
284 __u8 unused; 272 __u8 nonagle; /* Disable Nagle algorithm? */
285 __u8 defer_accept; /* User waits for some data after accept() */ 273 __u8 defer_accept; /* User waits for some data after accept() */
286 274
287/* RTT measurement */ 275/* RTT measurement */
@@ -290,19 +278,13 @@ struct tcp_sock {
290 __u32 mdev_max; /* maximal mdev for the last rtt period */ 278 __u32 mdev_max; /* maximal mdev for the last rtt period */
291 __u32 rttvar; /* smoothed mdev_max */ 279 __u32 rttvar; /* smoothed mdev_max */
292 __u32 rtt_seq; /* sequence number to update rttvar */ 280 __u32 rtt_seq; /* sequence number to update rttvar */
293 __u32 rto; /* retransmit timeout */
294 281
295 __u32 packets_out; /* Packets which are "in flight" */ 282 __u32 packets_out; /* Packets which are "in flight" */
296 __u32 left_out; /* Packets which leaved network */ 283 __u32 left_out; /* Packets which leaved network */
297 __u32 retrans_out; /* Retransmitted packets out */ 284 __u32 retrans_out; /* Retransmitted packets out */
298 __u8 backoff; /* backoff */
299/* 285/*
300 * Options received (usually on last packet, some only on SYN packets). 286 * Options received (usually on last packet, some only on SYN packets).
301 */ 287 */
302 __u8 nonagle; /* Disable Nagle algorithm? */
303 __u8 keepalive_probes; /* num of allowed keep alive probes */
304
305 __u8 probes_out; /* unanswered 0 window probes */
306 struct tcp_options_received rx_opt; 288 struct tcp_options_received rx_opt;
307 289
308/* 290/*
@@ -315,11 +297,6 @@ struct tcp_sock {
315 __u32 snd_cwnd_used; 297 __u32 snd_cwnd_used;
316 __u32 snd_cwnd_stamp; 298 __u32 snd_cwnd_stamp;
317 299
318 /* Two commonly used timers in both sender and receiver paths. */
319 unsigned long timeout;
320 struct timer_list retransmit_timer; /* Resend (no ack) */
321 struct timer_list delack_timer; /* Ack delay */
322
323 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ 300 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */
324 301
325 struct tcp_func *af_specific; /* Operations which are AF_INET{4,6} specific */ 302 struct tcp_func *af_specific; /* Operations which are AF_INET{4,6} specific */
@@ -334,7 +311,7 @@ struct tcp_sock {
334 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 311 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
335 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ 312 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
336 313
337 __u8 syn_retries; /* num of allowed syn retries */ 314 __u8 probes_out; /* unanswered 0 window probes */
338 __u8 ecn_flags; /* ECN status bits. */ 315 __u8 ecn_flags; /* ECN status bits. */
339 __u16 prior_ssthresh; /* ssthresh saved at recovery start */ 316 __u16 prior_ssthresh; /* ssthresh saved at recovery start */
340 __u32 lost_out; /* Lost packets */ 317 __u32 lost_out; /* Lost packets */
@@ -349,14 +326,12 @@ struct tcp_sock {
349 int undo_retrans; /* number of undoable retransmissions. */ 326 int undo_retrans; /* number of undoable retransmissions. */
350 __u32 urg_seq; /* Seq of received urgent pointer */ 327 __u32 urg_seq; /* Seq of received urgent pointer */
351 __u16 urg_data; /* Saved octet of OOB data and control flags */ 328 __u16 urg_data; /* Saved octet of OOB data and control flags */
352 __u8 pending; /* Scheduled timer event */
353 __u8 urg_mode; /* In urgent mode */ 329 __u8 urg_mode; /* In urgent mode */
330 /* ONE BYTE HOLE, TRY TO PACK! */
354 __u32 snd_up; /* Urgent pointer */ 331 __u32 snd_up; /* Urgent pointer */
355 332
356 __u32 total_retrans; /* Total retransmits for entire connection */ 333 __u32 total_retrans; /* Total retransmits for entire connection */
357 334
358 struct request_sock_queue accept_queue; /* FIFO of established children */
359
360 unsigned int keepalive_time; /* time before keep alive takes place */ 335 unsigned int keepalive_time; /* time before keep alive takes place */
361 unsigned int keepalive_intvl; /* time interval between keep alive probes */ 336 unsigned int keepalive_intvl; /* time interval between keep alive probes */
362 int linger2; 337 int linger2;