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 #include <asm/byteorder.h>
  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(LITTLE_ENDIAN_BITFIELD)
  38         __u8    flags:4,
  39                 overflow:4;
  40 #elif defined(BIG_ENDIAN_BITFIELD)
  41         __u8    overflow:4,
  42                 flags:4;
  43 #else
  44 #error  "Please fix <asm/byteorder.h>"
  45 #endif                                          
  46         __u8    full_char;
  47         } x;
  48         __u32   data[9];
  49 };
  50 
  51 
  52 #define MAX_ROUTE       16
  53 
  54 struct route {
  55   char          route_size;
  56   char          pointer;
  57   unsigned long route[MAX_ROUTE];
  58 };
  59 
  60 
  61 struct options {
  62   struct route          record_route;
  63   struct route          loose_route;
  64   struct route          strict_route;
  65   struct timestamp      tstamp;
  66   unsigned short        security;
  67   unsigned short        compartment;
  68   unsigned short        handling;
  69   unsigned short        stream;
  70   unsigned              tcc;
  71 };
  72 
  73 
  74 struct iphdr {
  75 #if defined(LITTLE_ENDIAN_BITFIELD)
  76         __u8    ihl:4,
  77                 version:4;
  78 #elif defined (BIG_ENDIAN_BITFIELD)
  79         __u8    version:4,
  80                 ihl:4;
  81 #else
  82 #error  "Please fix <asm/byteorder.h>"
  83 #endif
  84         __u8    tos;
  85         __u16   tot_len;
  86         __u16   id;
  87         __u16   frag_off;
  88         __u8    ttl;
  89         __u8    protocol;
  90         __u16   check;
  91         __u32   saddr;
  92         __u32   daddr;
  93         /*The options start here. */
  94 };
  95 
  96 
  97 #endif  /* _LINUX_IP_H */

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