From b4c53e6bdaead4416f40d5de498f7cc6f66dd660 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Wed, 19 Jun 2019 10:54:12 -0700 Subject: [PATCH] [netif] remove virtual methods (#3925) --- src/core/net/netif.hpp | 47 -------------------------------- src/core/thread/thread_netif.cpp | 8 ------ src/core/thread/thread_netif.hpp | 12 ++------ 3 files changed, 2 insertions(+), 65 deletions(-) diff --git a/src/core/net/netif.hpp b/src/core/net/netif.hpp index 8987c283b..9616c04b0 100644 --- a/src/core/net/netif.hpp +++ b/src/core/net/netif.hpp @@ -401,53 +401,6 @@ public: */ void SetMulticastPromiscuous(bool aEnabled) { mMulticastPromiscuous = aEnabled; } - /** - * This virtual method enqueues an IPv6 messages on this network interface. - * - * @param[in] aMessage A reference to the IPv6 message. - * - * @retval OT_ERROR_NONE Successfully enqueued the IPv6 message. - * - */ - virtual otError SendMessage(Message &aMessage) - { - OT_UNUSED_VARIABLE(aMessage); - return OT_ERROR_NOT_IMPLEMENTED; - } - - /** - * This virtual method fills out @p aAddress with the link address. - * - * @param[out] aAddress A reference to the link address. - * - * @retval OT_ERROR_NONE Successfully retrieved the link address. - * - */ - virtual otError GetLinkAddress(LinkAddress &aAddress) const - { - OT_UNUSED_VARIABLE(aAddress); - return OT_ERROR_NOT_IMPLEMENTED; - } - - /** - * This virtual method performs a source-destination route lookup. - * - * @param[in] aSource A reference to the IPv6 source address. - * @param[in] aDestination A reference to the IPv6 destination address. - * @param[out] aPrefixMatch The longest prefix match result. - * - * @retval OT_ERROR_NONE Successfully found a route. - * @retval OT_ERROR_NO_ROUTE No route to destination. - * - */ - virtual otError RouteLookup(const Address &aSource, const Address &aDestination, uint8_t *aPrefixMatch) - { - OT_UNUSED_VARIABLE(aSource); - OT_UNUSED_VARIABLE(aDestination); - OT_UNUSED_VARIABLE(aPrefixMatch); - return OT_ERROR_NOT_IMPLEMENTED; - } - protected: /** * This method subscribes the network interface to the realm-local all MPL forwarders, link-local and diff --git a/src/core/thread/thread_netif.cpp b/src/core/thread/thread_netif.cpp index 8912db0d4..bf51327a7 100644 --- a/src/core/thread/thread_netif.cpp +++ b/src/core/thread/thread_netif.cpp @@ -171,14 +171,6 @@ exit: return; } -otError ThreadNetif::GetLinkAddress(Ip6::LinkAddress &aAddress) const -{ - aAddress.mType = Ip6::LinkAddress::kEui64; - aAddress.mLength = sizeof(aAddress.mExtAddress); - aAddress.mExtAddress = Get().GetExtAddress(); - return OT_ERROR_NONE; -} - otError ThreadNetif::RouteLookup(const Ip6::Address &aSource, const Ip6::Address &aDestination, uint8_t *aPrefixMatch) { otError error; diff --git a/src/core/thread/thread_netif.hpp b/src/core/thread/thread_netif.hpp index f3b3eff41..0b374bb1a 100644 --- a/src/core/thread/thread_netif.hpp +++ b/src/core/thread/thread_netif.hpp @@ -128,14 +128,6 @@ public: */ bool IsUp(void) const { return mIsUp; } - /** - * This method retrieves the link address. - * - * @param[out] aAddress A reference to the link address. - * - */ - virtual otError GetLinkAddress(Ip6::LinkAddress &aAddress) const; - /** * This method submits a message to the network interface. * @@ -144,7 +136,7 @@ public: * @retval OT_ERROR_NONE Successfully submitted the message to the interface. * */ - virtual otError SendMessage(Message &aMessage) { return mMeshForwarder.SendMessage(aMessage); } + otError SendMessage(Message &aMessage) { return mMeshForwarder.SendMessage(aMessage); } /** * This method performs a route lookup. @@ -157,7 +149,7 @@ public: * @retval OT_ERROR_NO_ROUTE Could not find a valid route. * */ - virtual otError RouteLookup(const Ip6::Address &aSource, const Ip6::Address &aDestination, uint8_t *aPrefixMatch); + otError RouteLookup(const Ip6::Address &aSource, const Ip6::Address &aDestination, uint8_t *aPrefixMatch); /** * This method returns whether Thread Management Framework Addressing Rules are met.