root/include/linux/tcp.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * INET         An implementation of the TCP/IP protocol suite for the LINUX
   3  *              operating system.  INET is implemented using the  BSD Socket
   4  *              interface as the means of communication with the user level.
   5  *
   6  *              Definitions for the TCP protocol.
   7  *
   8  * Version:     @(#)tcp.h       1.0.2   04/28/93
   9  *
  10  * Author:      Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  11  *
  12  *              This program is free software; you can redistribute it and/or
  13  *              modify it under the terms of the GNU General Public License
  14  *              as published by the Free Software Foundation; either version
  15  *              2 of the License, or (at your option) any later version.
  16  */
  17 #ifndef _LINUX_TCP_H
  18 #define _LINUX_TCP_H
  19 
  20 
  21 #define HEADER_SIZE     64              /* maximum header size          */
  22 
  23 
  24 struct tcphdr {
  25         __u16   source;
  26         __u16   dest;
  27         __u32   seq;
  28         __u32   ack_seq;
  29 #if defined(__i386__)
  30         __u16   res1:4,
  31                 doff:4,
  32                 fin:1,
  33                 syn:1,
  34                 rst:1,
  35                 psh:1,
  36                 ack:1,
  37                 urg:1,
  38                 res2:2;
  39 #elif defined(__mc68000__)
  40         __u16   res2:2,
  41                 urg:1,
  42                 ack:1,
  43                 psh:1,
  44                 rst:1,
  45                 syn:1,
  46                 fin:1,
  47                 doff:4,
  48                 res1:4;
  49 #elif defined(__MIPSEL__)
  50         __u16   res1:4,
  51                 doff:4,
  52                 fin:1,
  53                 syn:1,
  54                 rst:1,
  55                 psh:1,
  56                 ack:1,
  57                 urg:1,
  58                 res2:2;
  59 #elif defined(__MIPSEB__)
  60         __u16   res2:2,
  61                 urg:1,
  62                 ack:1,
  63                 psh:1,
  64                 rst:1,
  65                 syn:1,
  66                 fin:1,
  67                 doff:4,
  68                 res1:4;
  69 #elif defined(__alpha__)
  70         __u16   res1:4,
  71                 doff:4,
  72                 fin:1,
  73                 syn:1,
  74                 rst:1,
  75                 psh:1,
  76                 ack:1,
  77                 urg:1,
  78                 res2:2;
  79 #else
  80 #error  "Adjust this structure for your cpu alignment rules"
  81 #endif  
  82         __u16   window;
  83         __u16   check;
  84         __u16   urg_ptr;
  85 };
  86 
  87 
  88 enum {
  89   TCP_ESTABLISHED = 1,
  90   TCP_SYN_SENT,
  91   TCP_SYN_RECV,
  92   TCP_FIN_WAIT1,
  93   TCP_FIN_WAIT2,
  94   TCP_TIME_WAIT,
  95   TCP_CLOSE,
  96   TCP_CLOSE_WAIT,
  97   TCP_LAST_ACK,
  98   TCP_LISTEN,
  99   TCP_CLOSING   /* now a valid state */
 100 };
 101 
 102 #endif  /* _LINUX_TCP_H */

/* [previous][next][first][last][top][bottom][index][help] */