sdk-core
v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Toggle main menu visibility
Loading...
Searching...
No Matches
nd6.h
Go to the documentation of this file.
1
6
7
/*
8
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
9
* All rights reserved.
10
*
11
* Redistribution and use in source and binary forms, with or without modification,
12
* are permitted provided that the following conditions are met:
13
*
14
* 1. Redistributions of source code must retain the above copyright notice,
15
* this list of conditions and the following disclaimer.
16
* 2. Redistributions in binary form must reproduce the above copyright notice,
17
* this list of conditions and the following disclaimer in the documentation
18
* and/or other materials provided with the distribution.
19
* 3. The name of the author may not be used to endorse or promote products
20
* derived from this software without specific prior written permission.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
23
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
31
* OF SUCH DAMAGE.
32
*
33
* This file is part of the lwIP TCP/IP stack.
34
*
35
* Author: Adam Dunkels <adam@sics.se>
36
*
37
*/
38
#ifndef LWIP_HDR_PROT_ND6_H
39
#define LWIP_HDR_PROT_ND6_H
40
41
#include "
lwip/arch.h
"
42
#include "
lwip/ip6_addr.h
"
43
#include "
lwip/prot/ip6.h
"
44
45
#ifdef __cplusplus
46
extern
"C"
{
47
#endif
48
50
#ifdef PACK_STRUCT_USE_INCLUDES
51
# include "arch/bpstruct.h"
52
#endif
53
PACK_STRUCT_BEGIN
54
struct
ns_header
{
55
PACK_STRUCT_FLD_8(u8_t type);
56
PACK_STRUCT_FLD_8(u8_t code);
57
PACK_STRUCT_FIELD(u16_t chksum);
58
PACK_STRUCT_FIELD(u32_t reserved);
59
PACK_STRUCT_FLD_S(ip6_addr_p_t target_address);
60
/* Options follow. */
61
} PACK_STRUCT_STRUCT;
62
PACK_STRUCT_END
63
#ifdef PACK_STRUCT_USE_INCLUDES
64
# include "arch/epstruct.h"
65
#endif
66
68
#ifdef PACK_STRUCT_USE_INCLUDES
69
# include "arch/bpstruct.h"
70
#endif
71
PACK_STRUCT_BEGIN
72
struct
na_header
{
73
PACK_STRUCT_FLD_8(u8_t type);
74
PACK_STRUCT_FLD_8(u8_t code);
75
PACK_STRUCT_FIELD(u16_t chksum);
76
PACK_STRUCT_FLD_8(u8_t flags);
77
PACK_STRUCT_FLD_8(u8_t reserved[3]);
78
PACK_STRUCT_FLD_S(ip6_addr_p_t target_address);
79
/* Options follow. */
80
} PACK_STRUCT_STRUCT;
81
PACK_STRUCT_END
82
#ifdef PACK_STRUCT_USE_INCLUDES
83
# include "arch/epstruct.h"
84
#endif
85
#define ND6_FLAG_ROUTER (0x80)
86
#define ND6_FLAG_SOLICITED (0x40)
87
#define ND6_FLAG_OVERRIDE (0x20)
88
90
#ifdef PACK_STRUCT_USE_INCLUDES
91
# include "arch/bpstruct.h"
92
#endif
93
PACK_STRUCT_BEGIN
94
struct
rs_header
{
95
PACK_STRUCT_FLD_8(u8_t type);
96
PACK_STRUCT_FLD_8(u8_t code);
97
PACK_STRUCT_FIELD(u16_t chksum);
98
PACK_STRUCT_FIELD(u32_t reserved);
99
/* Options follow. */
100
} PACK_STRUCT_STRUCT;
101
PACK_STRUCT_END
102
#ifdef PACK_STRUCT_USE_INCLUDES
103
# include "arch/epstruct.h"
104
#endif
105
107
#define ND6_RA_FLAG_MANAGED_ADDR_CONFIG (0x80)
108
#define ND6_RA_FLAG_OTHER_CONFIG (0x40)
109
#define ND6_RA_FLAG_HOME_AGENT (0x20)
110
#define ND6_RA_PREFERENCE_MASK (0x18)
111
#define ND6_RA_PREFERENCE_HIGH (0x08)
112
#define ND6_RA_PREFERENCE_MEDIUM (0x00)
113
#define ND6_RA_PREFERENCE_LOW (0x18)
114
#define ND6_RA_PREFERENCE_DISABLED (0x10)
115
#ifdef PACK_STRUCT_USE_INCLUDES
116
# include "arch/bpstruct.h"
117
#endif
118
PACK_STRUCT_BEGIN
119
struct
ra_header
{
120
PACK_STRUCT_FLD_8(u8_t type);
121
PACK_STRUCT_FLD_8(u8_t code);
122
PACK_STRUCT_FIELD(u16_t chksum);
123
PACK_STRUCT_FLD_8(u8_t current_hop_limit);
124
PACK_STRUCT_FLD_8(u8_t flags);
125
PACK_STRUCT_FIELD(u16_t router_lifetime);
126
PACK_STRUCT_FIELD(u32_t reachable_time);
127
PACK_STRUCT_FIELD(u32_t retrans_timer);
128
/* Options follow. */
129
} PACK_STRUCT_STRUCT;
130
PACK_STRUCT_END
131
#ifdef PACK_STRUCT_USE_INCLUDES
132
# include "arch/epstruct.h"
133
#endif
134
136
#ifdef PACK_STRUCT_USE_INCLUDES
137
# include "arch/bpstruct.h"
138
#endif
139
PACK_STRUCT_BEGIN
140
struct
redirect_header
{
141
PACK_STRUCT_FLD_8(u8_t type);
142
PACK_STRUCT_FLD_8(u8_t code);
143
PACK_STRUCT_FIELD(u16_t chksum);
144
PACK_STRUCT_FIELD(u32_t reserved);
145
PACK_STRUCT_FLD_S(ip6_addr_p_t target_address);
146
PACK_STRUCT_FLD_S(ip6_addr_p_t destination_address);
147
/* Options follow. */
148
} PACK_STRUCT_STRUCT;
149
PACK_STRUCT_END
150
#ifdef PACK_STRUCT_USE_INCLUDES
151
# include "arch/epstruct.h"
152
#endif
153
155
#define ND6_OPTION_TYPE_SOURCE_LLADDR (0x01)
156
#define ND6_OPTION_TYPE_TARGET_LLADDR (0x02)
157
#define ND6_LLADDR_OPTION_MIN_LENGTH (2)
158
#ifdef PACK_STRUCT_USE_INCLUDES
159
# include "arch/bpstruct.h"
160
#endif
161
PACK_STRUCT_BEGIN
162
struct
lladdr_option
{
163
PACK_STRUCT_FLD_8(u8_t type);
164
PACK_STRUCT_FLD_8(u8_t length);
165
PACK_STRUCT_FLD_8(u8_t addr[
NETIF_MAX_HWADDR_LEN
]);
166
} PACK_STRUCT_STRUCT;
167
PACK_STRUCT_END
168
#ifdef PACK_STRUCT_USE_INCLUDES
169
# include "arch/epstruct.h"
170
#endif
171
173
#define ND6_OPTION_TYPE_PREFIX_INFO (0x03)
174
#define ND6_PREFIX_FLAG_ON_LINK (0x80)
175
#define ND6_PREFIX_FLAG_AUTONOMOUS (0x40)
176
#define ND6_PREFIX_FLAG_ROUTER_ADDRESS (0x20)
177
#define ND6_PREFIX_FLAG_SITE_PREFIX (0x10)
178
#ifdef PACK_STRUCT_USE_INCLUDES
179
# include "arch/bpstruct.h"
180
#endif
181
PACK_STRUCT_BEGIN
182
struct
prefix_option
{
183
PACK_STRUCT_FLD_8(u8_t type);
184
PACK_STRUCT_FLD_8(u8_t length);
185
PACK_STRUCT_FLD_8(u8_t prefix_length);
186
PACK_STRUCT_FLD_8(u8_t flags);
187
PACK_STRUCT_FIELD(u32_t valid_lifetime);
188
PACK_STRUCT_FIELD(u32_t preferred_lifetime);
189
PACK_STRUCT_FLD_8(u8_t reserved2[3]);
190
PACK_STRUCT_FLD_8(u8_t site_prefix_length);
191
PACK_STRUCT_FLD_S(ip6_addr_p_t prefix);
192
} PACK_STRUCT_STRUCT;
193
PACK_STRUCT_END
194
#ifdef PACK_STRUCT_USE_INCLUDES
195
# include "arch/epstruct.h"
196
#endif
197
199
#define ND6_OPTION_TYPE_REDIR_HDR (0x04)
200
#ifdef PACK_STRUCT_USE_INCLUDES
201
# include "arch/bpstruct.h"
202
#endif
203
PACK_STRUCT_BEGIN
204
struct
redirected_header_option
{
205
PACK_STRUCT_FLD_8(u8_t type);
206
PACK_STRUCT_FLD_8(u8_t length);
207
PACK_STRUCT_FLD_8(u8_t reserved[6]);
208
/* Portion of redirected packet follows. */
209
/* PACK_STRUCT_FLD_8(u8_t redirected[8]); */
210
} PACK_STRUCT_STRUCT;
211
PACK_STRUCT_END
212
#ifdef PACK_STRUCT_USE_INCLUDES
213
# include "arch/epstruct.h"
214
#endif
215
217
#define ND6_OPTION_TYPE_MTU (0x05)
218
#ifdef PACK_STRUCT_USE_INCLUDES
219
# include "arch/bpstruct.h"
220
#endif
221
PACK_STRUCT_BEGIN
222
struct
mtu_option
{
223
PACK_STRUCT_FLD_8(u8_t type);
224
PACK_STRUCT_FLD_8(u8_t length);
225
PACK_STRUCT_FIELD(u16_t reserved);
226
PACK_STRUCT_FIELD(u32_t mtu);
227
} PACK_STRUCT_STRUCT;
228
PACK_STRUCT_END
229
#ifdef PACK_STRUCT_USE_INCLUDES
230
# include "arch/epstruct.h"
231
#endif
232
234
#define ND6_OPTION_TYPE_ROUTE_INFO (24)
235
#ifdef PACK_STRUCT_USE_INCLUDES
236
# include "arch/bpstruct.h"
237
#endif
238
PACK_STRUCT_BEGIN
239
struct
route_option
{
240
PACK_STRUCT_FLD_8(u8_t type);
241
PACK_STRUCT_FLD_8(u8_t length);
242
PACK_STRUCT_FLD_8(u8_t prefix_length);
243
PACK_STRUCT_FLD_8(u8_t preference);
244
PACK_STRUCT_FIELD(u32_t route_lifetime);
245
PACK_STRUCT_FLD_S(ip6_addr_p_t prefix);
246
} PACK_STRUCT_STRUCT;
247
PACK_STRUCT_END
248
#ifdef PACK_STRUCT_USE_INCLUDES
249
# include "arch/epstruct.h"
250
#endif
251
253
#define ND6_OPTION_TYPE_RDNSS (25)
254
#ifdef PACK_STRUCT_USE_INCLUDES
255
# include "arch/bpstruct.h"
256
#endif
257
PACK_STRUCT_BEGIN
258
struct
rdnss_option
{
259
PACK_STRUCT_FLD_8(u8_t type);
260
PACK_STRUCT_FLD_8(u8_t length);
261
PACK_STRUCT_FIELD(u16_t reserved);
262
PACK_STRUCT_FIELD(u32_t lifetime);
263
PACK_STRUCT_FLD_S(ip6_addr_p_t rdnss_address[1]);
264
} PACK_STRUCT_STRUCT;
265
PACK_STRUCT_END
266
#ifdef PACK_STRUCT_USE_INCLUDES
267
# include "arch/epstruct.h"
268
#endif
269
270
#define SIZEOF_RDNSS_OPTION_BASE 8
/* size without addresses */
271
272
#ifdef __cplusplus
273
}
274
#endif
275
276
#endif
/* LWIP_HDR_PROT_ND6_H */
arch.h
NETIF_MAX_HWADDR_LEN
#define NETIF_MAX_HWADDR_LEN
Definition
tcpip.h:1109
ip6_addr.h
ip6.h
lladdr_option
Definition
nd6.h:162
mtu_option
Definition
nd6.h:222
na_header
Definition
nd6.h:72
ns_header
Definition
nd6.h:54
prefix_option
Definition
nd6.h:182
ra_header
Definition
nd6.h:119
rdnss_option
Definition
nd6.h:258
redirect_header
Definition
nd6.h:140
redirected_header_option
Definition
nd6.h:204
route_option
Definition
nd6.h:239
rs_header
Definition
nd6.h:94
core
ps2ip
include
lwip_include
lwip
prot
nd6.h
Generated by
1.18.0