mirror of
https://github.com/espressif/openthread.git
synced 2026-10-07 00:07:42 +00:00
[routing-manager] add mIsReachable to otBorderRoutingRouterEntry (#10388)
This commit adds `mIsReachable` to the `otBorderRoutingRouterEntry` structure to indicate whether a router is reachable. A router is marked unreachable after it fails to respond to multiple Neighbor Solicitation (NS) probes. Additionally, the `br` CLI commands are updated to display this information.
This commit is contained in:
@@ -102,6 +102,7 @@ typedef struct otBorderRoutingRouterEntry
|
|||||||
bool mOtherConfigFlag : 1; ///< The router's Other Config flag (`O` flag).
|
bool mOtherConfigFlag : 1; ///< The router's Other Config flag (`O` flag).
|
||||||
bool mStubRouterFlag : 1; ///< The router's Stub Router flag.
|
bool mStubRouterFlag : 1; ///< The router's Stub Router flag.
|
||||||
bool mIsLocalDevice : 1; ///< This router is the local device (this BR).
|
bool mIsLocalDevice : 1; ///< This router is the local device (this BR).
|
||||||
|
bool mIsReachable : 1; ///< This router is reachable.
|
||||||
} otBorderRoutingRouterEntry;
|
} otBorderRoutingRouterEntry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ extern "C" {
|
|||||||
* @note This number versions both OpenThread platform and user APIs.
|
* @note This number versions both OpenThread platform and user APIs.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define OPENTHREAD_API_VERSION (421)
|
#define OPENTHREAD_API_VERSION (422)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup api-instance
|
* @addtogroup api-instance
|
||||||
|
|||||||
@@ -352,9 +352,11 @@ Info per router:
|
|||||||
- O: Other Config flag
|
- O: Other Config flag
|
||||||
- Stub: Stub Router flag (indicates whether the router is a stub router)
|
- Stub: Stub Router flag (indicates whether the router is a stub router)
|
||||||
- Milliseconds since last received message from this router
|
- Milliseconds since last received message from this router
|
||||||
|
- Reachability flag: A router is marked as unreachable if it fails to respond to multiple Neighbor Solicitation probes.
|
||||||
|
- `(this BR)` is appended when the router is the local device itself.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
> br routers
|
> br routers
|
||||||
ff02:0:0:0:0:0:0:1 (M:0 O:0 Stub:1) ms-since-rx:1505
|
ff02:0:0:0:0:0:0:1 (M:0 O:0 Stub:1) ms-since-rx:1505 reachable:yes
|
||||||
Done
|
Done
|
||||||
```
|
```
|
||||||
|
|||||||
+6
-2
@@ -518,7 +518,7 @@ exit:
|
|||||||
* @cli br routers
|
* @cli br routers
|
||||||
* @code
|
* @code
|
||||||
* br routers
|
* br routers
|
||||||
* ff02:0:0:0:0:0:0:1 (M:0 O:0 Stub:1) ms-since-rx:1505
|
* ff02:0:0:0:0:0:0:1 (M:0 O:0 Stub:1) ms-since-rx:1505 reachable:yes
|
||||||
* Done
|
* Done
|
||||||
* @endcode
|
* @endcode
|
||||||
* @par
|
* @par
|
||||||
@@ -530,6 +530,9 @@ exit:
|
|||||||
* - O: Other Config flag
|
* - O: Other Config flag
|
||||||
* - Stub: Stub Router flag (indicates whether the router is a stub router)
|
* - Stub: Stub Router flag (indicates whether the router is a stub router)
|
||||||
* - Milliseconds since last received message from this router
|
* - Milliseconds since last received message from this router
|
||||||
|
* - Reachability flag: A router is marked as unreachable if it fails to respond to multiple Neighbor Solicitation
|
||||||
|
* probes.
|
||||||
|
* - `(this BR)` is appended when the router is the local device itself.
|
||||||
* @sa otBorderRoutingGetNextRouterEntry
|
* @sa otBorderRoutingGetNextRouterEntry
|
||||||
*/
|
*/
|
||||||
template <> otError Br::Process<Cmd("routers")>(Arg aArgs[])
|
template <> otError Br::Process<Cmd("routers")>(Arg aArgs[])
|
||||||
@@ -559,7 +562,8 @@ void Br::OutputRouterInfo(const otBorderRoutingRouterEntry &aEntry, RouterOutput
|
|||||||
|
|
||||||
if (aMode == kLongVersion)
|
if (aMode == kLongVersion)
|
||||||
{
|
{
|
||||||
OutputFormat(" ms-since-rx:%lu", ToUlong(aEntry.mMsecSinceLastUpdate));
|
OutputFormat(" ms-since-rx:%lu reachable:%s", ToUlong(aEntry.mMsecSinceLastUpdate),
|
||||||
|
aEntry.mIsReachable ? "yes" : "no");
|
||||||
|
|
||||||
if (aEntry.mIsLocalDevice)
|
if (aEntry.mIsLocalDevice)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1969,6 +1969,7 @@ void RoutingManager::RxRaTracker::Router::CopyInfoTo(RouterEntry &aEntry, TimeMi
|
|||||||
aEntry.mOtherConfigFlag = mOtherConfigFlag;
|
aEntry.mOtherConfigFlag = mOtherConfigFlag;
|
||||||
aEntry.mStubRouterFlag = mStubRouterFlag;
|
aEntry.mStubRouterFlag = mStubRouterFlag;
|
||||||
aEntry.mIsLocalDevice = mIsLocalDevice;
|
aEntry.mIsLocalDevice = mIsLocalDevice;
|
||||||
|
aEntry.mIsReachable = IsReachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user