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