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