Loading...
Searching...
No Matches
icmpv6.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
22
23#include <stdint.h>
24
25#include "byteorder.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
38#define ICMPV6_DST_UNR (1)
39#define ICMPV6_PKT_TOO_BIG (2)
40#define ICMPV6_TIME_EXC (3)
41#define ICMPV6_PARAM_PROB (4)
42#define ICMPV6_ERR_EXP1 (100)
43#define ICMPV6_ERR_EXP2 (101)
47
55#define ICMPV6_ECHO_REQ (128)
56#define ICMPV6_ECHO_REP (129)
57#define ICMPV6_RTR_SOL (133)
58#define ICMPV6_RTR_ADV (134)
59#define ICMPV6_NBR_SOL (135)
60#define ICMPV6_NBR_ADV (136)
61#define ICMPV6_REDIRECT (137)
62#define ICMPV6_RPL_CTRL (155)
63#define ICMPV6_DAR (157)
64#define ICMPV6_DAC (158)
65#define ICMPV6_INF_EXP1 (200)
66#define ICMPV6_INF_EXP2 (201)
70
80#define ICMPV6_ERROR_DST_UNR_NO_ROUTE (0)
81#define ICMPV6_ERROR_DST_UNR_PROHIB (1)
84#define ICMPV6_ERROR_DST_UNR_SCOPE (2)
85#define ICMPV6_ERROR_DST_UNR_ADDR (3)
86#define ICMPV6_ERROR_DST_UNR_PORT (4)
87#define ICMPV6_ERROR_DST_UNR_POLICY (5)
89#define ICMPV6_ERROR_DST_UNR_REJECT (6)
93
103#define ICMPV6_ERROR_TIME_EXC_HL (0)
104#define ICMPV6_ERROR_TIME_EXC_FRAG (1)
108
118#define ICMPV6_ERROR_PARAM_PROB_HDR_FIELD (0)
120#define ICMPV6_ERROR_PARAM_PROB_NH (1)
122#define ICMPV6_ERROR_PARAM_PROB_OPT (2)
127
135typedef struct __attribute__((packed)) {
136 uint8_t type;
137 uint8_t code;
140
149typedef struct __attribute__((packed)) {
150 uint8_t type;
151 uint8_t code;
155
164typedef struct __attribute__((packed)) {
165 uint8_t type;
166 uint8_t code;
170
179typedef struct __attribute__((packed)) {
180 uint8_t type;
181 uint8_t code;
185
194typedef struct __attribute__((packed)) {
195 uint8_t type;
196 uint8_t code;
200
212typedef struct __attribute__((packed)) {
213 uint8_t type;
214 uint8_t code;
219
226
227#ifdef __cplusplus
228}
229#endif
230
Functions to work with different byte orders.
be_uint32_t network_uint32_t
A 32 bit integer in network byte order.
Definition byteorder.h:109
be_uint16_t network_uint16_t
A 16 bit integer in network byte order.
Definition byteorder.h:104
void icmpv6_hdr_print(icmpv6_hdr_t *hdr)
Print the given ICMPv6 header to STDOUT.
Echo request and response message format.
Definition icmpv6.h:212
uint8_t type
message type
Definition icmpv6.h:213
uint8_t code
message code
Definition icmpv6.h:214
network_uint16_t id
identifier
Definition icmpv6.h:216
network_uint16_t csum
checksum
Definition icmpv6.h:215
network_uint16_t seq
Sequence number.
Definition icmpv6.h:217
Destination unreachable message format.
Definition icmpv6.h:149
network_uint16_t csum
checksum
Definition icmpv6.h:152
uint8_t code
message code
Definition icmpv6.h:151
uint8_t type
message type
Definition icmpv6.h:150
network_uint32_t unused
unused field
Definition icmpv6.h:153
Parameter problem message format.
Definition icmpv6.h:194
uint8_t type
message type
Definition icmpv6.h:195
uint8_t code
message code
Definition icmpv6.h:196
network_uint32_t ptr
pointer
Definition icmpv6.h:198
network_uint16_t csum
checksum
Definition icmpv6.h:197
Packet too big message format.
Definition icmpv6.h:164
uint8_t code
message code
Definition icmpv6.h:166
uint8_t type
message type
Definition icmpv6.h:165
network_uint16_t csum
checksum
Definition icmpv6.h:167
network_uint32_t mtu
MTU.
Definition icmpv6.h:168
Time exceeded message format.
Definition icmpv6.h:179
network_uint32_t unused
unused field
Definition icmpv6.h:183
uint8_t type
message type
Definition icmpv6.h:180
uint8_t code
message code
Definition icmpv6.h:181
network_uint16_t csum
checksum
Definition icmpv6.h:182
General ICMPv6 message format.
Definition icmpv6.h:135
network_uint16_t csum
checksum
Definition icmpv6.h:138
uint8_t type
message type
Definition icmpv6.h:136
uint8_t code
message code
Definition icmpv6.h:137