@@ -60,6 +60,13 @@ class Child : public CslNeighbor
6060 */
6161 static constexpr uint16_t kNumIp6Addresses = OPENTHREAD_CONFIG_MLE_IP_ADDRS_PER_CHILD - 1 ;
6262
63+ /* *
64+ * Represents an array of IPv6 addresses registered by an MTD child.
65+ *
66+ * This array does not include the mesh-local EID.
67+ */
68+ typedef Array<Ip6::Address, kNumIp6Addresses > Ip6AddressArray;
69+
6370 /* *
6471 * Represents the iterator for registered IPv6 address list of an MTD child.
6572 */
@@ -84,50 +91,6 @@ class Child : public CslNeighbor
8491 void SetFrom (const Child &aChild);
8592 };
8693
87- /* *
88- * Represents an IPv6 address entry registered by an MTD child.
89- */
90- class Ip6AddrEntry : public Ip6 ::Address
91- {
92- public:
93- /* *
94- * Indicates whether the entry matches a given IPv6 address.
95- *
96- * @param[in] aAddress The IPv6 address.
97- *
98- * @retval TRUE The entry matches @p aAddress.
99- * @retval FALSE The entry does not match @p aAddress.
100- */
101- bool Matches (const Ip6::Address &aAddress) const { return (*this == aAddress); }
102-
103- #if OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE
104- /* *
105- * Indicates whether the IPv6 address is registered via Multicast Listener Registration (MLR) on a given child.
106- *
107- * @param[in] aChild The child associated with the address.
108- *
109- * @retval TRUE If the address is MLR registered on @p aChild.
110- * @retval FALSE If the address is not MLR registered on @p aChild.
111- */
112- bool IsMlrRegistered (const Child &aChild) const ;
113-
114- /* *
115- * Sets whether the IPv6 address is registered via Multicast Listener Registration (MLR) on a given child.
116- *
117- * @param[in] aRegistered TRUE if MLR registered, FALSE otherwise.
118- * @param[in] aChild The child associated with the address.
119- */
120- void SetMlrRegistered (bool aRegistered, Child &aChild);
121- #endif
122- };
123-
124- /* *
125- * Represents an array of IPv6 address entries registered by an MTD child.
126- *
127- * This array does not include the mesh-local EID.
128- */
129- typedef Array<Ip6AddrEntry, kNumIp6Addresses > Ip6AddressArray;
130-
13194 /* *
13295 * Initializes the `Child` object.
13396 *
@@ -178,15 +141,6 @@ class Child : public CslNeighbor
178141 */
179142 const Ip6AddressArray &GetIp6Addresses (void ) const { return mIp6Addresses ; }
180143
181- /* *
182- * Gets an array of registered IPv6 address entries by the child.
183- *
184- * The array does not include the mesh-local EID. The ML-EID can retrieved using `GetMeshLocalIp6Address()`.
185- *
186- * @returns The array of registered IPv6 addresses by the child.
187- */
188- Ip6AddressArray &GetIp6Addresses (void ) { return mIp6Addresses ; }
189-
190144 /* *
191145 * Iterates over all registered IPv6 addresses (using an iterator).
192146 *
@@ -202,7 +156,7 @@ class Child : public CslNeighbor
202156 /* *
203157 * Adds an IPv6 address to the list.
204158 *
205- * @param[in] aAddress A reference to IPv6 address to be added.
159+ * @param[in] aAddress The IPv6 address to be added.
206160 *
207161 * @retval kErrorNone Successfully added the new address.
208162 * @retval kErrorAlready Address is already in the list.
@@ -214,7 +168,7 @@ class Child : public CslNeighbor
214168 /* *
215169 * Removes an IPv6 address from the list.
216170 *
217- * @param[in] aAddress A reference to IPv6 address to be removed.
171+ * @param[in] aAddress The IPv6 address to be removed.
218172 *
219173 * @retval kErrorNone Successfully removed the address.
220174 * @retval kErrorNotFound Address was not found in the list.
@@ -225,7 +179,7 @@ class Child : public CslNeighbor
225179 /* *
226180 * Indicates whether an IPv6 address is in the list of IPv6 addresses of the child.
227181 *
228- * @param[in] aAddress A reference to IPv6 address.
182+ * @param[in] aAddress The IPv6 address to check .
229183 *
230184 * @retval TRUE The address exists on the list.
231185 * @retval FALSE Address was not found in the list.
@@ -353,10 +307,11 @@ class Child : public CslNeighbor
353307 void SetBlockParentDowngrade (bool aBlock) { mBlockParentDowngrade = aBlock; }
354308
355309#if OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE
310+
356311 /* *
357- * Clears the Multicast Listener Registration (MLR) registered state on all IPv6 addresses of the child.
312+ * Clears the Multicast Listener Registration (MLR) registration state of all IPv6 addresses of the child.
358313 */
359- void ClearMlrRegisteredStateOnAllIp6Addresses (void ) { mMlrRegisteredSet .Clear (); }
314+ void ClearAllAddressesMlrRegistrationState (void ) { mMlrRegisteredSet .Clear (); }
360315
361316 /* *
362317 * Indicates whether the child has a given IPv6 address that is MLR registered.
@@ -369,12 +324,22 @@ class Child : public CslNeighbor
369324 bool HasMlrRegisteredAddress (const Ip6::Address &aAddress) const ;
370325
371326 /* *
372- * Indicates whether the child has any IPv6 address that is MLR registered.
327+ * Sets the MLR registered state of a given IPv6 address of the child.
328+ *
329+ * If @p aAddress is not present on the list, calling this method does nothing.
373330 *
374- * @retval TRUE If the child has any MLR registered IPv6 address.
375- * @retval FALSE If the child does not have any MLR registered IPv6 address .
331+ * @param[in] aAddress The address.
332+ * @param[in] aRegistered TRUE if MLR registered, FALSE otherwise .
376333 */
377- bool HasAnyMlrRegisteredAddress (void ) const { return !mMlrRegisteredSet .IsEmpty (); }
334+ void SetAddressMlrRegistrationState (const Ip6::Address &aAddress, bool aRegistered);
335+
336+ /* *
337+ * Gets all the MLR registered IPv6 addresses of the child.
338+ *
339+ * @param[out] aAddressArray A reference to an array to output the addresses.
340+ */
341+ void GetAllMlrRegisteredAddresses (Ip6AddressArray &aAddressArray) const ;
342+
378343#endif // OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE
379344
380345private:
0 commit comments