@@ -88,24 +88,47 @@ typedef struct otBorderRoutingPrefixTableIterator
8888 uint32_t mData32 ;
8989} otBorderRoutingPrefixTableIterator ;
9090
91+ /**
92+ * Represents a discovered router on the infrastructure link.
93+ *
94+ */
95+ typedef struct otBorderRoutingRouterEntry
96+ {
97+ otIp6Address mAddress ; ///< IPv6 address of the router.
98+ bool mManagedAddressConfigFlag : 1 ; ///< The router's Managed Address Config flag (`M` flag).
99+ bool mOtherConfigFlag : 1 ; ///< The router's Other Config flag (`O` flag).
100+ bool mStubRouterFlag : 1 ; ///< The router's Stub Router flag.
101+ } otBorderRoutingRouterEntry ;
102+
91103/**
92104 * Represents an entry from the discovered prefix table.
93105 *
94106 * The entries in the discovered table track the Prefix/Route Info Options in the received Router Advertisement messages
95- * from other routers on infrastructure link.
107+ * from other routers on the infrastructure link.
96108 *
97109 */
98110typedef struct otBorderRoutingPrefixTableEntry
99111{
100- otIp6Address mRouterAddress ; ///< IPv6 address of the router.
101- otIp6Prefix mPrefix ; ///< The discovered IPv6 prefix.
102- bool mIsOnLink ; ///< Indicates whether the prefix is on-link or route prefix.
103- uint32_t mMsecSinceLastUpdate ; ///< Milliseconds since last update of this prefix.
104- uint32_t mValidLifetime ; ///< Valid lifetime of the prefix (in seconds).
105- otRoutePreference mRoutePreference ; ///< Route preference when `mIsOnlink` is false.
106- uint32_t mPreferredLifetime ; ///< Preferred lifetime of the on-link prefix when `mIsOnLink` is true .
112+ otBorderRoutingRouterEntry mRouter ; ///< Information about the router advertising this prefix .
113+ otIp6Prefix mPrefix ; ///< The discovered IPv6 prefix.
114+ bool mIsOnLink ; ///< Indicates whether the prefix is on-link or route prefix.
115+ uint32_t mMsecSinceLastUpdate ; ///< Milliseconds since last update of this prefix.
116+ uint32_t mValidLifetime ; ///< Valid lifetime of the prefix (in seconds).
117+ otRoutePreference mRoutePreference ; ///< Route preference when `mIsOnlink` is false.
118+ uint32_t mPreferredLifetime ; ///< Preferred lifetime of the on-link prefix when `mIsOnLink`.
107119} otBorderRoutingPrefixTableEntry ;
108120
121+ /**
122+ * Represents a group of data of platform-generated RA messages processed.
123+ *
124+ */
125+ typedef struct otPdProcessedRaInfo
126+ {
127+ uint32_t mNumPlatformRaReceived ; ///< The number of platform generated RA handled by ProcessPlatformGeneratedRa.
128+ uint32_t mNumPlatformPioProcessed ; ///< The number of PIO processed for adding OMR prefixes.
129+ uint32_t mLastPlatformRaMsec ; ///< The timestamp of last processed RA message.
130+ } otPdProcessedRaInfo ;
131+
109132/**
110133 * Represents the state of Border Routing Manager.
111134 *
@@ -295,6 +318,21 @@ otError otBorderRoutingGetOmrPrefix(otInstance *aInstance, otIp6Prefix *aPrefix)
295318 */
296319otError otBorderRoutingGetPdOmrPrefix (otInstance * aInstance , otBorderRoutingPrefixTableEntry * aPrefixInfo );
297320
321+ /**
322+ * Gets the data of platform generated RA message processed..
323+ *
324+ * `OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE` must be enabled.
325+ *
326+ * @param[in] aInstance A pointer to an OpenThread instance.
327+ * @param[out] aPrefixInfo A pointer to where the prefix info will be output to.
328+ *
329+ * @retval OT_ERROR_NONE Successfully retrieved the Info.
330+ * @retval OT_ERROR_INVALID_STATE The Border Routing Manager is not initialized yet.
331+ * @retval OT_ERROR_NOT_FOUND There are no valid Info on this BR.
332+ *
333+ */
334+ otError otBorderRoutingGetPdProcessedRaInfo (otInstance * aInstance , otPdProcessedRaInfo * aPdProcessedRaInfo );
335+
298336/**
299337 * Gets the currently favored Off-Mesh-Routable (OMR) Prefix.
300338 *
@@ -391,6 +429,9 @@ void otBorderRoutingPrefixTableInitIterator(otInstance *aInstance, otBorderRouti
391429/**
392430 * Iterates over the entries in the Border Router's discovered prefix table.
393431 *
432+ * Prefix entries associated with the same discovered router on an infrastructure link are guaranteed to be grouped
433+ * together (retrieved back-to-back).
434+ *
394435 * @param[in] aInstance The OpenThread instance.
395436 * @param[in,out] aIterator A pointer to the iterator.
396437 * @param[out] aEntry A pointer to the entry to populate.
@@ -403,6 +444,21 @@ otError otBorderRoutingGetNextPrefixTableEntry(otInstance
403444 otBorderRoutingPrefixTableIterator * aIterator ,
404445 otBorderRoutingPrefixTableEntry * aEntry );
405446
447+ /**
448+ * Iterates over the discovered router entries on the infrastructure link.
449+ *
450+ * @param[in] aInstance The OpenThread instance.
451+ * @param[in,out] aIterator A pointer to the iterator.
452+ * @param[out] aEntry A pointer to the entry to populate.
453+ *
454+ * @retval OT_ERROR_NONE Iterated to the next router, @p aEntry and @p aIterator are updated.
455+ * @retval OT_ERROR_NOT_FOUND No more router entries.
456+ *
457+ */
458+ otError otBorderRoutingGetNextRouterEntry (otInstance * aInstance ,
459+ otBorderRoutingPrefixTableIterator * aIterator ,
460+ otBorderRoutingRouterEntry * aEntry );
461+
406462/**
407463 * Enables / Disables DHCPv6 Prefix Delegation.
408464 *
@@ -414,6 +470,18 @@ otError otBorderRoutingGetNextPrefixTableEntry(otInstance
414470 */
415471void otBorderRoutingDhcp6PdSetEnabled (otInstance * aInstance , bool aEnabled );
416472
473+ /**
474+ * Gets the current state of DHCPv6 Prefix Delegation.
475+ *
476+ * Requires `OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE` to be enabled.
477+ *
478+ * @param[in] aInstance A pointer to an OpenThread instance.
479+ *
480+ * @returns The current state of DHCPv6 Prefix Delegation.
481+ *
482+ */
483+ otBorderRoutingDhcp6PdState otBorderRoutingDhcp6PdGetState (otInstance * aInstance );
484+
417485/**
418486 * @}
419487 *
0 commit comments