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