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   unsigned short        source;
  26   unsigned short        dest;
  27   unsigned long         seq;
  28   unsigned long         ack_seq;
  29 #if defined(__i386__)
  30   unsigned short        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 #else
  40 #if defined(__mc680x0__)
  41   unsigned short        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 #else
  51 #error  "Adjust this structure for your cpu alignment rules"
  52 #endif                  
  53 #endif  
  54   unsigned short        window;
  55   unsigned short        check;
  56   unsigned short        urg_ptr;
  57 };
  58 
  59 
  60 enum {
  61   TCP_ESTABLISHED = 1,
  62   TCP_SYN_SENT,
  63   TCP_SYN_RECV,
  64   TCP_FIN_WAIT1,
  65   TCP_FIN_WAIT2,
  66   TCP_TIME_WAIT,
  67   TCP_CLOSE,
  68   TCP_CLOSE_WAIT,
  69   TCP_LAST_ACK,
  70   TCP_LISTEN,
  71   TCP_CLOSING   /* now a valid state */
  72 };
  73 
  74 #endif  /* _LINUX_TCP_H */

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