1
10
13
14
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
149
150
151
...
...
...
#define NX_SOURCE_CODE
#include "nx_api.h"
#include "nx_ipv6.h"
...
...
UINT _nxd_ipv6_multicast_interface_leave(NX_IP *ip_ptr, NXD_ADDRESS *group_address, UINT interface_index)
{
#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6)
UINT i;
NX_IP_DRIVER driver_request;
NX_INTERFACE *nx_interface;
tx_mutex_get(&(ip_ptr -> nx_ip_protection), TX_WAIT_FOREVER);
nx_interface = &ip_ptr -> nx_ip_interface[interface_index];
for (i = 0; i < NX_MAX_MULTICAST_GROUPS; i++)
{
if ((nx_interface == ip_ptr -> nx_ipv6_multicast_entry[i].nx_ip_mld_join_interface_list) && (CHECK_IPV6_ADDRESSES_SAME(ip_ptr -> nx_ipv6_multicast_entry[i].nx_ip_mld_join_list, group_address -> nxd_ip_address.v6)))
{
ip_ptr -> nx_ipv6_multicast_entry[i].nx_ip_mld_join_count--;
if (ip_ptr -> nx_ipv6_multicast_entry[i].nx_ip_mld_join_count == 0)
{
memset(ip_ptr -> nx_ipv6_multicast_entry[i].nx_ip_mld_join_list, 0, 4 * sizeof(ULONG));
ip_ptr -> nx_ipv6_multicast_groups_joined--;
driver_request.nx_ip_driver_ptr = ip_ptr;
driver_request.nx_ip_driver_command = NX_LINK_MULTICAST_LEAVE;
driver_request.nx_ip_driver_physical_address_msw = 0x00003333;
driver_request.nx_ip_driver_physical_address_lsw = group_address -> nxd_ip_address.v6[3];
driver_request.nx_ip_driver_interface = nx_interface;
(ip_ptr -> nx_ipv6_multicast_entry[i].nx_ip_mld_join_interface_list -> nx_interface_link_driver_entry)(&driver_request);
ip_ptr -> nx_ipv6_multicast_entry[i].nx_ip_mld_join_interface_list = NX_NULL;
}if (ip_ptr -> nx_ipv6_multicast_entry[i].nx_ip_mld_join_count == 0) { ... }
tx_mutex_put(&(ip_ptr -> nx_ip_protection));
return(NX_SUCCESS);
}if ((nx_interface == ip_ptr -> nx_ipv6_multicast_entry[i].nx_ip_mld_join_interface_list) && (CHECK_IPV6_ADDRESSES_SAME(ip_ptr -> nx_ipv6_multicast_entry[i].nx_ip_mld_join_list, group_address -> nxd_ip_address.v6))) { ... }
}for (i = 0; i < NX_MAX_MULTICAST_GROUPS; i++) { ... }
tx_mutex_put(&(ip_ptr -> nx_ip_protection));
return(NX_ENTRY_NOT_FOUND);
/* ... */
#else
NX_PARAMETER_NOT_USED(ip_ptr);
NX_PARAMETER_NOT_USED(group_address);
NX_PARAMETER_NOT_USED(interface_index);
return(NX_NOT_SUPPORTED);
/* ... */
#endif
}{ ... }