root/include/linux/ip.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 IP protocol.
   7  *
   8  * Version:     @(#)ip.h        1.0.2   04/28/93
   9  *
  10  * Authors:     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_IP_H
  18 #define _LINUX_IP_H
  19 
  20 
  21 #define IPOPT_END       0
  22 #define IPOPT_NOOP      1
  23 #define IPOPT_SEC       130
  24 #define IPOPT_LSRR      131
  25 #define IPOPT_SSRR      137
  26 #define IPOPT_RR        7
  27 #define IPOPT_SID       136
  28 #define IPOPT_TIMESTAMP 68
  29 
  30 
  31 #define MAXTTL          255
  32 
  33 struct timestamp {
  34         __u8    len;
  35         __u8    ptr;
  36         union {
  37 #if defined(__i386__)
  38         __u8    flags:4,
  39                 overflow:4;
  40 #elif defined(__mc68000__)
  41         __u8    overflow:4,
  42                 flags:4;
  43 #elif defined(__MIPSEL__) 
  44         __u8    flags:4,
  45                 overflow:4;
  46 #elif defined(__MIPSEB__)
  47         __u8    overflow:4,
  48                 flags:4;
  49 #elif defined(__alpha__)
  50         __u8    flags:4,
  51                 overflow:4;
  52 #elif defined(__sparc__)
  53         __u8    overflow:4,
  54                 flags:4;
  55 #else
  56 #error  "Adjust this structure to match your CPU"
  57 #endif                                          
  58         __u8    full_char;
  59         } x;
  60         __u32   data[9];
  61 };
  62 
  63 
  64 #define MAX_ROUTE       16
  65 
  66 struct route {
  67   char          route_size;
  68   char          pointer;
  69   unsigned long route[MAX_ROUTE];
  70 };
  71 
  72 
  73 struct options {
  74   struct route          record_route;
  75   struct route          loose_route;
  76   struct route          strict_route;
  77   struct timestamp      tstamp;
  78   unsigned short        security;
  79   unsigned short        compartment;
  80   unsigned short        handling;
  81   unsigned short        stream;
  82   unsigned              tcc;
  83 };
  84 
  85 
  86 struct iphdr {
  87 #if defined(__i386__)
  88         __u8    ihl:4,
  89                 version:4;
  90 #elif defined (__mc68000__)
  91         __u8    version:4,
  92                 ihl:4;
  93 #elif defined(__MIPSEL__)
  94         __u8    ihl:4,
  95                 version:4;
  96 #elif defined(__MIPSEB__)
  97         __u8    version:4,
  98                 ihl:4;
  99 #elif defined(__alpha__)
 100         __u8    ihl:4,
 101                 version:4;
 102 #elif defined (__sparc__)
 103         __u8    version:4,
 104                 ihl:4;
 105 #else
 106 #error "Adjust this structure to match your CPU"
 107 #endif
 108         __u8    tos;
 109         __u16   tot_len;
 110         __u16   id;
 111         __u16   frag_off;
 112         __u8    ttl;
 113         __u8    protocol;
 114         __u16   check;
 115         __u32   saddr;
 116         __u32   daddr;
 117         /*The options start here. */
 118 };
 119 
 120 
 121 #endif  /* _LINUX_IP_H */

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