Subversion Repositories HelenOS

Rev

Rev 4728 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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