Select one of the symbols to view example projects that use it.
 
Outline
...
...
...
#define NX_SOURCE_CODE
#include "nx_api.h"
#include "nx_ipv6.h"
#include "nx_icmpv6.h"
#include "nx_ipsec.h"
...
Files
loading (1/7)...
SourceVuSTM32 Libraries and Samplesnetxduocommon/src/nx_icmpv6_perform_DAD.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/**************************************************************************/ /* */ /* Copyright (c) Microsoft Corporation. All rights reserved. */ /* */ /* This software is licensed under the Microsoft Software License */ /* Terms for Microsoft Azure RTOS. Full text of the license can be */ /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ /* and in the root directory of this software. */ /* */... /**************************************************************************/ ... /**************************************************************************/ /**************************************************************************/ /** */ /** NetX Component */ /** */ /** Internet Control Message Protocol (ICMP) */ /** */... /**************************************************************************/ /**************************************************************************/ #define NX_SOURCE_CODE /* Include necessary system files. */ #include "nx_api.h" #include "nx_ipv6.h" #include "nx_icmpv6.h" #ifdef NX_IPSEC_ENABLE #include "nx_ipsec.h" #endif /* NX_IPSEC_ENABLE */ #ifdef FEATURE_NX_IPV6 /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _nx_icmpv6_perform_DAD PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function is called from IP thread periodic process routine. */ /* It starts the Duplicate Address Detection process if the interface */ /* address is in tentative state (not validated yet). It does nothing */ /* to an address if the state of the address is not tentative. */ /* */ /* INPUT */ /* */ /* ip_ptr Pointer to IP instance */ /* */ /* OUTPUT */ /* */ /* None */ /* */ /* CALLS */ /* */ /* _nx_icmpv6_DAD_clear_NDCache_entry Remove entry from cache table */ /* _nx_icmpv6_send_ns Send a Neighbor Solicitation */ /* message */ /* [ipv6_address_change_notify] User callback fucntion */ /* */ /* CALLED BY */ /* */ /* _nx_ip_thraed_entry */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ /* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ /* */... /**************************************************************************/ #ifndef NX_DISABLE_IPV6_DAD VOID _nx_icmpv6_perform_DAD(NX_IP *ip_ptr) { UINT i; NXD_IPV6_ADDRESS *nx_ipv6_address_next; #ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY UINT ipv6_addr_index; #endif /* NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY */ /* Go through all addresses bound to the IP instance. */ for (i = 0; i < NX_MAX_PHYSICAL_INTERFACES; i++) { /* Check if this interface valid. */ if (!ip_ptr -> nx_ip_interface[i].nxd_interface_ipv6_address_list_head) { continue; }if (!ip_ptr -> nx_ip_interface[i].nxd_interface_ipv6_address_list_head) { ... } /* Only interested in addresses in the tentative state. */ for (nx_ipv6_address_next = ip_ptr -> nx_ip_interface[i].nxd_interface_ipv6_address_list_head; nx_ipv6_address_next; nx_ipv6_address_next = nx_ipv6_address_next -> nxd_ipv6_address_next) { /* Check the address state. */ if (nx_ipv6_address_next -> nxd_ipv6_address_state == NX_IPV6_ADDR_STATE_TENTATIVE) { /* Check if the number of NS messages is used up. */ if (nx_ipv6_address_next -> nxd_ipv6_address_DupAddrDetectTransmit) { /* No. This interface is still under DAD. Transmit a NS */ _nx_icmpv6_send_ns(ip_ptr, nx_ipv6_address_next -> nxd_ipv6_address, 0, nx_ipv6_address_next, 0, NX_NULL); nx_ipv6_address_next -> nxd_ipv6_address_DupAddrDetectTransmit--; }if (nx_ipv6_address_next -> nxd_ipv6_address_DupAddrDetectTransmit) { ... } else { /* So far we didn't get any conflict addresses back. So promote the address to VALID *//* ... */ nx_ipv6_address_next -> nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_VALID; _nx_icmpv6_DAD_clear_NDCache_entry(ip_ptr, nx_ipv6_address_next -> nxd_ipv6_address); #ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY /* If the callback function is set, invoke the callback function . */ if (ip_ptr -> nx_ipv6_address_change_notify) { ipv6_addr_index = (ULONG)nx_ipv6_address_next -> nxd_ipv6_address_index; ip_ptr -> nx_ipv6_address_change_notify(ip_ptr, NX_IPV6_ADDRESS_DAD_SUCCESSFUL, i, ipv6_addr_index, &nx_ipv6_address_next -> nxd_ipv6_address[0]); }if (ip_ptr -> nx_ipv6_address_change_notify) { ... } /* ... */#endif /* NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY */ }else { ... } }if (nx_ipv6_address_next -> nxd_ipv6_address_state == NX_IPV6_ADDR_STATE_TENTATIVE) { ... } }for (nx_ipv6_address_next = ip_ptr -> nx_ip_interface[i].nxd_interface_ipv6_address_list_head; nx_ipv6_address_next; nx_ipv6_address_next = nx_ipv6_address_next -> nxd_ipv6_address_next) { ... } }for (i = 0; i < NX_MAX_PHYSICAL_INTERFACES; i++) { ... } }_nx_icmpv6_perform_DAD (NX_IP *ip_ptr) { ... } /* ... */ #endif /* NX_DISABLE_IPV6_DAD */ /* ... */ #endif /* FEATURE_NX_IPV6 */
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.