From 7bc68410049356237d1680b19c1b0e8a4d5eff22 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Tue, 15 Dec 2020 00:44:05 +0800 Subject: [PATCH] [backbone-router] fix build option compile issues (#5955) --- src/posix/platform/backbone.cpp | 22 ++++++++++++++++++++-- src/posix/platform/multicast_routing.cpp | 4 ++-- src/posix/platform/multicast_routing.hpp | 4 ++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/posix/platform/backbone.cpp b/src/posix/platform/backbone.cpp index 626ea355a..b9f9e1180 100644 --- a/src/posix/platform/backbone.cpp +++ b/src/posix/platform/backbone.cpp @@ -39,9 +39,11 @@ #include "platform-posix.h" #include "common/code_utils.hpp" -char gBackboneNetifName[IFNAMSIZ] = ""; -unsigned int gBackboneNetifIndex = 0; +char gBackboneNetifName[IFNAMSIZ] = ""; +unsigned int gBackboneNetifIndex = 0; +#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE static ot::Posix::MulticastRoutingManager sMulticastRoutingManager; +#endif void platformBackboneInit(otInstance *aInstance, const char *aInterfaceName) { @@ -57,22 +59,38 @@ void platformBackboneInit(otInstance *aInstance, const char *aInterfaceName) otLogInfoPlat("Backbone interface is configured to %s (%d)", gBackboneNetifName, gBackboneNetifIndex); +#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE sMulticastRoutingManager.Init(aInstance); +#endif } void platformBackboneUpdateFdSet(fd_set &aReadFdSet, int &aMaxFd) { + OT_UNUSED_VARIABLE(aReadFdSet); + OT_UNUSED_VARIABLE(aMaxFd); + +#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE sMulticastRoutingManager.UpdateFdSet(aReadFdSet, aMaxFd); +#endif } void platformBackboneProcess(const fd_set &aReadSet) { + OT_UNUSED_VARIABLE(aReadSet); + +#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE sMulticastRoutingManager.Process(aReadSet); +#endif } void platformBackboneStateChange(otInstance *aInstance, otChangedFlags aFlags) { + OT_UNUSED_VARIABLE(aInstance); + OT_UNUSED_VARIABLE(aFlags); + +#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE sMulticastRoutingManager.HandleStateChange(aInstance, aFlags); +#endif } #endif diff --git a/src/posix/platform/multicast_routing.cpp b/src/posix/platform/multicast_routing.cpp index 349c0dfb6..988aa0577 100644 --- a/src/posix/platform/multicast_routing.cpp +++ b/src/posix/platform/multicast_routing.cpp @@ -28,7 +28,7 @@ #include "posix/platform/multicast_routing.hpp" -#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE #include #include @@ -566,4 +566,4 @@ void MulticastRoutingManager::RemoveMulticastForwardingCache( } // namespace Posix } // namespace ot -#endif // OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#endif // OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE diff --git a/src/posix/platform/multicast_routing.hpp b/src/posix/platform/multicast_routing.hpp index e5f38f6ec..f2eba627c 100644 --- a/src/posix/platform/multicast_routing.hpp +++ b/src/posix/platform/multicast_routing.hpp @@ -31,7 +31,7 @@ #include "openthread-posix-config.h" -#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE #include #include @@ -175,6 +175,6 @@ private: } // namespace Posix } // namespace ot -#endif // OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE +#endif // OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE #endif // OT_POSIX_PLATFORM_MULTICAST_ROUTING_HPP_