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 #include <asm/types.h>
  21 
  22 #define HEADER_SIZE     64              /* maximum header size          */
  23 
  24 
  25 struct tcphdr {
  26         __u16   source;
  27         __u16   dest;
  28         __u32   seq;
  29         __u32   ack_seq;
  30 #if defined(__i386__)
  31         __u16   res1:4,
  32                 doff:4,
  33                 fin:1,
  34                 syn:1,
  35                 rst:1,
  36                 psh:1,
  37                 ack:1,
  38                 urg:1,
  39                 res2:2;
  40 #elif defined(__mc68000__)
  41         __u16   res2:2,
  42                 urg:1,
  43                 ack:1,
  44                 psh:1,
  45                 rst:1,
  46                 syn:1,
  47                 fin:1,
  48                 doff:4,
  49                 res1:4;
  50 #elif defined(__alpha__)
  51         __u16   res1:4,
  52                 doff:4,
  53                 fin:1,
  54                 syn:1,
  55                 rst:1,
  56                 psh:1,
  57                 ack:1,
  58                 urg:1,
  59                 res2:2;
  60 #else
  61 #error  "Adjust this structure for your cpu alignment rules"
  62 #endif  
  63         __u16   window;
  64         __u16   check;
  65         __u16   urg_ptr;
  66 };
  67 
  68 
  69 enum {
  70   TCP_ESTABLISHED = 1,
  71   TCP_SYN_SENT,
  72   TCP_SYN_RECV,
  73   TCP_FIN_WAIT1,
  74   TCP_FIN_WAIT2,
  75   TCP_TIME_WAIT,
  76   TCP_CLOSE,
  77   TCP_CLOSE_WAIT,
  78   TCP_LAST_ACK,
  79   TCP_LISTEN,
  80   TCP_CLOSING   /* now a valid state */
  81 };
  82 
  83 #endif  /* _LINUX_TCP_H */

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