Adding mNextHopIsDevice to otExternalRouteConfig (#1878)

This commit adds a new field in `otExternalRouteConfig` to indicate
if for the external route entry, the next hop is the device itself.
This commit is contained in:
Abtin Keshavarzian
2017-06-06 11:30:25 -07:00
committed by Jonathan Hui
parent 3a9006e4eb
commit 1582d32a4e
2 changed files with 10 additions and 0 deletions
+9
View File
@@ -743,6 +743,15 @@ typedef struct otExternalRouteConfig
* TRUE, if this configuration is considered Stable Network Data. FALSE, otherwise.
*/
bool mStable : 1;
/**
* TRUE if the external route entry's next hop is this device itself (i.e., the route was added earlier by this
* device). FALSE otherwise.
*
* This value is ignored when adding an external route. For any added route the next hop is this device.
*/
bool mNextHopIsThisDevice : 1;
} otExternalRouteConfig;
/**
+1
View File
@@ -202,6 +202,7 @@ otError NetworkData::GetNextExternalRoute(otNetworkDataIterator *aIterator, uint
aConfig->mPrefix.mLength = prefix->GetPrefixLength();
aConfig->mPreference = hasRouteEntry->GetPreference();
aConfig->mStable = cur->IsStable();
aConfig->mNextHopIsThisDevice = (hasRouteEntry->GetRloc() == mNetif.GetMle().GetRloc16());
*aIterator = static_cast<otNetworkDataIterator>(reinterpret_cast<uint8_t *>(cur->GetNext()) - mTlvs);