1
10
13
14
20
21
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
82
83
84
86
87
88
89
95
96
100
101
102
103
104
105
106
110
111
112
113
114
115
116
120
121
122
123
124
125
126
127
128
129
130
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
275
276
277
278
279
280
281
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
335
336
337
340
341
343
344
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
372
373
374
375
376
377
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
...
...
...
...
...
#ifndef NX_ICMPV6_H
#define NX_ICMPV6_H
#include "nx_nd_cache.h"
#ifdef FEATURE_NX_IPV6
#define NX_ICMPV6_DEST_UNREACHABLE_TYPE 1
#define NX_ICMPV6_PACKET_TOO_BIG_TYPE 2
#define NX_ICMPV6_TIME_EXCEED_TYPE 3
#define NX_ICMPV6_PARAMETER_PROBLEM_TYPE 4
#define NX_ICMPV6_ECHO_REPLY_TYPE 129
#define NX_ICMPV6_ECHO_REQUEST_TYPE 128
#define NX_ICMPV6_ROUTER_SOLICITATION_TYPE 133
#define NX_ICMPV6_ROUTER_ADVERTISEMENT_TYPE 134
#define NX_ICMPV6_NEIGHBOR_SOLICITATION_TYPE 135
#define NX_ICMPV6_NEIGHBOR_ADVERTISEMENT_TYPE 136
#define NX_ICMPV6_REDIRECT_MESSAGE_TYPE 137
#define ICMPV6_OPTION_TYPE_SRC_LINK_ADDR 1
#define ICMPV6_OPTION_TYPE_TRG_LINK_ADDR 2
#define ICMPV6_OPTION_TYPE_PREFIX_INFO 3
/* ... */
#define ICMPV6_OPTION_TYPE_MTU 5
/* ... */
#define NX_NO_SLLA 1
/* ... */
#define NX_ICMPV6_DEST_UNREACHABLE_CODE 4
17 defines
/* ... */
#ifndef NX_DISABLE_ICMPV6_ROUTER_SOLICITATION
/* ... */
#ifdef NXDUO_ICMPV6_MAX_RTR_SOLICITATIONS
#define NX_ICMPV6_MAX_RTR_SOLICITATIONS NXDUO_ICMPV6_MAX_RTR_SOLICITATIONS
#endif
#ifndef NX_ICMPV6_MAX_RTR_SOLICITATIONS
#define NX_ICMPV6_MAX_RTR_SOLICITATIONS 3
#ifndef NXDUO_ICMPV6_MAX_RTR_SOLICITATIONS
#define NXDUO_ICMPV6_MAX_RTR_SOLICITATIONS NX_ICMPV6_MAX_RTR_SOLICITATIONS
#endif /* ... */
#endif
#ifdef NXDUO_ICMPV6_RTR_SOLICITATION_INTERVAL
#define NX_ICMPV6_RTR_SOLICITATION_INTERVAL NXDUO_ICMPV6_RTR_SOLICITATION_INTERVAL
#endif
#ifndef NX_ICMPV6_RTR_SOLICITATION_INTERVAL
#define NX_ICMPV6_RTR_SOLICITATION_INTERVAL 4
#ifndef NXDUO_ICMPV6_RTR_SOLICITATION_INTERVAL
#define NXDUO_ICMPV6_RTR_SOLICITATION_INTERVAL NX_ICMPV6_RTR_SOLICITATION_INTERVAL
#endif /* ... */
#endif
#ifndef NX_ICMPV6_RTR_SOLICITATION_DELAY
#define NX_ICMPV6_RTR_SOLICITATION_DELAY 1
#endif
/* ... */
#endif
#define NX_MINIMUM_IPV6_PATH_MTU 1280
typedef struct NX_ICMPV6_HEADER_STRUCT
{
UCHAR nx_icmpv6_header_type;
UCHAR nx_icmpv6_header_code;
USHORT nx_icmpv6_header_checksum;
...} NX_ICMPV6_HEADER;
typedef struct NX_ICMPV6_ERROR_STRUCT
{
NX_ICMPV6_HEADER nx_icmpv6_error_header;
ULONG nx_icmpv6_error_pointer;
...} NX_ICMPV6_ERROR;
typedef struct NX_ICMPV6_ECHO_STRUCT
{
NX_ICMPV6_HEADER nx_icmpv6_echo_header;
USHORT nx_icmpv6_echo_identifier;
USHORT nx_icmpv6_echo_sequence_num;
...} NX_ICMPV6_ECHO;
typedef struct NX_ICMPV6_ND_STRUCT
{
NX_ICMPV6_HEADER nx_icmpv6_nd_header;
ULONG nx_icmpv6_nd_flag;
ULONG nx_icmpv6_nd_targetAddress[4];
...} NX_ICMPV6_ND;
typedef struct NX_ICMPV6_OPTION_STRUCT
{
UCHAR nx_icmpv6_option_type;
UCHAR nx_icmpv6_option_length;
USHORT nx_icmpv6_option_data;
...} NX_ICMPV6_OPTION;
typedef struct NX_ICMPV6_OPTION_PREFIX_STRUCT
{
UCHAR nx_icmpv6_option_prefix_type;
UCHAR nx_icmpv6_option_prefix_optionlength;
UCHAR nx_icmpv6_option_prefix_length;
UCHAR nx_icmpv6_option_prefix_flag;
ULONG nx_icmpv6_option_prefix_valid_lifetime;
ULONG nx_icmpv6_option_prefix_preferred_lifetime;
ULONG nx_icmpv6_option_prefix_reserved;
ULONG nx_icmpv6_option_prefix[4];
...} NX_ICMPV6_OPTION_PREFIX;
typedef struct NX_ICMPV6_OPTION_MTU_STRUCT
{
UCHAR nx_icmpv6_option_mtu_type;
UCHAR nx_icmpv6_option_mtu_length;
USHORT nx_icmpv6_option_mtu_reserved;
ULONG nx_icmpv6_option_mtu_path_mtu;
/* ... */
UCHAR *nx_icmpv6_option_mtu_message;
...} NX_ICMPV6_OPTION_MTU;
typedef struct NX_ICMPV6_RS_STRUCT
{
NX_ICMPV6_HEADER nx_icmpv6_rs_icmpv6_header;
ULONG nx_icmpv6_rs_reserved;
...} NX_ICMPV6_RS;
typedef struct NX_ICMPV6_RA_STRUCT
{
NX_ICMPV6_HEADER nx_icmpv6_ra_icmpv6_header;
UCHAR nx_icmpv6_ra_hop_limit;
UCHAR nx_icmpv6_ra_flag;
USHORT nx_icmpv6_ra_router_lifetime;
ULONG nx_icmpv6_ra_reachable_time;
ULONG nx_icmpv6_ra_retrans_time;
...} NX_ICMPV6_RA;
typedef struct NX_ICMPV6_REDIRECT_MESSAGE_STRUCT
{
NX_ICMPV6_HEADER nx_icmpv6_redirect_icmpv6_header;
ULONG nx_icmpv6_redirect_reserved;
ULONG nx_icmpv6_redirect_target_address[4];
ULONG nx_icmpv6_redirect_destination_address[4];
...} NX_ICMPV6_REDIRECT_MESSAGE;
#ifndef NX_DISABLE_ICMPV6_ERROR_MESSAGE
#define NX_ICMPV6_SEND_DEST_UNREACHABLE(ip_ptr, packet, code) \
_nx_icmpv6_send_error_message((ip_ptr), (packet), (ULONG)((NX_ICMPV6_DEST_UNREACHABLE_TYPE << 24) | ((code) << 16)), 0)...
#if 0
#define NX_ICMPV6_SEND_PACKET_TOO_BIG(ip_ptr, packet, code) \
_nx_icmpv6_send_error_message((ip_ptr), (packet), ((NX_ICMPV6_PACKET_TOO_BIG_TYPE << 24) | ((code) << 16)), 0)...
/* ... */#endif
#define NX_ICMPV6_SEND_TIME_EXCEED(ip_ptr, packet, code) \
_nx_icmpv6_send_error_message((ip_ptr), (packet), (ULONG)((NX_ICMPV6_TIME_EXCEED_TYPE << 24) | ((code) << 16)), 0)...
#define NX_ICMPV6_SEND_PARAMETER_PROBLEM(ip_ptr, packet, code, offset) \
_nx_icmpv6_send_error_message((ip_ptr), (packet), (ULONG)((NX_ICMPV6_PARAMETER_PROBLEM_TYPE << 24) | ((code) << 16)), (offset))...
/* ... */
#endif
UINT _nx_icmp_ping6(NX_IP *ip_ptr, NXD_ADDRESS *ip_address,
CHAR *data_ptr, ULONG data_size,
NX_PACKET **response_ptr, ULONG wait_option);
UINT _nx_icmp_interface_ping6(NX_IP *ip_ptr, NXD_ADDRESS *ip_address,
CHAR *data_ptr, ULONG data_size, NXD_IPV6_ADDRESS *ipv6_address,
NX_PACKET **response_ptr, ULONG wait_option);
VOID _nx_icmpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr);
#ifndef NX_DISABLE_IPV6_DAD
VOID _nx_icmpv6_perform_DAD(NX_IP *);
#endif
#ifdef NX_ENABLE_IPV6_PATH_MTU_DISCOVERY
UINT _nx_icmpv6_process_packet_too_big(NX_IP *ip_ptr, NX_PACKET *packet_ptr);
VOID _nx_icmpv6_destination_table_periodic_update(NX_IP *ip_ptr);/* ... */
#endif
#ifndef NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS
VOID _nx_icmpv6_process_ra(NX_IP *ip_ptr, NX_PACKET *packet_ptr);
UINT _nx_icmpv6_validate_ra(NX_PACKET *packet_ptr);/* ... */
#endif
#ifndef NX_DISABLE_ICMPV6_REDIRECT_PROCESS
VOID _nx_icmpv6_process_redirect(NX_IP *ip_ptr, NX_PACKET *packet_ptr);
#endif
#ifndef NX_DISABLE_ICMPV6_ERROR_MESSAGE
VOID _nx_icmpv6_send_error_message(NX_IP *ip_ptr, NX_PACKET *packet, ULONG word1, ULONG pointer);
#endif
#ifndef NX_DISABLE_ICMPV6_ROUTER_SOLICITATION
UINT _nx_icmpv6_send_rs(NX_IP *ip_ptr, UINT if_index);
#endif
VOID _nx_icmpv6_send_queued_packets(NX_IP *ip_ptr, ND_CACHE_ENTRY *nd_entry);
UINT _nx_icmpv6_validate_options(NX_ICMPV6_OPTION *option, INT length, INT additional_check);
UINT _nxd_ipv6_destination_table_find_next_hop(NX_IP *ip_ptr, ULONG *destination_ip, ULONG *next_hop);
UINT _nx_icmpv6_dest_table_find(NX_IP *ip_ptr, ULONG *destination_address, NX_IPV6_DESTINATION_ENTRY **dest_entry_ptr,
ULONG path_mtu, ULONG mtu_timeout);
UINT _nx_icmpv6_dest_table_add(NX_IP *ip_ptr, ULONG *destination_address,
NX_IPV6_DESTINATION_ENTRY **dest_entry_ptr, ULONG *next_hop,
ULONG path_mtu, ULONG mtu_timeout, NXD_IPV6_ADDRESS *ipv6_address);
VOID _nx_icmpv6_process_echo_reply(NX_IP *ip_ptr, NX_PACKET *packet_ptr);
VOID _nx_icmpv6_process_echo_request(NX_IP *ip_ptr, NX_PACKET *packet_ptr);
VOID _nx_icmpv6_process_ns(NX_IP *ip_ptr, NX_PACKET *packet_ptr);
VOID _nx_icmpv6_process_na(NX_IP *ip_ptr, NX_PACKET *packet_ptr);
VOID _nx_icmpv6_DAD_clear_NDCache_entry(NX_IP *ip_ptr, ULONG *ip_addr);
UINT _nx_icmpv6_validate_neighbor_message(NX_PACKET *packet_ptr);
VOID _nx_icmpv6_DAD_failure(NX_IP *ip_ptr, NXD_IPV6_ADDRESS *ipv6_address);
VOID _nx_icmpv6_send_ns(NX_IP *ip_ptr, ULONG *neighbor_IP_address, INT send_slla, NXD_IPV6_ADDRESS *outgoing_address,
INT sendUnicast, ND_CACHE_ENTRY *NDCacheEntry);/* ... */
#endif
UINT _nxd_icmpv6_ra_flag_callback_set(NX_IP *ip_ptr, VOID (*icmpv6_ra_flag_callback)(NX_IP *ip_ptr, UINT ra_flag));
UINT _nxde_icmpv6_ra_flag_callback_set(NX_IP *ip_ptr, VOID (*icmpv6_ra_flag_callback)(NX_IP *ip_ptr, UINT ra_flag));
/* ... */
#endif...