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