Rev 3912 | Rev 4350 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3912 | Rev 3991 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (c) 2009 Lukas Mejdrech |
2 | * Copyright (c) 2009 Lukas Mejdrech |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
8 | * |
8 | * |
9 | * - Redistributions of source code must retain the above copyright |
9 | * - Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * - Redistributions in binary form must reproduce the above copyright |
11 | * - Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
13 | * documentation and/or other materials provided with the distribution. |
14 | * - The name of the author may not be used to endorse or promote products |
14 | * - The name of the author may not be used to endorse or promote products |
15 | * derived from this software without specific prior written permission. |
15 | * derived from this software without specific prior written permission. |
16 | * |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup ip |
29 | /** @addtogroup ip |
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | 32 | ||
33 | /** @file |
33 | /** @file |
34 | * Internet protocol header and options definitions. |
34 | * Internet protocol header and options definitions. |
35 | * Names according to the linux src/include/linux/ip.h header file. |
35 | * Names according to the linux src/include/linux/ip.h header file. |
36 | */ |
36 | */ |
37 | 37 | ||
38 | #ifndef __NET_IP_HEADER_H__ |
38 | #ifndef __NET_IP_HEADER_H__ |
39 | #define __NET_IP_HEADER_H__ |
39 | #define __NET_IP_HEADER_H__ |
40 | 40 | ||
41 | #include <byteorder.h> |
41 | #include <byteorder.h> |
42 | #include <types.h> |
42 | #include <types.h> |
43 | 43 | ||
44 | /** Type definition of the internet header. |
44 | /** Type definition of the internet header. |
45 | * @see ip_header |
45 | * @see ip_header |
46 | */ |
46 | */ |
47 | typedef struct ip_header ip_header_t; |
47 | typedef struct ip_header ip_header_t; |
48 | 48 | ||
49 | /** Type definition of the internet header pointer. |
49 | /** Type definition of the internet header pointer. |
50 | * @see ip_header |
50 | * @see ip_header |
51 | */ |
51 | */ |
52 | typedef ip_header_t * ip_header_ref; |
52 | typedef ip_header_t * ip_header_ref; |
53 | 53 | ||
54 | - | ||
55 | /** Internet header. |
54 | /** Internet header. |
56 | * The variable options should be included after the header itself and indicated by the increased header length value. |
55 | * The variable options should be included after the header itself and indicated by the increased header length value. |
57 | */ |
56 | */ |
58 | struct ip_header{ |
57 | struct ip_header{ |
59 | #ifdef ARCH_IS_BIG_ENDIAN |
58 | #ifdef ARCH_IS_BIG_ENDIAN |
60 | /** The Version field indicates the format of the internet header. |
59 | /** The Version field indicates the format of the internet header. |
61 | */ |
60 | */ |
62 | uint8_t:4 version; |
61 | uint8_t:4 version; |
63 | /** Internet Header Length is the length of the internet header in 32~bit words, and thus points to the beginning of the data. |
62 | /** Internet Header Length is the length of the internet header in 32~bit words, and thus points to the beginning of the data. |
64 | * Note that the minimum value for a~correct header is~5. |
63 | * Note that the minimum value for a~correct header is~5. |
65 | */ |
64 | */ |
66 | uint8_t:4 ihl; |
65 | uint8_t:4 ihl; |
67 | #else |
66 | #else |
68 | /** Internet Header Length is the length of the internet header in 32~bit words, and thus points to the beginning of the data. |
67 | /** Internet Header Length is the length of the internet header in 32~bit words, and thus points to the beginning of the data. |
69 | * Note that the minimum value for a~correct header is~5. |
68 | * Note that the minimum value for a~correct header is~5. |
70 | */ |
69 | */ |
71 | uint8_t:4 ihl; |
70 | uint8_t:4 ihl; |
72 | /** The Version field indicates the format of the internet header. |
71 | /** The Version field indicates the format of the internet header. |
73 | */ |
72 | */ |
74 | uint8_t:4 version; |
73 | uint8_t:4 version; |
75 | #endif |
74 | #endif |
76 | /** The Type of Service provides an indication of the abstract parameters of the quality of service desired. |
75 | /** The Type of Service provides an indication of the abstract parameters of the quality of service desired. |
77 | * These parameters are to be used to guide the selection of the actual service parameters when transmitting a~datagram through a~particular network. |
76 | * These parameters are to be used to guide the selection of the actual service parameters when transmitting a~datagram through a~particular network. |
78 | * Several networks offer service precedence, which somehow treats high precedence traffic as more important than other traffic (generally by accepting only traffic above a~certain precedence at time of high load). |
77 | * Several networks offer service precedence, which somehow treats high precedence traffic as more important than other traffic (generally by accepting only traffic above a~certain precedence at time of high load). |
79 | * The major choice is a~three way tradeoff between low-delay, high-reliability, and high-throughput. |
78 | * The major choice is a~three way tradeoff between low-delay, high-reliability, and high-throughput. |
80 | */ |
79 | */ |
81 | uint8_t tos; |
80 | uint8_t tos; |
82 | /** Total Length is the length of the datagram, measured in octets, including internet header and data. |
81 | /** Total Length is the length of the datagram, measured in octets, including internet header and data. |
83 | * This field allows the length of a~datagram to be up to 65,535~octets. |
82 | * This field allows the length of a~datagram to be up to 65,535~octets. |
84 | */ |
83 | */ |
85 | uint16_t total_length; |
84 | uint16_t total_length; |
86 | /** An identifying value assigned by the sender to aid in assembling the fragments of a~datagram. |
85 | /** An identifying value assigned by the sender to aid in assembling the fragments of a~datagram. |
87 | */ |
86 | */ |
88 | unit16_t identification; |
87 | unit16_t identification; |
89 | #ifdef ARCH_IS_BIG_ENDIAN |
88 | #ifdef ARCH_IS_BIG_ENDIAN |
90 | /** Various control flags. |
89 | /** Various control flags. |
91 | */ |
90 | */ |
92 | uint_16:3 flags; |
91 | uint_16:3 flags; |
93 | /** This field indicates where in the datagram this fragment belongs. |
92 | /** This field indicates where in the datagram this fragment belongs. |
94 | */ |
93 | */ |
95 | uint_16:13 fragment_offset; |
94 | uint_16:13 fragment_offset; |
96 | #else |
95 | #else |
97 | /** This field indicates where in the datagram this fragment belongs. |
96 | /** This field indicates where in the datagram this fragment belongs. |
98 | */ |
97 | */ |
99 | uint_16:13 fragment_offset; |
98 | uint_16:13 fragment_offset; |
100 | /** Various control flags. |
99 | /** Various control flags. |
101 | */ |
100 | */ |
102 | uint_16:3 flags; |
101 | uint_16:3 flags; |
103 | #endif |
102 | #endif |
104 | /** This field indicates the maximum time the datagram is allowed to remain in the internet system. |
103 | /** This field indicates the maximum time the datagram is allowed to remain in the internet system. |
105 | * If this field contains the value zero, then the datagram must be destroyed. |
104 | * If this field contains the value zero, then the datagram must be destroyed. |
106 | * This field is modified in internet header processing. |
105 | * This field is modified in internet header processing. |
107 | * The time is measured in units of seconds, but since every module that processes a~datagram must decrease the TTL by at least one even if it process the datagram in less than a~second, the TTL must be thought of only as an upper bound on the time a~datagram may exist. |
106 | * The time is measured in units of seconds, but since every module that processes a~datagram must decrease the TTL by at least one even if it process the datagram in less than a~second, the TTL must be thought of only as an upper bound on the time a~datagram may exist. |
108 | * The intention is to cause undeliverable datagrams to be discarded, and to bound the maximum datagram lifetime. |
107 | * The intention is to cause undeliverable datagrams to be discarded, and to bound the maximum datagram lifetime. |
109 | */ |
108 | */ |
110 | uint8_t ttl; |
109 | uint8_t ttl; |
111 | /** This field indicates the next level protocol used in the data portion of the internet datagram. |
110 | /** This field indicates the next level protocol used in the data portion of the internet datagram. |
112 | */ |
111 | */ |
113 | uint8_t protocol; |
112 | uint8_t protocol; |
114 | /** A checksum on the header only. |
113 | /** A checksum on the header only. |
115 | * Since some header fields change (e.g., time to live), this is recomputed and verified at each point that the internet header is processed. |
114 | * Since some header fields change (e.g., time to live), this is recomputed and verified at each point that the internet header is processed. |
116 | * The checksum algorithm is: The checksum field is the 16~bit one's complement of the one's complement sum of all 16~bit words in the header. |
115 | * The checksum algorithm is: The checksum field is the 16~bit one's complement of the one's complement sum of all 16~bit words in the header. |
117 | * For purposes of computing the checksum, the value of the checksum field is zero. |
116 | * For purposes of computing the checksum, the value of the checksum field is zero. |
118 | */ |
117 | */ |
119 | uint16_t header_checksum; |
118 | uint16_t header_checksum; |
120 | /** The source address. |
119 | /** The source address. |
121 | */ |
120 | */ |
122 | uint32_t source_address; |
121 | uint32_t source_address; |
123 | /** The destination address. |
122 | /** The destination address. |
124 | */ |
123 | */ |
125 | uint32_t destination_address; |
124 | uint32_t destination_address; |
126 | }; |
125 | }; |
127 | 126 | ||
128 | typedef struct ip_option ip_option_t; |
127 | typedef struct ip_option ip_option_t; |
129 | typedef ip_option * ip_option_ref; |
128 | typedef ip_option * ip_option_ref; |
130 | 129 | ||
131 | /** Internet option header. |
130 | /** Internet option header. |
132 | * Only type field is always valid. |
131 | * Only type field is always valid. |
133 | * Other fields' validity depends on the option type. |
132 | * Other fields' validity depends on the option type. |
134 | */ |
133 | */ |
135 | struct ip_option{ |
134 | struct ip_option{ |
136 | /** A single octet of option-type. |
135 | /** A single octet of option-type. |
137 | */ |
136 | */ |
138 | uint8_t type; |
137 | uint8_t type; |
139 | /** An option length octet. |
138 | /** An option length octet. |
140 | */ |
139 | */ |
141 | uint8_t length; |
140 | uint8_t length; |
142 | /** A~pointer. |
141 | /** A~pointer. |
143 | */ |
142 | */ |
144 | uint8_t pointer; |
143 | uint8_t pointer; |
145 | #ifdef ARCH_IS_BIG_ENDIAN |
144 | #ifdef ARCH_IS_BIG_ENDIAN |
146 | /** The number of IP modules that cannot register timestamps due to lack of space. |
145 | /** The number of IP modules that cannot register timestamps due to lack of space. |
147 | */ |
146 | */ |
148 | uint8_t:4 overflow; |
147 | uint8_t:4 overflow; |
149 | /** Various internet timestamp control flags. |
148 | /** Various internet timestamp control flags. |
150 | */ |
149 | */ |
151 | uint8_t:4 flags; |
150 | uint8_t:4 flags; |
152 | #else |
151 | #else |
153 | /** Various internet timestamp control flags. |
152 | /** Various internet timestamp control flags. |
154 | */ |
153 | */ |
155 | uint8_t:4 flags; |
154 | uint8_t:4 flags; |
156 | /** The number of IP modules that cannot register timestamps due to lack of space. |
155 | /** The number of IP modules that cannot register timestamps due to lack of space. |
157 | */ |
156 | */ |
158 | uint8_t:4 overflow; |
157 | uint8_t:4 overflow; |
159 | #endif |
158 | #endif |
160 | }; |
159 | }; |
161 | 160 | ||
162 | #define IPTOS_TOS_MASK 0x1E |
161 | #define IPTOS_TOS_MASK 0x1E |
163 | #define IPTOS_PRECEDENCE_SHIFT 5 |
162 | #define IPTOS_PRECEDENCE_SHIFT 5 |
164 | #define IPTOS_DELAY_SHIFT 4 |
163 | #define IPTOS_DELAY_SHIFT 4 |
165 | #define IPTOS_THROUGHPUT_SHIFT 3 |
164 | #define IPTOS_THROUGHPUT_SHIFT 3 |
166 | #define IPTOS_RELIABILITY_SHIFT 2 |
165 | #define IPTOS_RELIABILITY_SHIFT 2 |
167 | #define IPTOS_COST_SHIFT 1 |
166 | #define IPTOS_COST_SHIFT 1 |
168 | 167 | ||
169 | #define IPTOS_NORMALDELAY ( 0x0 << IPTOS_DELAY_SHIFT ) |
168 | #define IPTOS_NORMALDELAY ( 0x0 << IPTOS_DELAY_SHIFT ) |
170 | #define IPTOS_LOWDELAY ( 0x1 << IPTOS_DELAY_SHIFT ) |
169 | #define IPTOS_LOWDELAY ( 0x1 << IPTOS_DELAY_SHIFT ) |
171 | 170 | ||
172 | #define IPTOS_NORMALTHROUGHPUT ( 0x0 << IPTOS_THROUGHPUT_SHIFT ) |
171 | #define IPTOS_NORMALTHROUGHPUT ( 0x0 << IPTOS_THROUGHPUT_SHIFT ) |
173 | #define IPTOS_THROUGHPUT ( 0x1 << IPTOS_THROUGHPUT_SHIFT ) |
172 | #define IPTOS_THROUGHPUT ( 0x1 << IPTOS_THROUGHPUT_SHIFT ) |
174 | 173 | ||
175 | #define IPTOS_NORMALRELIABILITY ( 0x0 << IPTOS_RELIABILITY_SHIFT ) |
174 | #define IPTOS_NORMALRELIABILITY ( 0x0 << IPTOS_RELIABILITY_SHIFT ) |
176 | #define IPTOS_RELIABILITY ( 0x1 << IPTOS_RELIABILITY_SHIFT ) |
175 | #define IPTOS_RELIABILITY ( 0x1 << IPTOS_RELIABILITY_SHIFT ) |
177 | 176 | ||
178 | #define IPTOS_NORMALCOST ( 0x0 << IPTOS_COST_SHIFT ) |
177 | #define IPTOS_NORMALCOST ( 0x0 << IPTOS_COST_SHIFT ) |
179 | #define IPTOS_MICNCOST ( 0x1 << IPTOS_COST_SHIFT ) |
178 | #define IPTOS_MICNCOST ( 0x1 << IPTOS_COST_SHIFT ) |
180 | 179 | ||
181 | #define IPTOS_PREC_MASK 0xE0 |
180 | #define IPTOS_PREC_MASK 0xE0 |
182 | #define IPTOS_PREC_ROUTINE ( 0x0 << IPTOS_PRECEDENCE_SHIFT ) |
181 | #define IPTOS_PREC_ROUTINE ( 0x0 << IPTOS_PRECEDENCE_SHIFT ) |
183 | #define IPTOS_PREC_PRIORITY ( 0x1 << IPTOS_PRECEDENCE_SHIFT ) |
182 | #define IPTOS_PREC_PRIORITY ( 0x1 << IPTOS_PRECEDENCE_SHIFT ) |
184 | #define IPTOS_PREC_IMMEDIATE ( 0x2 << IPTOS_PRECEDENCE_SHIFT ) |
183 | #define IPTOS_PREC_IMMEDIATE ( 0x2 << IPTOS_PRECEDENCE_SHIFT ) |
185 | #define IPTOS_PREC_FLASH ( 0x3 << IPTOS_PRECEDENCE_SHIFT ) |
184 | #define IPTOS_PREC_FLASH ( 0x3 << IPTOS_PRECEDENCE_SHIFT ) |
186 | #define IPTOS_PREC_FLASHOVERRIDE ( 0x4 << IPTOS_PRECEDENCE_SHIFT ) |
185 | #define IPTOS_PREC_FLASHOVERRIDE ( 0x4 << IPTOS_PRECEDENCE_SHIFT ) |
187 | #define IPTOS_PREC_CRITIC_ECP ( 0x5 << IPTOS_PRECEDENCE_SHIFT ) |
186 | #define IPTOS_PREC_CRITIC_ECP ( 0x5 << IPTOS_PRECEDENCE_SHIFT ) |
188 | #define IPTOS_PREC_INTERNETCONTROL ( 0x6 << IPTOS_PRECEDENCE_SHIFT ) |
187 | #define IPTOS_PREC_INTERNETCONTROL ( 0x6 << IPTOS_PRECEDENCE_SHIFT ) |
189 | #define IPTOS_PREC_NETCONTROL ( 0x7 << IPTOS_PRECEDENCE_SHIFT ) |
188 | #define IPTOS_PREC_NETCONTROL ( 0x7 << IPTOS_PRECEDENCE_SHIFT ) |
190 | 189 | ||
191 | #define IPFLAG_FRAGMENT_SHIFT 1 |
190 | #define IPFLAG_FRAGMENT_SHIFT 1 |
192 | #define IPFLAG_FRAGMENTED_SHIFT 0 |
191 | #define IPFLAG_FRAGMENTED_SHIFT 0 |
193 | 192 | ||
194 | #define IPFLAG_MAY_FRAGMENT ( 0x0 << IPFLAG_FRAGMENT_SHIFT ) |
193 | #define IPFLAG_MAY_FRAGMENT ( 0x0 << IPFLAG_FRAGMENT_SHIFT ) |
195 | #define IPFLAG_DONT_FRAGMENT ( 0x1 << IPFLAG_FRAGMENT_SHIFT ) |
194 | #define IPFLAG_DONT_FRAGMENT ( 0x1 << IPFLAG_FRAGMENT_SHIFT ) |
196 | 195 | ||
197 | #define IPFLAG_LAST_FRAGMENT ( 0x0 << IPFLAG_FRAGMENTED_SHIFT ) |
196 | #define IPFLAG_LAST_FRAGMENT ( 0x0 << IPFLAG_FRAGMENTED_SHIFT ) |
198 | #define IPFLAG_MORE_FRAGMENTS ( 0x1 << IPFLAG_FRAGMENTED_SHIFT ) |
197 | #define IPFLAG_MORE_FRAGMENTS ( 0x1 << IPFLAG_FRAGMENTED_SHIFT ) |
199 | 198 | ||
200 | #define IPOPT_COPY_SHIFT 7 |
199 | #define IPOPT_COPY_SHIFT 7 |
201 | #define IPOPT_CLASS_SHIFT 5 |
200 | #define IPOPT_CLASS_SHIFT 5 |
202 | #define IPOPT_NUMBER_SHIFT 0 |
201 | #define IPOPT_NUMBER_SHIFT 0 |
203 | #define IPOPT_CLASS_MASK 0x60 |
202 | #define IPOPT_CLASS_MASK 0x60 |
204 | #define IPOPT_NUMBER_MASK 0x1F |
203 | #define IPOPT_NUMBER_MASK 0x1F |
205 | 204 | ||
206 | #define IPOPT_COPY ( 1 << IPOPT_COPY_SHIFT ) |
205 | #define IPOPT_COPY ( 1 << IPOPT_COPY_SHIFT ) |
207 | 206 | ||
208 | #define IPOPT_TYPE( copy, class, number ) ((( copy ) & IPOPT_COPY ) | (( class ) & IPOPT_CLASS_MASK ) | (( number << IPOPT_NUMBER_SHIFT ) & IPOPT_NUMBER_MASK )) |
207 | #define IPOPT_TYPE( copy, class, number ) ((( copy ) & IPOPT_COPY ) | (( class ) & IPOPT_CLASS_MASK ) | (( number << IPOPT_NUMBER_SHIFT ) & IPOPT_NUMBER_MASK )) |
209 | 208 | ||
210 | #define IPOPT_COPIED( o ) (( o ) & IPOPT_COPY ) |
209 | #define IPOPT_COPIED( o ) (( o ) & IPOPT_COPY ) |
211 | #define IPOPT_CLASS( o ) (( o ) & IPOPT_CLASS_MASK ) |
210 | #define IPOPT_CLASS( o ) (( o ) & IPOPT_CLASS_MASK ) |
212 | #define IPOPT_NUMBER( o ) (( o ) & IPOPT_NUMBER_MASK ) |
211 | #define IPOPT_NUMBER( o ) (( o ) & IPOPT_NUMBER_MASK ) |
213 | 212 | ||
214 | #define IPOPT_CONTROL ( 1 << IPOPT_CLASS_SHIFT ) |
213 | #define IPOPT_CONTROL ( 1 << IPOPT_CLASS_SHIFT ) |
215 | #define IPOPT_RESERVED1 ( 2 << IPOPT_CLASS_SHIFT ) |
214 | #define IPOPT_RESERVED1 ( 2 << IPOPT_CLASS_SHIFT ) |
216 | #define IPOPT_MEASUREMENT ( 3 << IPOPT_CLASS_SHIFT ) |
215 | #define IPOPT_MEASUREMENT ( 3 << IPOPT_CLASS_SHIFT ) |
217 | #define IPOPT_RESERVED2 ( 4 << IPOPT_CLASS_SHIFT ) |
216 | #define IPOPT_RESERVED2 ( 4 << IPOPT_CLASS_SHIFT ) |
218 | 217 | ||
219 | //#define IPOPT_END_OF_LIST 0x0 |
218 | //#define IPOPT_END_OF_LIST 0x0 |
220 | #define IPOPT_END IPOPT_TYPE( 0, IPOPT_CONTROL, 0 ) |
219 | #define IPOPT_END IPOPT_TYPE( 0, IPOPT_CONTROL, 0 ) |
221 | //#define IPOPT_NO_OPERATION 0x1 |
220 | //#define IPOPT_NO_OPERATION 0x1 |
222 | #define IPOPT_NOOP IPOPT_TYPE( 0, IPOPT_CONTROL, 1 ) |
221 | #define IPOPT_NOOP IPOPT_TYPE( 0, IPOPT_CONTROL, 1 ) |
223 | //#define IPOPT_SECURITY 0x82 |
222 | //#define IPOPT_SECURITY 0x82 |
224 | #define IPOPT_SEC IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 2 ) |
223 | #define IPOPT_SEC IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 2 ) |
225 | #define IPOPT_SEC_LENGTH 11 |
224 | #define IPOPT_SEC_LENGTH 11 |
226 | #define IPOPT_SEC_UNCLASIFIED 0x0 |
225 | #define IPOPT_SEC_UNCLASIFIED 0x0 |
227 | #define IPOPT_SEC_CONFIDENTIAL 0xF035 |
226 | #define IPOPT_SEC_CONFIDENTIAL 0xF035 |
228 | #define IPOPT_SEC_EFTO 0x789A |
227 | #define IPOPT_SEC_EFTO 0x789A |
229 | #define IPOPT_SEC_MMMM 0xBC4D |
228 | #define IPOPT_SEC_MMMM 0xBC4D |
230 | #define IPOPT_SEC_PROG 0x5E26 |
229 | #define IPOPT_SEC_PROG 0x5E26 |
231 | #define IPOPT_SEC_RESTRICTED 0xAF13 |
230 | #define IPOPT_SEC_RESTRICTED 0xAF13 |
232 | #define IPOPT_SEC_SECRET 0xD788 |
231 | #define IPOPT_SEC_SECRET 0xD788 |
233 | #define IPOPT_SEC_TOP_SECRET 0x6BC5 |
232 | #define IPOPT_SEC_TOP_SECRET 0x6BC5 |
234 | //#define IPOPT_LOOSE_SOURCE 0x83 |
233 | //#define IPOPT_LOOSE_SOURCE 0x83 |
235 | #define IPOPT_LSRR IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 3 ) |
234 | #define IPOPT_LSRR IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 3 ) |
236 | //#define IPOPT_STRICT_SOURCE 0x89 |
235 | //#define IPOPT_STRICT_SOURCE 0x89 |
237 | #define IPOPT_SSRR IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 9 ) |
236 | #define IPOPT_SSRR IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 9 ) |
238 | //#define IPOPT_RECORD_ROUTE 0x07 |
237 | //#define IPOPT_RECORD_ROUTE 0x07 |
239 | #define IPOPT_RR IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 7 ) |
238 | #define IPOPT_RR IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 7 ) |
240 | //#define IPOPT_STREAM_IDENTIFIER 0x88 |
239 | //#define IPOPT_STREAM_IDENTIFIER 0x88 |
241 | #define IPOPT_SID IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 8 ) |
240 | #define IPOPT_SID IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 8 ) |
242 | #define IPOPT_SID_LENGTH 4 |
241 | #define IPOPT_SID_LENGTH 4 |
243 | //#define IPOPT_INTERNET_TIMESTAMP 0x44 |
242 | //#define IPOPT_INTERNET_TIMESTAMP 0x44 |
244 | #define IPOPT_TIMESTAMP IPOPT_TYPE( IPOPT_COPY, IPOPT_MEASUREMENT, 4 ) |
243 | #define IPOPT_TIMESTAMP IPOPT_TYPE( IPOPT_COPY, IPOPT_MEASUREMENT, 4 ) |
245 | #define IPOPT_CIPSO IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 5 ) |
244 | #define IPOPT_CIPSO IPOPT_TYPE( IPOPT_COPY, IPOPT_CONTROL, 5 ) |
246 | 245 | ||
247 | #define IPVERSION 4 |
246 | #define IPVERSION 4 |
248 | #define MAXTTL 255 |
247 | #define MAXTTL 255 |
249 | #define IPDEFTTL 64 |
248 | #define IPDEFTTL 64 |
250 | 249 | ||
251 | #define IPOPT_OPTVAL 0 |
250 | #define IPOPT_OPTVAL 0 |
252 | #define IPOPT_OLEN 1 |
251 | #define IPOPT_OLEN 1 |
253 | #define IPOPT_OFFSET 2 |
252 | #define IPOPT_OFFSET 2 |
254 | #define IPOPT_MINOFF 4 |
253 | #define IPOPT_MINOFF 4 |
255 | #define MAX_IPOPTLEN 40 |
254 | #define MAX_IPOPTLEN 40 |
256 | #define IPOPT_NOP IPOPT_NOOP |
255 | #define IPOPT_NOP IPOPT_NOOP |
257 | #define IPOPT_EOL IPOPT_END |
256 | #define IPOPT_EOL IPOPT_END |
258 | #define IPOPT_TS IPOPT_TIMESTAMP |
257 | #define IPOPT_TS IPOPT_TIMESTAMP |
259 | 258 | ||
260 | #define IPOPT_TS_TSONLY 0 /* timestamps only */ |
259 | #define IPOPT_TS_TSONLY 0 /* timestamps only */ |
261 | #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ |
260 | #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ |
262 | #define IPOPT_TS_PRESPEC 3 /* specified modules only */ |
261 | #define IPOPT_TS_PRESPEC 3 /* specified modules only */ |
263 | 262 | ||
264 | #endif |
263 | #endif |
265 | 264 | ||
266 | /** @} |
265 | /** @} |
267 | */ |
266 | */ |
268 | 267 |