[router-table] remove from MTD build (#4730)

This commit is contained in:
Jonathan Hui
2020-03-25 07:54:57 -07:00
parent efa085e43f
commit d00f9f7228
4 changed files with 11 additions and 32 deletions
+2
View File
@@ -416,10 +416,12 @@ template <> inline ChildTable &Instance::Get(void)
return mThreadNetif.mMleRouter.mChildTable;
}
#if OPENTHREAD_FTD
template <> inline RouterTable &Instance::Get(void)
{
return mThreadNetif.mMleRouter.mRouterTable;
}
#endif
template <> inline Ip6::Netif &Instance::Get(void)
{
+2
View File
@@ -124,6 +124,7 @@ otError KeyManager::SetMasterKey(const MasterKey &aKey)
parent->SetLinkFrameCounter(0);
parent->SetMleFrameCounter(0);
#if OPENTHREAD_FTD
// reset router frame counters
for (RouterTable::Iterator iter(GetInstance()); !iter.IsDone(); iter++)
{
@@ -131,6 +132,7 @@ otError KeyManager::SetMasterKey(const MasterKey &aKey)
iter.GetRouter()->SetLinkFrameCounter(0);
iter.GetRouter()->SetMleFrameCounter(0);
}
#endif
// reset child frame counters
for (ChildTable::Iterator iter(GetInstance(), Child::kInStateAnyExceptInvalid); !iter.IsDone(); iter++)
+1 -4
View File
@@ -38,7 +38,6 @@
#include "thread/child_table.hpp"
#include "thread/mle.hpp"
#include "thread/router_table.hpp"
namespace ot {
namespace Mle {
@@ -52,7 +51,6 @@ public:
explicit MleRouter(Instance &aInstance)
: Mle(aInstance)
, mChildTable(aInstance)
, mRouterTable(aInstance)
{
}
@@ -85,8 +83,7 @@ public:
bool HasSleepyChildrenSubscribed(const Ip6::Address &) { return false; }
private:
ChildTable mChildTable;
RouterTable mRouterTable;
ChildTable mChildTable;
};
} // namespace Mle
+6 -28
View File
@@ -29,6 +29,10 @@
#ifndef ROUTER_TABLE_HPP_
#define ROUTER_TABLE_HPP_
#include "openthread-core-config.h"
#if OPENTHREAD_FTD
#include "common/encoding.hpp"
#include "common/locator.hpp"
#include "mac/mac_types.hpp"
@@ -38,8 +42,6 @@
namespace ot {
#if OPENTHREAD_FTD
class RouterTable : public InstanceLocator
{
public:
@@ -361,32 +363,8 @@ private:
uint8_t mActiveRouterCount;
};
#endif // OPENTHREAD_FTD
#if OPENTHREAD_MTD
class RouterTable
{
public:
class Iterator
{
public:
explicit Iterator(Instance &) {}
void Reset(void) {}
bool IsDone(void) const { return true; }
void Advance(void) {}
void operator++(void) {}
void operator++(int) {}
Router *GetRouter(void) { return NULL; }
};
explicit RouterTable(Instance &) {}
uint8_t GetNeighborCount(void) const { return 0; }
};
#endif // OPENTHREAD_MTD
} // namespace ot
#endif // OPENTHREAD_FTD
#endif // ROUTER_TABLE_HPP_