source: mainline/uspace/lib/c/include/net/icmp_codes.h@ 25171e5

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 25171e5 was 25171e5, checked in by Jakub Jermar <jakub@…>, 15 years ago

Cleanup icmp_client.[ch].

  • Property mode set to 100644
File size: 6.1 KB
Line 
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 libc
30 * @{
31 */
32
33/** @file
34 * ICMP types and codes according to the on-line IANA - ICMP Type Numbers
35 *
36 * http://www.iana.org/assignments/icmp-parameters>
37 *
38 * cited September 14 2009.
39 */
40
41#ifndef LIBC_ICMP_CODES_H_
42#define LIBC_ICMP_CODES_H_
43
44#include <sys/types.h>
45
46/** ICMP type type definition. */
47typedef uint8_t icmp_type_t;
48
49/** ICMP code type definition. */
50typedef uint8_t icmp_code_t;
51
52/** ICMP parameter type definition. */
53typedef uint16_t icmp_param_t;
54
55/** @name ICMP types definitions */
56/*@{*/
57
58/** Echo Reply. */
59#define ICMP_ECHOREPLY 0
60
61/** Destination Unreachable. */
62#define ICMP_DEST_UNREACH 3
63
64/** Source Quench. */
65#define ICMP_SOURCE_QUENCH 4
66
67/** Redirect. */
68#define ICMP_REDIRECT 5
69
70/** Alternate Host Address. */
71#define ICMP_ALTERNATE_ADDR 6
72
73/** Echo Request. */
74#define ICMP_ECHO 8
75
76/** Router Advertisement. */
77#define ICMP_ROUTER_ADV 9
78
79/** Router solicitation. */
80#define ICMP_ROUTER_SOL 10
81
82/** Time Exceeded. */
83#define ICMP_TIME_EXCEEDED 11
84
85/** Parameter Problem. */
86#define ICMP_PARAMETERPROB 12
87
88/** Timestamp Request. */
89#define ICMP_TIMESTAMP 13
90
91/** Timestamp Reply. */
92#define ICMP_TIMESTAMPREPLY 14
93
94/** Information Request. */
95#define ICMP_INFO_REQUEST 15
96
97/** Information Reply. */
98#define ICMP_INFO_REPLY 16
99
100/** Address Mask Request. */
101#define ICMP_ADDRESS 17
102
103/** Address Mask Reply. */
104#define ICMP_ADDRESSREPLY 18
105
106/** Traceroute. */
107#define ICMP_TRACEROUTE 30
108
109/** Datagram Conversion Error. */
110#define ICMP_CONVERSION_ERROR 31
111
112/** Mobile Host Redirect. */
113#define ICMP_REDIRECT_MOBILE 32
114
115/** IPv6 Where-Are-You. */
116#define ICMP_IPV6_WHERE_ARE_YOU 33
117
118/** IPv6 I-Am-Here. */
119#define ICMP_IPV6_I_AM_HERE 34
120
121/** Mobile Registration Request. */
122#define ICMP_MOBILE_REQUEST 35
123
124/** Mobile Registration Reply. */
125#define ICMP_MOBILE_REPLY 36
126
127/** Domain name request. */
128#define ICMP_DN_REQUEST 37
129
130/** Domain name reply. */
131#define ICMP_DN_REPLY 38
132
133/** SKIP. */
134#define ICMP_SKIP 39
135
136/** Photuris. */
137#define ICMP_PHOTURIS 40
138
139/*@}*/
140
141/** @name ICMP_DEST_UNREACH codes definitions
142 */
143/*@{*/
144
145/** Network Unreachable. */
146#define ICMP_NET_UNREACH 0
147
148/** Host Unreachable. */
149#define ICMP_HOST_UNREACH 1
150
151/** Protocol Unreachable. */
152#define ICMP_PROT_UNREACH 2
153
154/** Port Unreachable. */
155#define ICMP_PORT_UNREACH 3
156
157/** Fragmentation needed but the Do Not Fragment bit was set. */
158#define ICMP_FRAG_NEEDED 4
159
160/** Source Route failed. */
161#define ICMP_SR_FAILED 5
162
163/** Destination network unknown. */
164#define ICMP_NET_UNKNOWN 6
165
166/** Destination host unknown. */
167#define ICMP_HOST_UNKNOWN 7
168
169/** Source host isolated (obsolete). */
170#define ICMP_HOST_ISOLATED 8
171
172/** Destination network administratively prohibited. */
173#define ICMP_NET_ANO 9
174
175/** Destination host administratively prohibited. */
176#define ICMP_HOST_ANO 10
177
178/** Network unreachable for this type of service. */
179#define ICMP_NET_UNR_TOS 11
180
181/** Host unreachable for this type of service. */
182#define ICMP_HOST_UNR_TOS 12
183
184/** Communication administratively prohibited by filtering. */
185#define ICMP_PKT_FILTERED 13
186
187/** Host precedence violation. */
188#define ICMP_PREC_VIOLATION 14
189
190/** Precedence cutoff in effect. */
191#define ICMP_PREC_CUTOFF 15
192
193/*@}*/
194
195/** @name ICMP_REDIRECT codes definitions */
196/*@{*/
197
198/** Network redirect (or subnet). */
199#define ICMP_REDIR_NET 0
200
201/** Host redirect. */
202#define ICMP_REDIR_HOST 1
203
204/** Network redirect for this type of service. */
205#define ICMP_REDIR_NETTOS 2
206
207/** Host redirect for this type of service. */
208#define ICMP_REDIR_HOSTTOS 3
209
210/*@}*/
211
212/** @name ICMP_ALTERNATE_ADDRESS codes definitions */
213/*@{*/
214
215/** Alternate address for host. */
216#define ICMP_ALTERNATE_HOST 0
217
218/*@}*/
219
220/** @name ICMP_ROUTER_ADV codes definitions */
221/*@{*/
222
223/** Normal router advertisement. */
224#define ICMP_ROUTER_NORMAL 0
225
226/** Does not route common traffic. */
227#define ICMP_ROUTER_NO_NORMAL_TRAFFIC 16
228
229/*@}*/
230
231/** @name ICMP_TIME_EXCEEDED codes definitions */
232/*@{*/
233
234/** Transit TTL exceeded. */
235#define ICMP_EXC_TTL 0
236
237/** Reassembly TTL exceeded. */
238#define ICMP_EXC_FRAGTIME 1
239
240/*@}*/
241
242/** @name ICMP_PARAMETERPROB codes definitions */
243/*@{*/
244
245/** Pointer indicates the error. */
246#define ICMP_PARAM_POINTER 0
247
248/** Missing required option. */
249#define ICMP_PARAM_MISSING 1
250
251/** Bad length. */
252#define ICMP_PARAM_LENGTH 2
253
254/*@}*/
255
256/** @name ICMP_PHOTURIS codes definitions */
257/*@{*/
258
259/** Bad SPI. */
260#define ICMP_PHOTURIS_BAD_SPI 0
261
262/** Authentication failed. */
263#define ICMP_PHOTURIS_AUTHENTICATION 1
264
265/** Decompression failed. */
266#define ICMP_PHOTURIS_DECOMPRESSION 2
267
268/** Decryption failed. */
269#define ICMP_PHOTURIS_DECRYPTION 3
270
271/** Need authentication. */
272#define ICMP_PHOTURIS_NEED_AUTHENTICATION 4
273
274/** Need authorization. */
275#define ICMP_PHOTURIS_NEED_AUTHORIZATION 5
276
277/*@}*/
278
279#endif
280
281/** @}
282 */
Note: See TracBrowser for help on using the repository browser.