diff options
author | whd <7058128+superwhd@users.noreply.github.com> | 2023-12-07 02:33:48 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-12-07 02:33:48 +0000 |
commit | 7ff4ef6828dc991db782e8efd42703eaca9273ba (patch) | |
tree | 98817912baa7ff9079fd3c922a3a0aef6b86ac53 | |
parent | e5699d1148fb3c88d877774a4b893e784f47099e (diff) | |
parent | d2076d59b94818105a5dee8107229cd284c6ea37 (diff) | |
download | openthread-7ff4ef6828dc991db782e8efd42703eaca9273ba.tar.gz |
[posix] expose `platformInfraIfIsRunning()` as `otSysInfraIfIsRunning()` (#9672) am: ad9da1b51a am: d2076d59b9
Original change: https://android-review.googlesource.com/c/platform/external/openthread/+/2862425
Change-Id: I6e7d98283665d9ce8fae56e9c252ed4d2892c10d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | src/posix/platform/include/openthread/openthread-system.h | 8 | ||||
-rw-r--r-- | src/posix/platform/infra_if.cpp | 6 | ||||
-rw-r--r-- | src/posix/platform/platform-posix.h | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/posix/platform/include/openthread/openthread-system.h b/src/posix/platform/include/openthread/openthread-system.h index 29dc3ee80..61a07410f 100644 --- a/src/posix/platform/include/openthread/openthread-system.h +++ b/src/posix/platform/include/openthread/openthread-system.h @@ -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 diff --git a/src/posix/platform/infra_if.cpp b/src/posix/platform/infra_if.cpp index 626d12822..6e16b3f7f 100644 --- a/src/posix/platform/infra_if.cpp +++ b/src/posix/platform/infra_if.cpp @@ -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: diff --git a/src/posix/platform/platform-posix.h b/src/posix/platform/platform-posix.h index 0617bfc05..912ceb590 100644 --- a/src/posix/platform/platform-posix.h +++ b/src/posix/platform/platform-posix.h @@ -416,14 +416,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. * */ |