]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/capture/cap_debug/constants.h
Merge branch 'stg-2.409-radius'
[stg.git] / projects / stargazer / plugins / capture / cap_debug / constants.h
1 /* $Id: constants.h,v 1.1 2005/12/12 18:14:22 nobunaga Exp $
2
3 Copyright (C) 2002 Marc Kirchner <kirchner@stud.fh-heilbronn.de>
4
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.
9
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.
14
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
18 */
19
20 /*
21 * socket types
22 */
23 #define PKT_RAW         SOCK_RAW
24 #define PKT_STREAM      SOCK_STREAM
25 #define PKT_DGRAM       SOCK_DGRAM
26
27 /*
28 * Link Layer
29 */
30 #define PKT_LINK_ARP    0x01
31 #define PKT_LINK_RARP   0x02
32
33 /*
34 * Network Layer
35 */ 
36 #define PKT_NET_IP      0x01
37 #define PKT_NET_ICMP    0x02
38 #define PKT_NET_IGMP    0x04
39
40 /*
41 * Transport layer
42 */
43 #define PKT_TRANS_TCP   0x01
44 #define PKT_TRANS_UDP   0x02
45
46 /* --- [ IP ] ------------------------ */
47 /* IP options */
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
52
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 */
63
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 */
68
69 /* --- [ TCP ] ------------------------ */
70 /* tcp flags */
71 #ifndef __FAVOUR_BSD
72 #define TH_FIN        0x01
73 #define TH_SYN        0x02
74 #define TH_RST        0x04
75 #define TH_PUSH       0x08
76 #define TH_ACK        0x10
77 #define TH_URG        0x20
78 #endif
79 /* additional flags */
80 #define TH_XMAS         0x40
81 #define TH_YMAS         0x80
82
83 /* tcp options */
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 */
91
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 */
100
101 /* return values and errors */
102 #define PKTOK           0
103 #define EPKTRANGE       -64
104 #define EERRNO          -63 /* errno has been set */
105 #define EPKTINVALPTR    -62
106 #define EPKTUNKNOWNTYPE -61