Rev 4720 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4707 | mejdrech | 1 | /* |
2 | * Copyright (c) 2009 Lukas Mejdrech |
||
3 | * All rights reserved. |
||
4 | * |
||
5 | * Redistribution and use in source and binary forms, with or without |
||
6 | * modification, are permitted provided that the following conditions |
||
7 | * are met: |
||
8 | * |
||
9 | * - Redistributions of source code must retain the above copyright |
||
10 | * notice, this list of conditions and the following disclaimer. |
||
11 | * - Redistributions in binary form must reproduce the above copyright |
||
12 | * notice, this list of conditions and the following disclaimer in the |
||
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 |
||
15 | * derived from this software without specific prior written permission. |
||
16 | * |
||
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 |
||
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
||
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
||
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
||
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 |
||
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 |
||
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||
27 | */ |
||
28 | |||
29 | /** @addtogroup icmp |
||
30 | * @{ |
||
31 | */ |
||
32 | |||
33 | /** @file |
||
34 | * ICMP types and codes according to the on-line IANA - ICMP Type Numbers - <http://http://www.iana.org/assignments/icmp-parameters>, cited September 14 2009. |
||
35 | * Names according to the linux src/include/linux/icmp.h header file. |
||
36 | */ |
||
37 | |||
38 | #ifndef __NET_ICMP_CODES_H__ |
||
39 | #define __NET_ICMP_CODES_H__ |
||
40 | |||
41 | /** ICMP type type definition. |
||
42 | */ |
||
43 | typedef uint8_t icmp_type_t; |
||
44 | |||
45 | /** ICMP code type definition. |
||
46 | */ |
||
47 | typedef uint8_t icmp_code_t; |
||
48 | |||
49 | /** ICMP parameter type definition. |
||
50 | */ |
||
51 | typedef uint16_t icmp_param_t; |
||
52 | |||
53 | /** @name ICMP types definitions |
||
54 | */ |
||
55 | /*@{*/ |
||
56 | |||
57 | /** Echo Reply. |
||
58 | */ |
||
59 | #define ICMP_ECHOREPLY 0 |
||
60 | |||
61 | /** Destination Unreachable. |
||
62 | */ |
||
63 | #define ICMP_DEST_UNREACH 3 |
||
64 | |||
65 | /** Source Quench. |
||
66 | */ |
||
67 | #define ICMP_SOURCE_QUENCH 4 |
||
68 | |||
69 | /** Redirect. |
||
70 | */ |
||
71 | #define ICMP_REDIRECT 5 |
||
72 | |||
73 | /** Alternate Host Address. |
||
74 | */ |
||
75 | #define ICMP_ALTERNATE_ADDR 6 |
||
76 | |||
77 | /** Echo Request. |
||
78 | */ |
||
79 | #define ICMP_ECHO 8 |
||
80 | |||
81 | /** Router advertisement. |
||
82 | */ |
||
83 | #define ICMP_ROUTER_ADV 9 |
||
84 | |||
85 | /** Router solicitation. |
||
86 | */ |
||
87 | #define ICMP_ROUTER_SOL 10 |
||
88 | |||
89 | /** Time Exceeded. |
||
90 | */ |
||
91 | #define ICMP_TIME_EXCEEDED 11 |
||
92 | |||
93 | /** Parameter Problem. |
||
94 | */ |
||
95 | #define ICMP_PARAMETERPROB 12 |
||
96 | |||
97 | /** Timestamp Request. |
||
98 | */ |
||
99 | #define ICMP_TIMESTAMP 13 |
||
100 | |||
101 | /** Timestamp Reply. |
||
102 | */ |
||
103 | #define ICMP_TIMESTAMPREPLY 14 |
||
104 | |||
105 | /** Information Request. |
||
106 | */ |
||
107 | #define ICMP_INFO_REQUEST 15 |
||
108 | |||
109 | /** Information Reply. |
||
110 | */ |
||
111 | #define ICMP_INFO_REPLY 16 |
||
112 | |||
113 | /** Address Mask Request. |
||
114 | */ |
||
115 | #define ICMP_ADDRESS 17 |
||
116 | |||
117 | /** Address Mask Reply. |
||
118 | */ |
||
119 | #define ICMP_ADDRESSREPLY 18 |
||
120 | |||
121 | /** Traceroute. |
||
122 | */ |
||
123 | #define ICMP_TRACEROUTE 30 |
||
124 | |||
125 | /** Datagram Conversion Error. |
||
126 | */ |
||
127 | #define ICMP_CONVERSION_ERROR 31 |
||
128 | |||
129 | /** Mobile Host Redirect. |
||
130 | */ |
||
131 | #define ICMP_REDIRECT_MOBILE 32 |
||
132 | |||
133 | /** IPv6 Where-Are-You. |
||
134 | */ |
||
135 | #define ICMP_IPV6_WHERE_ARE_YOU 33 |
||
136 | |||
137 | /** IPv6 I-Am-Here. |
||
138 | */ |
||
139 | #define ICMP_IPV6_I_AM_HERE 34 |
||
140 | |||
141 | /** Mobile Registration Request. |
||
142 | */ |
||
143 | #define ICMP_MOBILE_REQUEST 35 |
||
144 | |||
145 | /** Mobile Registration Reply. |
||
146 | */ |
||
147 | #define ICMP_MOBILE_REPLY 36 |
||
148 | |||
149 | /** Domain name request. |
||
150 | */ |
||
151 | #define ICMP_DN_REQUEST 37 |
||
152 | |||
153 | /** Domain name reply. |
||
154 | */ |
||
155 | #define ICMP_DN_REPLY 38 |
||
156 | |||
157 | /** SKIP. |
||
158 | */ |
||
159 | #define ICMP_SKIP 39 |
||
160 | |||
161 | /** Photuris. |
||
162 | */ |
||
163 | #define ICMP_PHOTURIS 40 |
||
164 | |||
165 | /*@}*/ |
||
166 | |||
167 | /** @name ICMP_DEST_UNREACH codes definitions |
||
168 | */ |
||
169 | /*@{*/ |
||
170 | |||
171 | /** Network Unreachable. |
||
172 | */ |
||
173 | #define ICMP_NET_UNREACH 0 |
||
174 | |||
175 | /** Host Unreachable. |
||
176 | */ |
||
177 | #define ICMP_HOST_UNREACH 1 |
||
178 | |||
179 | /** Protocol Unreachable. |
||
180 | */ |
||
181 | #define ICMP_PROT_UNREACH 2 |
||
182 | |||
183 | /** Port Unreachable. |
||
184 | */ |
||
185 | #define ICMP_PORT_UNREACH 3 |
||
186 | |||
187 | /** Fragmentation needed but the Do Not Fragment bit was set. |
||
188 | */ |
||
189 | #define ICMP_FRAG_NEEDED 4 |
||
190 | |||
191 | /** Source Route failed. |
||
192 | */ |
||
193 | #define ICMP_SR_FAILED 5 |
||
194 | |||
195 | /** Destination network unknown. |
||
196 | */ |
||
197 | #define ICMP_NET_UNKNOWN 6 |
||
198 | |||
199 | /** Destination host unknown. |
||
200 | */ |
||
201 | #define ICMP_HOST_UNKNOWN 7 |
||
202 | |||
203 | /** Source host isolated (obsolete). |
||
204 | */ |
||
205 | #define ICMP_HOST_ISOLATED 8 |
||
206 | |||
207 | /** Destination network administratively prohibited. |
||
208 | */ |
||
209 | #define ICMP_NET_ANO 9 |
||
210 | |||
211 | /** Destination host administratively prohibited. |
||
212 | */ |
||
213 | #define ICMP_HOST_ANO 10 |
||
214 | |||
215 | /** Network unreachable for this type of service. |
||
216 | */ |
||
217 | #define ICMP_NET_UNR_TOS 11 |
||
218 | |||
219 | /** Host unreachable for this type of service. |
||
220 | */ |
||
221 | #define ICMP_HOST_UNR_TOS 12 |
||
222 | |||
223 | /** Communication administratively prohibited by filtering. |
||
224 | */ |
||
225 | #define ICMP_PKT_FILTERED 13 |
||
226 | |||
227 | /** Host precedence violation. |
||
228 | */ |
||
229 | #define ICMP_PREC_VIOLATION 14 |
||
230 | |||
231 | /** Precedence cutoff in effect. |
||
232 | */ |
||
233 | #define ICMP_PREC_CUTOFF 15 |
||
234 | |||
235 | /*@}*/ |
||
236 | |||
237 | /** @name ICMP_REDIRECT codes definitions |
||
238 | */ |
||
239 | /*@{*/ |
||
240 | |||
241 | /** Network redirect (or subnet). |
||
242 | */ |
||
243 | #define ICMP_REDIR_NET 0 |
||
244 | |||
245 | /** Host redirect. |
||
246 | */ |
||
247 | #define ICMP_REDIR_HOST 1 |
||
248 | |||
249 | /** Network redirect for this type of service. |
||
250 | */ |
||
251 | #define ICMP_REDIR_NETTOS 2 |
||
252 | |||
253 | /** Host redirect for this type of service. |
||
254 | */ |
||
255 | #define ICMP_REDIR_HOSTTOS 3 |
||
256 | |||
257 | /*@}*/ |
||
258 | |||
259 | /** @name ICMP_ALTERNATE_ADDRESS codes definitions |
||
260 | */ |
||
261 | /*@{*/ |
||
262 | |||
263 | /** Alternate address for host. |
||
264 | */ |
||
265 | #define ICMP_ALTERNATE_HOST 0 |
||
266 | |||
267 | /*@}*/ |
||
268 | |||
269 | /** @name ICMP_TIME_EXCEEDED codes definitions |
||
270 | */ |
||
271 | /*@{*/ |
||
272 | |||
273 | /** Transit TTL exceeded. |
||
274 | */ |
||
275 | #define ICMP_EXC_TTL 0 |
||
276 | |||
277 | /** Reassembly TTL exceeded. |
||
278 | */ |
||
279 | #define ICMP_EXC_FRAGTIME 1 |
||
280 | |||
281 | /*@}*/ |
||
282 | |||
283 | /** @name ICMP_ROUTER_ADV codes definitions |
||
284 | */ |
||
285 | /*@{*/ |
||
286 | |||
287 | /** Normal router advertisement. |
||
288 | */ |
||
289 | #define ICMP_ROUTER_NORMAL 0 |
||
290 | |||
291 | /** Does not route common traffic. |
||
292 | */ |
||
293 | #define ICMP_ROUTER_NO_NORMAL_TRAFFIC 16 |
||
294 | |||
295 | /*@}*/ |
||
296 | |||
297 | /** @name ICMP_TIME_EXCEEDED codes definitions |
||
298 | */ |
||
299 | /*@{*/ |
||
300 | |||
301 | /** Transit TTL exceeded. |
||
302 | */ |
||
303 | #define ICMP_EXC_TTL 0 |
||
304 | |||
305 | /** Reassembly TTL exceeded. |
||
306 | */ |
||
307 | #define ICMP_EXC_FRAGTIME 1 |
||
308 | |||
309 | /*@}*/ |
||
310 | |||
311 | /** @name ICMP_PARAMETERPROB codes definitions |
||
312 | */ |
||
313 | /*@{*/ |
||
314 | |||
315 | /** Pointer indicates the error. |
||
316 | */ |
||
317 | #define ICMP_PARAM_POINTER 0 |
||
318 | |||
319 | /** Missing required option. |
||
320 | */ |
||
321 | #define ICMP_PARAM_MISSING 1 |
||
322 | |||
323 | /** Bad length. |
||
324 | */ |
||
325 | #define ICMP_PARAM_LENGTH 2 |
||
326 | |||
327 | /*@}*/ |
||
328 | |||
329 | /** @name ICMP_PHOTURIS codes definitions |
||
330 | */ |
||
331 | /*@{*/ |
||
332 | |||
333 | /** Bad SPI. |
||
334 | */ |
||
335 | #define ICMP_PHOTURIS_BAD_SPI 0 |
||
336 | |||
337 | /** Authentication failed. |
||
338 | */ |
||
339 | #define ICMP_PHOTURIS_AUTHENTICATION 1 |
||
340 | |||
341 | /** Decompression failed. |
||
342 | */ |
||
343 | #define ICMP_PHOTURIS_DECOMPRESSION 2 |
||
344 | |||
345 | /** Decryption failed. |
||
346 | */ |
||
347 | #define ICMP_PHOTURIS_DECRYPTION 3 |
||
348 | |||
349 | /** Need authentication. |
||
350 | */ |
||
351 | #define ICMP_PHOTURIS_NEED_AUTHENTICATION 4 |
||
352 | |||
353 | /** Need authorization. |
||
354 | */ |
||
355 | #define ICMP_PHOTURIS_NEED_AUTHORIZATION 5 |
||
356 | |||
357 | /*@}*/ |
||
358 | |||
359 | #endif |
||
360 | |||
361 | /** @} |
||
362 | */ |