ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

tcpdef.h
Go to the documentation of this file.
00001 /*
00002  * INET     An implementation of the TCP/IP protocol suite for the LINUX
00003  *      operating system.  INET is implemented using the  BSD Socket
00004  *      interface as the means of communication with the user level.
00005  *
00006  *      Definitions for the TCP protocol.
00007  *
00008  * Version: @(#)tcp.h   1.0.2   04/28/93
00009  *
00010  * Author:  Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
00011  *
00012  *      This program is free software; you can redistribute it and/or
00013  *      modify it under the terms of the GNU General Public License
00014  *      as published by the Free Software Foundation; either version
00015  *      2 of the License, or (at your option) any later version.
00016  */
00017 
00018 #pragma once
00019 
00020 #include "linux.h"
00021 
00022 struct tcphdr {
00023     __u16   source;
00024     __u16   dest;
00025     __u32   seq;
00026     __u32   ack_seq;
00027 //#if defined(__LITTLE_ENDIAN_BITFIELD)
00028     __u16   res1:4,
00029         doff:4,
00030         fin:1,
00031         syn:1,
00032         rst:1,
00033         psh:1,
00034         ack:1,
00035         urg:1,
00036         ece:1,
00037         cwr:1;
00038 /*#elif defined(__BIG_ENDIAN_BITFIELD)
00039     __u16   doff:4,
00040         res1:4,
00041         cwr:1,
00042         ece:1,
00043         urg:1,
00044         ack:1,
00045         psh:1,
00046         rst:1,
00047         syn:1,
00048         fin:1;
00049 #else
00050 #error  "Adjust your <asm/byteorder.h> defines"
00051 #endif  */
00052     __u16   window;
00053     __u16   check;
00054     __u16   urg_ptr;
00055 };
00056 
00057 
00058 enum {
00059   TCP_ESTABLISHED = 1,
00060   TCP_SYN_SENT,
00061   TCP_SYN_RECV,
00062   TCP_FIN_WAIT1,
00063   TCP_FIN_WAIT2,
00064   TCP_TIME_WAIT,
00065   TCP_CLOSE,
00066   TCP_CLOSE_WAIT,
00067   TCP_LAST_ACK,
00068   TCP_LISTEN,
00069   TCP_CLOSING,   /* now a valid state */
00070 
00071   TCP_MAX_STATES /* Leave at the end! */
00072 };
00073 
00074 #define TCP_STATE_MASK  0xF
00075 #define TCP_ACTION_FIN  (1 << 7)
00076 
00077 enum {
00078   TCPF_ESTABLISHED = (1 << 1),
00079   TCPF_SYN_SENT  = (1 << 2),
00080   TCPF_SYN_RECV  = (1 << 3),
00081   TCPF_FIN_WAIT1 = (1 << 4),
00082   TCPF_FIN_WAIT2 = (1 << 5),
00083   TCPF_TIME_WAIT = (1 << 6),
00084   TCPF_CLOSE     = (1 << 7),
00085   TCPF_CLOSE_WAIT = (1 << 8),
00086   TCPF_LAST_ACK  = (1 << 9),
00087   TCPF_LISTEN    = (1 << 10),
00088   TCPF_CLOSING   = (1 << 11)
00089 };
00090 
00091 /*
00092  *  The union cast uses a gcc extension to avoid aliasing problems
00093  *  (union is compatible to any of its members)
00094  *  This means this part of the code is -fstrict-aliasing safe now.
00095  */
00096 union tcp_word_hdr {
00097     struct tcphdr hdr;
00098     __u32         words[5];
00099 };
00100 
00101 #define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
00102 
00103 enum {
00104     TCP_FLAG_CWR = 0x00800000, // __constant_htonl(0x00800000),
00105     TCP_FLAG_ECE = 0x00400000, //__constant_htonl(0x00400000),
00106     TCP_FLAG_URG = 0x00200000, //__constant_htonl(0x00200000),
00107     TCP_FLAG_ACK = 0x00100000, //__constant_htonl(0x00100000),
00108     TCP_FLAG_PSH = 0x00080000, //__constant_htonl(0x00080000),
00109     TCP_FLAG_RST = 0x00040000, //__constant_htonl(0x00040000),
00110     TCP_FLAG_SYN = 0x00020000, //__constant_htonl(0x00020000),
00111     TCP_FLAG_FIN = 0x00010000, //__constant_htonl(0x00010000),
00112     TCP_RESERVED_BITS = 0x0F000000, //__constant_htonl(0x0F000000),
00113     TCP_DATA_OFFSET = 0xF0000000, //__constant_htonl(0xF0000000)
00114 };
00115 
00116 /* TCP socket options */
00117 #define TCP_NODELAY     1   /* Turn off Nagle's algorithm. */
00118 #define TCP_MAXSEG      2   /* Limit MSS */
00119 #define TCP_CORK        3   /* Never send partially complete segments */
00120 #define TCP_KEEPIDLE        4   /* Start keeplives after this period */
00121 #define TCP_KEEPINTVL       5   /* Interval between keepalives */
00122 #define TCP_KEEPCNT     6   /* Number of keepalives before death */
00123 #define TCP_SYNCNT      7   /* Number of SYN retransmits */
00124 #define TCP_LINGER2     8   /* Life time of orphaned FIN-WAIT-2 state */
00125 #define TCP_DEFER_ACCEPT    9   /* Wake up listener only when data arrive */
00126 #define TCP_WINDOW_CLAMP    10  /* Bound advertised window */
00127 #define TCP_INFO        11  /* Information about this connection. */
00128 #define TCP_QUICKACK        12  /* Block/reenable quick acks */
00129 
00130 #define TCPI_OPT_TIMESTAMPS 1
00131 #define TCPI_OPT_SACK       2
00132 #define TCPI_OPT_WSCALE     4
00133 #define TCPI_OPT_ECN        8
00134 
00135 enum tcp_ca_state
00136 {
00137     TCP_CA_Open = 0,
00138 #define TCPF_CA_Open    (1<<TCP_CA_Open)
00139     TCP_CA_Disorder = 1,
00140 #define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
00141     TCP_CA_CWR = 2,
00142 #define TCPF_CA_CWR (1<<TCP_CA_CWR)
00143     TCP_CA_Recovery = 3,
00144 #define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
00145     TCP_CA_Loss = 4
00146 #define TCPF_CA_Loss    (1<<TCP_CA_Loss)
00147 };
00148 
00149 struct tcp_info
00150 {
00151     __u8    tcpi_state;
00152     __u8    tcpi_ca_state;
00153     __u8    tcpi_retransmits;
00154     __u8    tcpi_probes;
00155     __u8    tcpi_backoff;
00156     __u8    tcpi_options;
00157     __u8    tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
00158 
00159     __u32   tcpi_rto;
00160     __u32   tcpi_ato;
00161     __u32   tcpi_snd_mss;
00162     __u32   tcpi_rcv_mss;
00163 
00164     __u32   tcpi_unacked;
00165     __u32   tcpi_sacked;
00166     __u32   tcpi_lost;
00167     __u32   tcpi_retrans;
00168     __u32   tcpi_fackets;
00169 
00170     /* Times. */
00171     __u32   tcpi_last_data_sent;
00172     __u32   tcpi_last_ack_sent;     /* Not remembered, sorry. */
00173     __u32   tcpi_last_data_recv;
00174     __u32   tcpi_last_ack_recv;
00175 
00176     /* Metrics. */
00177     __u32   tcpi_pmtu;
00178     __u32   tcpi_rcv_ssthresh;
00179     __u32   tcpi_rtt;
00180     __u32   tcpi_rttvar;
00181     __u32   tcpi_snd_ssthresh;
00182     __u32   tcpi_snd_cwnd;
00183     __u32   tcpi_advmss;
00184     __u32   tcpi_reordering;
00185 };

Generated on Wed May 23 2012 04:25:56 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.