mirror of
https://github.com/espressif/openthread.git
synced 2026-09-12 20:20:04 +00:00
[routing-manager] get/set preference for RIOs in emitted RA messages (#7849)
This commit adds new mechanism in `RoutingManager` to allow user to get or set the preference level to use when advertising Rout Info Options (e.g., for discovered OMR prefixes) in RA messages sent on infra netif. By default 'medium' preference is used. As an example, user can choose to set the preference to 'low' when the device is acting as a temporary BR (a mobile or battery-powered BR) to indicate that other BRs should be preferred over this BR on the infra link. This commit also adds CLI sub-commands for newly added APIs and updates the documentation.
This commit is contained in:
@@ -86,6 +86,31 @@ otError otBorderRoutingInit(otInstance *aInstance, uint32_t aInfraIfIndex, bool
|
||||
*/
|
||||
otError otBorderRoutingSetEnabled(otInstance *aInstance, bool aEnabled);
|
||||
|
||||
/**
|
||||
* This function gets the preference used when advertising Route Info Options (e.g., for discovered OMR prefixes) in
|
||||
* Router Advertisement messages sent over the infrastructure link.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @returns The OMR prefix advertisement preference.
|
||||
*
|
||||
*/
|
||||
otRoutePreference otBorderRoutingGetRouteInfoOptionPreference(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function sets the preference to use when advertising Route Info Options (e.g., for discovered OMR prefixes) in
|
||||
* Router Advertisement messages sent over the infrastructure link.
|
||||
*
|
||||
* By default BR will use 'medium' preference level but this function allows the default value to be changed. As an
|
||||
* example, it can be set to 'low' preference in the case where device is a temporary BR (a mobile BR or a
|
||||
* battery-powered BR) to indicate that other BRs (if any) should be preferred over this BR on the infrastructure link.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPreference The route preference to use.
|
||||
*
|
||||
*/
|
||||
void otBorderRoutingSetRouteInfoOptionPreference(otInstance *aInstance, otRoutePreference aPreference);
|
||||
|
||||
/**
|
||||
* Gets the Off-Mesh-Routable (OMR) Prefix, for example `fdfc:1ff5:1512:5622::/64`.
|
||||
*
|
||||
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
* @note This number versions both OpenThread platform and user APIs.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_API_VERSION (222)
|
||||
#define OPENTHREAD_API_VERSION (223)
|
||||
|
||||
/**
|
||||
* @addtogroup api-instance
|
||||
|
||||
Reference in New Issue
Block a user