[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:
Abtin Keshavarzian
2022-06-30 12:49:49 -07:00
committed by GitHub
parent ec8ff8f3b4
commit a8924f65f7
7 changed files with 153 additions and 7 deletions
+25
View File
@@ -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`.
*
+1 -1
View File
@@ -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