![]() |
![]() |
|
OpenThread
1.05.02.06
|
This module includes definitions for managing Thread Network Data. More...
Collaboration diagram for Core:Data Structures | |
| struct | NetworkData::Config |
| class | MutableNetworkData |
| class | NetworkData |
| class | NetworkData::NetworkDataIterator |
Typedefs | |
| typedef otNetworkDataIterator | Iterator |
Enumerations | |
| enum | ServiceMatchMode : uint8_t { kServicePrefixMatch, kServiceExactMatch } |
Functions | |
| void | AdvaceSubTlv (const NetworkDataTlv *aSubTlvs) |
| void | AdvanceTlv (const uint8_t *aTlvs) |
| NetworkDataTlv * | AppendTlv (uint16_t aTlvSize) |
| bool | CanInsert (uint16_t aSize) const |
| void | Clear (void) |
| bool | ContainsEntriesFrom (const NetworkData &aCompare, uint16_t aRloc16) const |
| bool | ContainsExternalRoute (const ExternalRouteConfig &aRoute) const |
| bool | ContainsOnMeshPrefix (const OnMeshPrefixConfig &aPrefix) const |
| bool | ContainsService (const ServiceConfig &aService) const |
| Error | CopyNetworkData (Type aType, uint8_t *aData, uint8_t &aDataLength) const |
| Error | CopyNetworkData (Type aType, MutableNetworkData &aNetworkData) const |
| uint8_t | CountBorderRouters (RoleFilter aRoleFilter) const |
| Error | FindBorderRouters (RoleFilter aRoleFilter, uint16_t aRlocs[], uint8_t &aRlocsLength) const |
| const ServiceTlv * | FindNextService (const ServiceTlv *aPrevServiceTlv, uint32_t aEnterpriseNumber, const ServiceData &aServiceData, ServiceMatchMode aServiceMatchMode) const |
| const ServiceTlv * | FindNextThreadService (const ServiceTlv *aPrevServiceTlv, const ServiceData &aServiceData, ServiceMatchMode aServiceMatchMode) const |
| const PrefixTlv * | FindPrefix (const uint8_t *aPrefix, uint8_t aPrefixLength) const |
| const PrefixTlv * | FindPrefix (const Ip6::Prefix &aPrefix) const |
| PrefixTlv * | FindPrefix (const uint8_t *aPrefix, uint8_t aPrefixLength) |
| PrefixTlv * | FindPrefix (const Ip6::Prefix &aPrefix) |
| const ServiceTlv * | FindService (uint32_t aEnterpriseNumber, const ServiceData &aServiceData, ServiceMatchMode aServiceMatchMode) const |
| ServiceTlv * | FindService (uint32_t aEnterpriseNumber, const ServiceData &aServiceData, ServiceMatchMode aServiceMatchMode) |
| uint8_t | GetAndAdvanceIndex (void) |
| const uint8_t * | GetBytes (void) const |
| uint8_t * | GetBytes (void) |
| uint8_t | GetEntryIndex (void) const |
| uint8_t | GetLength (void) const |
| Error | GetNextExternalRoute (Iterator &aIterator, ExternalRouteConfig &aConfig) const |
| Error | GetNextExternalRoute (Iterator &aIterator, uint16_t aRloc16, ExternalRouteConfig &aConfig) const |
| Error | GetNextOnMeshPrefix (Iterator &aIterator, OnMeshPrefixConfig &aConfig) const |
| Error | GetNextOnMeshPrefix (Iterator &aIterator, uint16_t aRloc16, OnMeshPrefixConfig &aConfig) const |
| Error | GetNextServer (Iterator &aIterator, uint16_t &aRloc16) const |
| Error | GetNextService (Iterator &aIterator, ServiceConfig &aConfig) const |
| Error | GetNextService (Iterator &aIterator, uint16_t aRloc16, ServiceConfig &aConfig) const |
| uint8_t | GetSize (void) const |
| const NetworkDataTlv * | GetSubTlv (const NetworkDataTlv *aSubTlvs) const |
| uint8_t | GetSubTlvOffset (void) const |
| const NetworkDataTlv * | GetTlv (const uint8_t *aTlvs) const |
| uint8_t | GetTlvOffset (void) const |
| const NetworkDataTlv * | GetTlvsEnd (void) const |
| NetworkDataTlv * | GetTlvsEnd (void) |
| const NetworkDataTlv * | GetTlvsStart (void) const |
| NetworkDataTlv * | GetTlvsStart (void) |
| void | Insert (void *aStart, uint8_t aLength) |
| bool | IsNewEntry (void) const |
| Error | Iterate (Iterator &aIterator, uint16_t aRloc16, Config &aConfig) const |
| void | MarkEntryAsNotNew (void) |
| static bool | MatchService (const ServiceTlv &aServiceTlv, uint32_t aEnterpriseNumber, const ServiceData &aServiceData, ServiceMatchMode aServiceMatchMode) |
| MutableNetworkData (Instance &aInstance, uint8_t *aTlvs, uint8_t aLength, uint8_t aSize) | |
| NetworkData (Instance &aInstance, const uint8_t *aTlvs=nullptr, uint8_t aLength=0) | |
| NetworkData (Instance &aInstance, const NetworkDataTlv *aStartTlv, const NetworkDataTlv *aEndTlv) | |
| NetworkDataIterator (Iterator &aIterator) | |
| void | Remove (void *aRemoveStart, uint8_t aRemoveLength) |
| void | RemoveTemporaryData (void) |
| void | RemoveTemporaryDataIn (PrefixTlv &aPrefix) |
| void | RemoveTemporaryDataIn (ServiceTlv &aService) |
| void | RemoveTlv (NetworkDataTlv *aTlv) |
| void | SaveSubTlvOffset (const NetworkDataTlv *aSubTlv, const NetworkDataTlv *aSubTlvs) |
| void | SaveTlvOffset (const NetworkDataTlv *aTlv, const uint8_t *aTlvs) |
| Error | SendServerDataNotification (uint16_t aRloc16, bool aAppendNetDataTlv, Coap::ResponseHandler aHandler, void *aContext) const |
| void | SetEntryIndex (uint8_t aIndex) |
| void | SetLength (uint8_t aLength) |
| void | SetSubTlvOffset (uint8_t aOffset) |
| void | SetTlvOffset (uint8_t aOffset) |
Variables | |
| static constexpr uint8_t | kEntryPosition = 2 |
| constexpr Iterator | kIteratorInit = OT_NETWORK_DATA_ITERATOR_INIT |
Initializer for Iterator type. More... | |
| static constexpr uint8_t | kMaxSize = 254 |
| Maximum size of Thread Network Data in bytes. More... | |
| static constexpr uint8_t | kSubTlvPosition = 1 |
| static constexpr uint8_t | kTlvPosition = 0 |
| ExternalRouteConfig * | mExternalRoute |
| uint8_t * | mIteratorBuffer |
| uint8_t | mLength |
| OnMeshPrefixConfig * | mOnMeshPrefix |
| ServiceConfig * | mService |
| uint8_t | mSize |
| const uint8_t * | mTlvs |
Friends | |
| class | Leader |
| class | MutableNetworkData |
| class | NetworkData |
| class | Publisher |
| class | Publisher |
| class | Service::Manager |
| class | Service::Manager |
This module includes definitions for managing Thread Network Data.
| typedef otNetworkDataIterator Iterator |
This type represents a Iterator used to iterate through Network Data info (e.g., see GetNextOnMeshPrefix())
|
protected |
|
inlineexplicit |
This constructor initializes the NetworkData from a given pointer to a buffer and length.
| [in] | aInstance | A reference to the OpenThread instance. |
| [in] | aTlvs | A pointer to the buffer containing the TLVs. |
| [in] | aLength | The length (number of bytes) of aTlvs buffer. |
Referenced by NetworkData::FindNextService().
|
inline |
This constructor initializes the NetworkData from a range of TLVs (given as pair of start and end pointers).
| [in] | aInstance | A reference to the OpenThread instance. |
| [in] | aStartTlv | A pointer to the start of the TLVs buffer. |
| [in] | aEndTlv | A pointer to the end of the TLVs buffer. |
|
inline |
This method returns the length of NetworkData (number of bytes).
NetworkData (number of bytes). Referenced by NetworkData::CopyNetworkData(), NetworkData::FindBorderRouters(), MutableNetworkData::MutableNetworkData(), and LeaderBase::SetNetworkData().
|
inline |
This method returns a pointer to the start of the TLVs in NetworkData.
Referenced by MutableNetworkData::MutableNetworkData(), and MutableNetworkData::Remove().
This method provides full or stable copy of the Thread Network Data.
| [in] | aType | The Network Data type to copy, the full set or stable subset. |
| [out] | aData | A pointer to the data buffer to copy the Network Data into. |
| [in,out] | aDataLength | On entry, size of the data buffer pointed to by aData. On exit, number of copied bytes. |
| kErrorNone | Successfully copied Thread Network Data. |
| kErrorNoBufs | Not enough space in aData to fully copy Thread Network Data. |
References InstanceLocator::GetInstance(), NetworkData::GetLength(), and SuccessOrExit.
| Error CopyNetworkData | ( | Type | aType, |
| MutableNetworkData & | aNetworkData | ||
| ) | const |
This method provides full or stable copy of the Thread Network Data.
| [in] | aType | The Network Data type to copy, the full set or stable subset. |
| [out] | aNetworkData | A reference to a MutableNetworkData to copy the Network Data into. |
| kErrorNone | Successfully copied Thread Network Data. |
| kErrorNoBufs | Not enough space in aNetworkData to fully copy Thread Network Data. |
References MutableNetworkData::GetBytes(), MutableNetworkData::GetSize(), ot::kErrorNoBufs, ot::kErrorNone, ot::NetworkData::kStableSubset, NetworkData::mLength, NetworkData::mTlvs, MutableNetworkData::RemoveTemporaryData(), MutableNetworkData::SetLength(), and VerifyOrExit.
| Error GetNextOnMeshPrefix | ( | Iterator & | aIterator, |
| OnMeshPrefixConfig & | aConfig | ||
| ) | const |
This method provides the next On Mesh prefix in the Thread Network Data.
| [in,out] | aIterator | A reference to the Network Data iterator. |
| [out] | aConfig | A reference to a config variable where the On Mesh Prefix information will be placed. |
| kErrorNone | Successfully found the next On Mesh prefix. |
| kErrorNotFound | No subsequent On Mesh prefix exists in the Thread Network Data. |
References ot::Mac::kShortAddrBroadcast.
Referenced by NetworkData::ContainsOnMeshPrefix(), and NetworkData::FindBorderRouters().
| Error GetNextOnMeshPrefix | ( | Iterator & | aIterator, |
| uint16_t | aRloc16, | ||
| OnMeshPrefixConfig & | aConfig | ||
| ) | const |
This method provides the next On Mesh prefix in the Thread Network Data for a given RLOC16.
| [in,out] | aIterator | A reference to the Network Data iterator. |
| [in] | aRloc16 | The RLOC16 value. |
| [out] | aConfig | A reference to a config variable where the On Mesh Prefix information will be placed. |
| kErrorNone | Successfully found the next On Mesh prefix. |
| kErrorNotFound | No subsequent On Mesh prefix exists in the Thread Network Data. |
References NetworkData::Iterate(), NetworkData::Config::mExternalRoute, NetworkData::Config::mOnMeshPrefix, and NetworkData::Config::mService.
| Error GetNextExternalRoute | ( | Iterator & | aIterator, |
| ExternalRouteConfig & | aConfig | ||
| ) | const |
This method provides the next external route in the Thread Network Data.
| [in,out] | aIterator | A reference to the Network Data iterator. |
| [out] | aConfig | A reference to a config variable where the external route information will be placed. |
| kErrorNone | Successfully found the next external route. |
| kErrorNotFound | No subsequent external route exists in the Thread Network Data. |
References ot::Mac::kShortAddrBroadcast.
Referenced by NetworkData::ContainsExternalRoute(), NetworkData::FindBorderRouters(), and LeaderBase::GetPreferredNat64Prefix().
| Error GetNextExternalRoute | ( | Iterator & | aIterator, |
| uint16_t | aRloc16, | ||
| ExternalRouteConfig & | aConfig | ||
| ) | const |
This method provides the next external route in the Thread Network Data for a given RLOC16.
| [in,out] | aIterator | A reference to the Network Data iterator. |
| [in] | aRloc16 | The RLOC16 value. |
| [out] | aConfig | A reference to a config variable where the external route information will be placed. |
| kErrorNone | Successfully found the next external route. |
| kErrorNotFound | No subsequent external route exists in the Thread Network Data. |
References NetworkData::Iterate(), NetworkData::Config::mExternalRoute, NetworkData::Config::mOnMeshPrefix, and NetworkData::Config::mService.
| Error GetNextService | ( | Iterator & | aIterator, |
| ServiceConfig & | aConfig | ||
| ) | const |
This method provides the next service in the Thread Network Data.
| [in,out] | aIterator | A reference to the Network Data iterator. |
| [out] | aConfig | A reference to a config variable where the service information will be placed. |
| kErrorNone | Successfully found the next service. |
| kErrorNotFound | No subsequent service exists in the Thread Network Data. |
References ot::Mac::kShortAddrBroadcast.
Referenced by NetworkData::ContainsService(), and LeaderBase::GetServiceId().
| Error GetNextService | ( | Iterator & | aIterator, |
| uint16_t | aRloc16, | ||
| ServiceConfig & | aConfig | ||
| ) | const |
This method provides the next service in the Thread Network Data for a given RLOC16.
| [in,out] | aIterator | A reference to the Network Data iterator. |
| [in] | aRloc16 | The RLOC16 value. |
| [out] | aConfig | A reference to a config variable where the service information will be placed. |
| kErrorNone | Successfully found the next service. |
| kErrorNotFound | No subsequent service exists in the Thread Network Data. |
References NetworkData::Iterate(), NetworkData::Config::mExternalRoute, NetworkData::Config::mOnMeshPrefix, and NetworkData::Config::mService.
| bool ContainsOnMeshPrefix | ( | const OnMeshPrefixConfig & | aPrefix | ) | const |
This method indicates whether or not the Thread Network Data contains a given on mesh prefix entry.
| [in] | aPrefix | The on mesh prefix config to check. |
| TRUE | if Network Data contains an on mesh prefix matching aPrefix. |
| FALSE | if Network Data does not contain an on mesh prefix matching aPrefix. |
References NetworkData::GetNextOnMeshPrefix(), ot::kErrorNone, ot::NetworkData::kIteratorInit, and otBorderRouterConfig::mRloc16.
Referenced by NetworkData::ContainsEntriesFrom().
| bool ContainsExternalRoute | ( | const ExternalRouteConfig & | aRoute | ) | const |
This method indicates whether or not the Thread Network Data contains a given external route entry.
| [in] | aRoute | The external route config to check. |
| TRUE | if Network Data contains an external route matching aRoute. |
| FALSE | if Network Data does not contain an external route matching aRoute. |
References NetworkData::GetNextExternalRoute(), ot::kErrorNone, ot::NetworkData::kIteratorInit, and otExternalRouteConfig::mRloc16.
Referenced by NetworkData::ContainsEntriesFrom().
| bool ContainsService | ( | const ServiceConfig & | aService | ) | const |
This method indicates whether or not the Thread Network Data contains a given service entry.
| [in] | aService | The service config to check. |
| TRUE | if Network Data contains a service matching aService. |
| FALSE | if Network Data does not contain a service matching aService. |
References NetworkData::GetNextService(), ServiceConfig::GetServerConfig(), ot::kErrorNone, ot::NetworkData::kIteratorInit, and otServerConfig::mRloc16.
Referenced by NetworkData::ContainsEntriesFrom().
| bool ContainsEntriesFrom | ( | const NetworkData & | aCompare, |
| uint16_t | aRloc16 | ||
| ) | const |
This method indicates whether or not the Thread Network Data contains all the on mesh prefixes, external routes, and service entries as in another given Network Data associated with a given RLOC16.
| [in] | aCompare | The Network Data to compare with. |
| [in] | aRloc16 | The RLOC16 to consider. |
| TRUE | if Network Data contains all the same entries as in aCompare for aRloc16. |
| FALSE | if Network Data does not contains all the same entries as in aCompare for aRloc16. |
References NetworkData::ContainsExternalRoute(), NetworkData::ContainsOnMeshPrefix(), NetworkData::ContainsService(), ExitNow, NetworkData::Iterate(), ot::NetworkData::kIteratorInit, NetworkData::Config::mExternalRoute, NetworkData::Config::mOnMeshPrefix, NetworkData::Config::mService, and SuccessOrExit.
This method provides the next server RLOC16 in the Thread Network Data.
| [in,out] | aIterator | A reference to the Network Data iterator. |
| [out] | aRloc16 | The RLOC16 value. |
| kErrorNone | Successfully found the next server. |
| kErrorNotFound | No subsequent server exists in the Thread Network Data. |
References NetworkData::Iterate(), ot::Mac::kShortAddrBroadcast, NetworkData::Config::mExternalRoute, NetworkData::Config::mOnMeshPrefix, otBorderRouterConfig::mRloc16, otExternalRouteConfig::mRloc16, otServerConfig::mRloc16, otServiceConfig::mServerConfig, NetworkData::Config::mService, OT_ASSERT, and SuccessOrExit.
| Error FindBorderRouters | ( | RoleFilter | aRoleFilter, |
| uint16_t | aRlocs[], | ||
| uint8_t & | aRlocsLength | ||
| ) | const |
This method finds and returns the list of RLOCs of border routers providing external IPv6 connectivity.
A border router is considered to provide external IPv6 connectivity if it has added at least one external route entry, or an on-mesh prefix with default-route and on-mesh flags set.
This method should be used when the RLOC16s are present in the Network Data (when the Network Data contains the full set and not the stable subset).
| [in] | aRoleFilter | Indicates which devices to include (any role, router role only, or child only). |
| [out] | aRlocs | Array to output the list of RLOCs. |
| [in,out] | aRlocsLength | On entry, aRlocs array length (max number of elements). On exit, number RLOC16 entries added in aRlocs. |
| kErrorNone | Successfully found all RLOC16s and updated aRlocs and aRlocsLength. |
| kErrorNoBufs | Ran out of space in aRlocs array. aRlocs and aRlocsLength are still updated up to the maximum array length. |
References NetworkData::GetLength(), NetworkData::GetNextExternalRoute(), NetworkData::GetNextOnMeshPrefix(), Mle::IsActiveRouter(), ot::NetworkData::kAnyRole, ot::NetworkData::kChildRoleOnly, ot::kErrorNoBufs, ot::kErrorNone, ot::NetworkData::kIteratorInit, ot::NetworkData::kRouterRoleOnly, otBorderRouterConfig::mDefaultRoute, NetworkData::mLength, otBorderRouterConfig::mOnMesh, otBorderRouterConfig::mRloc16, otExternalRouteConfig::mRloc16, SuccessOrExit, and VerifyOrExit.
Referenced by NetworkData::CountBorderRouters().
| uint8_t CountBorderRouters | ( | RoleFilter | aRoleFilter | ) | const |
This method counts the number of border routers providing external IPv6 connectivity.
A border router is considered to provide external IPv6 connectivity if it has added at least one external route entry, or an on-mesh prefix with default-route and on-mesh flags set.
This method should be used when the RLOC16s are present in the Network Data (when the Network Data contains the full set and not the stable subset).
| [in] | aRoleFilter | Indicates which RLOCs to include (any role, router only, or child only). |
aRoleFilter. References NetworkData::FindBorderRouters(), and SuccessOrAssert.
|
inlineprotected |
This method returns a pointer to the start of Network Data TLV sequence.
Referenced by MutableNetworkData::RemoveTemporaryData(), and MutableNetworkData::SetLength().
|
inlineprotected |
This method returns a pointer to the end of Network Data TLV sequence.
Referenced by MutableNetworkData::AppendTlv(), MutableNetworkData::GetTlvsStart(), NetworkData::Iterate(), and MutableNetworkData::RemoveTemporaryData().
|
protected |
This method returns a pointer to a Prefix TLV.
| [in] | aPrefix | A pointer to an IPv6 prefix. |
| [in] | aPrefixLength | The prefix length pointed to by aPrefix (in bits). |
nullptr if no matching Prefix TLV exists. References PrefixTlv::IsEqual(), TlvIterator::Iterate(), NetworkData::mLength, and NetworkData::mTlvs.
Referenced by MutableNetworkData::GetTlvsEnd().
|
inlineprotected |
This method returns a pointer to a Prefix TLV.
| [in] | aPrefix | An IPv6 prefix. |
nullptr if no matching Prefix TLV exists. References Prefix::GetBytes(), and Prefix::GetLength().
|
protected |
This method returns a pointer to a matching Service TLV.
| [in] | aEnterpriseNumber | Enterprise Number. |
| [in] | aServiceData | A Service Data. |
| [in] | aServiceMatchMode | The Service Data match mode. |
References TlvIterator::Iterate(), NetworkData::MatchService(), NetworkData::mLength, and NetworkData::mTlvs.
Referenced by MutableNetworkData::FindPrefix().
|
protected |
This method returns the next pointer to a matching Service TLV.
This method can be used to iterate over all Service TLVs that start with a given Service Data.
| [in] | aPrevServiceTlv | Set to nullptr to start from the beginning of the TLVs (finding the first matching Service TLV), or a pointer to the previous Service TLV returned from this method to iterate to the next matching Service TLV. |
| [in] | aEnterpriseNumber | Enterprise Number. |
| [in] | aServiceData | A Service Data to match with Service TLVs. |
| [in] | aServiceMatchMode | The Service Data match mode. |
nullptr if it cannot be found. References InstanceLocator::GetInstance(), NetworkDataTlv::GetNext(), NetworkData::mLength, NetworkData::mTlvs, and NetworkData::NetworkData().
Referenced by NetworkData::FindNextThreadService().
|
protected |
This method returns the next pointer to a matching Thread Service TLV (with Thread Enterprise number).
This method can be used to iterate over all Thread Service TLVs that start with a given Service Data.
| [in] | aPrevServiceTlv | Set to nullptr to start from the beginning of the TLVs (finding the first matching Service TLV), or a pointer to the previous Service TLV returned from this method to iterate to the next matching Service TLV. |
| [in] | aServiceData | A Service Data to match with Service TLVs. |
| [in] | aServiceMatchMode | The Service Data match mode. |
nullptr if it cannot be found. References NetworkData::FindNextService(), and ServiceTlv::kThreadEnterpriseNumber.
|
protected |
This method sends a Server Data Notification message to the Leader.
| [in] | aRloc16 | The old RLOC16 value that was previously registered. |
| [in] | aAppendNetDataTlv | Indicates whether or not to append Thread Network Data TLV to the message. |
| [in] | aHandler | A function pointer that is called when the transaction ends. |
| [in] | aContext | A pointer to arbitrary context information. |
| kErrorNone | Successfully enqueued the notification message. |
| kErrorNoBufs | Insufficient message buffers to generate the notification message. |
References Message::Append(), Message::AppendBytes(), FreeMessageOnError, InstanceLocator::GetInstance(), IgnoreError(), Message::InitAsConfirmablePost(), ot::kErrorNoBufs, ot::kErrorNone, UriPath::kServerData, ot::Mac::kShortAddrInvalid, ThreadTlv::kThreadNetworkData, LogInfo, NetworkData::mLength, NetworkData::mTlvs, Tlv::SetLength(), Message::SetPayloadMarker(), MessageInfo::SetSockAddrToRlocPeerAddrToLeaderAloc(), ThreadTlv::SetType(), SuccessOrExit, and VerifyOrExit.
|
inlineexplicit |
|
inline |
Referenced by NetworkData::Iterate().
|
inline |
Referenced by NetworkData::Iterate().
|
inline |
Referenced by NetworkData::Iterate().
|
inline |
Referenced by NetworkData::Iterate().
|
inline |
Referenced by NetworkData::Iterate().
|
inline |
Referenced by NetworkData::Iterate().
|
inline |
Referenced by NetworkData::Iterate().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
References NetworkData::NetworkDataIterator::AdvaceSubTlv(), NetworkData::NetworkDataIterator::AdvanceTlv(), ExitNow, NetworkData::NetworkDataIterator::GetAndAdvanceIndex(), HasRouteTlv::GetEntry(), BorderRouterTlv::GetEntry(), InstanceLocator::GetInstance(), HasRouteTlv::GetNumEntries(), BorderRouterTlv::GetNumEntries(), HasRouteEntry::GetRloc(), BorderRouterEntry::GetRloc(), ServerTlv::GetServer16(), NetworkData::NetworkDataIterator::GetSubTlv(), NetworkData::NetworkDataIterator::GetTlv(), NetworkData::GetTlvsEnd(), NetworkData::NetworkDataIterator::IsNewEntry(), ot::kErrorNone, ot::kErrorNotFound, ot::Mac::kShortAddrBroadcast, NetworkDataTlv::kTypeBorderRouter, NetworkDataTlv::kTypeHasRoute, NetworkDataTlv::kTypePrefix, NetworkDataTlv::kTypeServer, NetworkDataTlv::kTypeService, NetworkData::NetworkDataIterator::MarkEntryAsNotNew(), NetworkData::Config::mExternalRoute, NetworkData::Config::mOnMeshPrefix, NetworkData::Config::mService, NetworkData::mTlvs, OnMeshPrefixConfig::SetFrom(), ExternalRouteConfig::SetFrom(), and ServiceConfig::SetFrom().
Referenced by NetworkData::ContainsEntriesFrom(), NetworkData::GetNextExternalRoute(), NetworkData::GetNextOnMeshPrefix(), NetworkData::GetNextServer(), and NetworkData::GetNextService().
|
staticprivate |
|
inline |
This constructor initializes the MutableNetworkData
| [in] | aInstance | A reference to the OpenThread instance. |
| [in] | aTlvs | A pointer to the buffer to store the TLVs. |
| [in] | aLength | The current length of the Network Data. |
| [in] | aSize | Size of the buffer aTlvs (maximum length). |
References NetworkData::GetBytes(), and NetworkData::GetLength().
|
inline |
This method returns the size of the buffer to store the mutable Network Data.
Referenced by NetworkData::CopyNetworkData().
|
inline |
This method returns a pointer to start of the TLVs in NetworkData.
References ot::AsConst(), ot::AsNonConst(), and MutableNetworkData::GetBytes().
Referenced by NetworkData::CopyNetworkData(), MutableNetworkData::GetBytes(), and LeaderBase::SetNetworkData().
|
inline |
This method clears the network data.
|
inlineprotected |
This method sets the Network Data length.
| [in] | aLength | The length. |
References NetworkData::GetTlvsStart().
Referenced by NetworkData::CopyNetworkData(), LeaderBase::Reset(), and LeaderBase::SetNetworkData().
|
inlineprotected |
This method returns a pointer to the start of Network Data TLV sequence.
References ot::AsConst(), ot::AsNonConst(), NetworkData::GetTlvsEnd(), and MutableNetworkData::GetTlvsStart().
Referenced by LeaderBase::ExternalRouteLookup(), LeaderBase::FindNextMatchingPrefix(), LeaderBase::GetCommissioningData(), LeaderBase::GetContext(), and MutableNetworkData::GetTlvsStart().
|
inlineprotected |
This method returns a pointer to the end of Network Data TLV sequence.
References ot::AsConst(), ot::AsNonConst(), NetworkData::FindPrefix(), and MutableNetworkData::GetTlvsEnd().
Referenced by LeaderBase::ExternalRouteLookup(), LeaderBase::FindNextMatchingPrefix(), LeaderBase::GetCommissioningData(), LeaderBase::GetContext(), and MutableNetworkData::GetTlvsEnd().
|
inlineprotected |
This method returns a pointer to a Prefix TLV.
| [in] | aPrefix | A pointer to an IPv6 prefix. |
| [in] | aPrefixLength | The prefix length pointed to by aPrefix (in bits). |
nullptr if no matching Prefix TLV exists. References ot::AsConst(), and ot::AsNonConst().
|
inlineprotected |
This method returns a pointer to a Prefix TLV.
| [in] | aPrefix | An IPv6 prefix. |
nullptr if no matching Prefix TLV exists. References MutableNetworkData::FindPrefix(), NetworkData::FindService(), Prefix::GetBytes(), and Prefix::GetLength().
Referenced by MutableNetworkData::FindPrefix().
|
inlineprotected |
This method returns a pointer to a matching Service TLV.
| [in] | aEnterpriseNumber | Enterprise Number. |
| [in] | aServiceData | A Service Data. |
| [in] | aServiceMatchMode | The Service Data match mode. |
References ot::AsConst(), and ot::AsNonConst().
|
inlineprotected |
|
protected |
This method grows the Network Data to append a TLV with a requested size.
On success, the returned TLV is not initialized (i.e., the TLV Length field is not set) but the requested size for it (aTlvSize number of bytes) is reserved in the Network Data.
| [in] | aTlvSize | The size of TLV (total number of bytes including Type, Length, and Value fields) |
nullptr if no space to grow the Network Data with requested aTlvSize number of bytes. References NetworkData::GetTlvsEnd(), NetworkData::mLength, and VerifyOrExit.
Referenced by LeaderBase::SetCommissioningData().
|
protected |
This method inserts bytes into the Network Data.
| [in] | aStart | A pointer to the beginning of the insertion. |
| [in] | aLength | The number of bytes to insert. |
References NetworkData::mLength, NetworkData::mTlvs, and OT_ASSERT.
|
protected |
This method removes bytes from the Network Data.
| [in] | aRemoveStart | A pointer to the beginning of the removal. |
| [in] | aRemoveLength | The number of bytes to remove. |
References NetworkData::GetBytes(), NetworkData::mLength, and OT_ASSERT.
|
protected |
This method removes a TLV from the Network Data.
| [in] | aTlv | The TLV to remove. |
References NetworkDataTlv::GetSize().
Referenced by LeaderBase::RemoveCommissioningData().
|
protected |
This method strips non-stable data from the Thread Network Data.
References NetworkDataTlv::GetNext(), PrefixTlv::GetSubTlvsLength(), ServiceTlv::GetSubTlvsLength(), NetworkData::GetTlvsEnd(), NetworkData::GetTlvsStart(), NetworkDataTlv::GetType(), NetworkDataTlv::IsStable(), NetworkDataTlv::kTypePrefix, and NetworkDataTlv::kTypeService.
Referenced by NetworkData::CopyNetworkData(), and LeaderBase::SetNetworkData().
|
private |
References PrefixTlv::FindSubTlv(), HasRouteTlv::GetFirstEntry(), BorderRouterTlv::GetFirstEntry(), HasRouteTlv::GetLastEntry(), BorderRouterTlv::GetLastEntry(), NetworkDataTlv::GetNext(), HasRouteEntry::GetNext(), BorderRouterEntry::GetNext(), NetworkDataTlv::GetSize(), PrefixTlv::GetSubTlvs(), PrefixTlv::GetSubTlvsLength(), NetworkDataTlv::GetType(), NetworkDataTlv::IsStable(), NetworkDataTlv::kTypeBorderRouter, NetworkDataTlv::kTypeHasRoute, and PrefixTlv::SetSubTlvsLength().
|
private |
| constexpr Iterator kIteratorInit = OT_NETWORK_DATA_ITERATOR_INIT |
Initializer for Iterator type.
Referenced by NetworkData::ContainsEntriesFrom(), NetworkData::ContainsExternalRoute(), NetworkData::ContainsOnMeshPrefix(), NetworkData::ContainsService(), NetworkData::FindBorderRouters(), LeaderBase::GetPreferredNat64Prefix(), LeaderBase::GetServiceId(), Mle::HandleNotifierEvents(), and Leader::UpdateDomainPrefixConfig().
|
static |
Maximum size of Thread Network Data in bytes.
Referenced by Mle::AppendNetworkData(), and LeaderBase::SetCommissioningData().
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
| OnMeshPrefixConfig* mOnMeshPrefix |
| ExternalRouteConfig* mExternalRoute |
| ServiceConfig* mService |
|
private |
|
private |
Referenced by MutableNetworkData::AppendTlv(), NetworkData::CopyNetworkData(), NetworkData::FindBorderRouters(), NetworkData::FindNextService(), NetworkData::FindPrefix(), NetworkData::FindService(), MutableNetworkData::Insert(), MutableNetworkData::Remove(), and NetworkData::SendServerDataNotification().
|
private |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |