1 /* $Id: constants.h,v 1.1 2005/12/12 18:14:22 nobunaga Exp $
 
   3 Copyright (C) 2002 Marc Kirchner <kirchner@stud.fh-heilbronn.de>
 
   5 This library is free software; you can redistribute it and/or
 
   6 modify it under the terms of the GNU Lesser General Public
 
   7 License as published by the Free Software Foundation; either
 
   8 version 2.1 of the License, or (at your option) any later version.
 
  10 This library is distributed in the hope that it will be useful,
 
  11 but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
  13 Lesser General Public License for more details.
 
  15 You should have received a copy of the GNU Lesser General Public
 
  16 License along with this library; if not, write to the Free Software
 
  17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
  23 #define PKT_RAW         SOCK_RAW
 
  24 #define PKT_STREAM      SOCK_STREAM
 
  25 #define PKT_DGRAM       SOCK_DGRAM
 
  30 #define PKT_LINK_ARP    0x01
 
  31 #define PKT_LINK_RARP   0x02
 
  36 #define PKT_NET_IP      0x01
 
  37 #define PKT_NET_ICMP    0x02
 
  38 #define PKT_NET_IGMP    0x04
 
  43 #define PKT_TRANS_TCP   0x01
 
  44 #define PKT_TRANS_UDP   0x02
 
  46 /* --- [ IP ] ------------------------ */
 
  48 #define PKT_IP_OPT_EOL               0               /* end of option list */
 
  49 #define PKT_IP_OPT_END               PKT_IP_OPT_EOL
 
  50 #define PKT_IP_OPT_NOP               1               /* no operation */
 
  51 #define PKT_IP_OPT_NOOP              PKT_IP_OPT_NOP
 
  53 #define PKT_IP_OPT_RR                7               /* record packet route */
 
  54 #define PKT_IP_OPT_TS                68              /* timestamp */
 
  55 #define PKT_IP_OPT_TIMESTAMP         PKT_IP_OPT_TS
 
  56 #define PKT_IP_OPT_SECURITY          130             /* provide s,c,h,tcc */
 
  57 #define PKT_IP_OPT_SEC               PKT_IP_OPT_SECURITY
 
  58 #define PKT_IP_OPT_LSRR              131             /* loose source route */
 
  59 #define PKT_IP_OPT_SATID             136             /* satnet id */
 
  60 #define PKT_IP_OPT_SID               PKT_IP_OPT_SATID
 
  61 #define PKT_IP_OPT_SSRR              137             /* strict source route */
 
  62 #define PKT_IP_OPT_RA                148             /* router alert */
 
  64 /* flag bits for ipt_flg */
 
  65 #define PKT_IP_OPT_TS_TSONLY         0          /* timestamps only */
 
  66 #define PKT_IP_OPT_TS_TSANDADDR      1          /* timestamps and addresses */
 
  67 #define PKT_IP_OPT_TS_PRESPEC        3          /* specified modules only */
 
  69 /* --- [ TCP ] ------------------------ */
 
  79 /* additional flags */
 
  84 #define PKT_TCP_OPT_END         0x00
 
  85 #define PKT_TCP_OPT_NOP         0x01
 
  86 #define PKT_TCP_OPT_MSS         0x02
 
  87 #define PKT_TCP_OPT_WSF         0x03    /*window scale factor*/
 
  88 #define PKT_TCP_OPT_SACK_PERM   0x04
 
  89 #define PKT_TCP_OPT_SACK        0x05
 
  90 #define PKT_TCP_OPT_TIME        0x08    /* timestamp option */
 
  92 /* tcp option lenghts */
 
  93 #define PKT_TCP_OPT_END_LEN             0x01
 
  94 #define PKT_TCP_OPT_NOP_LEN             0x01
 
  95 #define PKT_TCP_OPT_MSS_LEN             0x04
 
  96 #define PKT_TCP_OPT_WSF_LEN             0x03    /*window scale factor*/
 
  97 #define PKT_TCP_OPT_SACK_PERM_LEN       0x02
 
  98 #define PKT_TCP_OPT_SACK_LEN            0x01
 
  99 #define PKT_TCP_OPT_TIME_LEN            0x0a    /* timestamp option */
 
 101 /* return values and errors */
 
 103 #define EPKTRANGE       -64
 
 104 #define EERRNO          -63 /* errno has been set */
 
 105 #define EPKTINVALPTR    -62
 
 106 #define EPKTUNKNOWNTYPE -61