[posix] expose platformInfraIfIsRunning() as otSysInfraIfIsRunning() (#9672)

When we are switching to another infra netif via
`otBorderRoutingInit()`, we may want to read the state of the new
infra netif via `otSysInfraIfIsRunning()`.
This commit is contained in:
whd
2023-12-04 22:58:23 -08:00
committed by GitHub
parent 19af7118b0
commit 11622a1b4a
3 changed files with 11 additions and 11 deletions
@@ -246,6 +246,14 @@ void otSysCountInfraNetifAddresses(otSysInfraNetIfAddressCounters *aAddressCount
*/
void otSysSetInfraNetif(const char *aInfraNetifName, int aIcmp6Socket);
/**
* Returns TRUE if the infrastructure interface is running.
*
* @returns TRUE if the infrastructure interface is running, FALSE if not.
*
*/
bool otSysInfraIfIsRunning(void);
#ifdef __cplusplus
} // end of extern "C"
#endif
+3 -3
View File
@@ -112,7 +112,7 @@ otError otPlatInfraIfDiscoverNat64Prefix(uint32_t aInfraIfIndex)
#endif
}
bool platformInfraIfIsRunning(void) { return ot::Posix::InfraNetif::Get().IsRunning(); }
bool otSysInfraIfIsRunning(void) { return ot::Posix::InfraNetif::Get().IsRunning(); }
const char *otSysGetInfraNetifName(void) { return ot::Posix::InfraNetif::Get().GetNetifName(); }
@@ -452,7 +452,7 @@ void InfraNetif::SetUp(void)
VerifyOrExit(mNetLinkSocket != -1);
#if OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
SuccessOrDie(otBorderRoutingInit(gInstance, mInfraIfIndex, platformInfraIfIsRunning()));
SuccessOrDie(otBorderRoutingInit(gInstance, mInfraIfIndex, otSysInfraIfIsRunning()));
SuccessOrDie(otBorderRoutingSetEnabled(gInstance, /* aEnabled */ true));
#endif
@@ -546,7 +546,7 @@ void InfraNetif::ReceiveNetLinkMessage(void)
case RTM_NEWLINK:
case RTM_DELLINK:
#if OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
SuccessOrDie(otPlatInfraIfStateChanged(gInstance, mInfraIfIndex, platformInfraIfIsRunning()));
SuccessOrDie(otPlatInfraIfStateChanged(gInstance, mInfraIfIndex, otSysInfraIfIsRunning()));
#endif
break;
case NLMSG_ERROR:
-8
View File
@@ -415,14 +415,6 @@ extern unsigned int gNetifIndex;
*/
extern otInstance *gInstance;
/**
* Tells if the infrastructure interface is running.
*
* @returns TRUE if the infrastructure interface is running, FALSE if not.
*
*/
bool platformInfraIfIsRunning(void);
/**
* Initializes backtrace module.
*