0.01.00

This module includes definitions for managing Thread Network Data. More...

Classes

class  ot::NetworkData::NetworkData
 This class implements Network Data processing. More...
 

Enumerations

enum  { ot::NetworkData::NetworkData::kMaxSize = 255 }
 

Functions

 ot::NetworkData::NetworkData::NetworkData (Instance &aInstance, bool aLocal)
 This constructor initializes the object. More...
 
void ot::NetworkData::NetworkData::Clear (void)
 This method clears the network data.
 
otError ot::NetworkData::NetworkData::GetNetworkData (bool aStable, uint8_t *aData, uint8_t &aDataLength)
 This method provides a full or stable copy of the Thread Network Data. More...
 
otError ot::NetworkData::NetworkData::GetNextOnMeshPrefix (otNetworkDataIterator *aIterator, otBorderRouterConfig *aConfig)
 This method provides the next On Mesh prefix in the Thread Network Data. More...
 
otError ot::NetworkData::NetworkData::GetNextOnMeshPrefix (otNetworkDataIterator *aIterator, uint16_t aRloc16, otBorderRouterConfig *aConfig)
 This method provides the next On Mesh prefix in the Thread Network Data for a given RLOC16. More...
 
otError ot::NetworkData::NetworkData::GetNextExternalRoute (otNetworkDataIterator *aIterator, otExternalRouteConfig *aConfig)
 This method provides the next external route in the Thread Network Data. More...
 
otError ot::NetworkData::NetworkData::GetNextExternalRoute (otNetworkDataIterator *aIterator, uint16_t aRloc16, otExternalRouteConfig *aConfig)
 This method provides the next external route in the Thread Network Data for a given RLOC16. More...
 
bool ot::NetworkData::NetworkData::ContainsOnMeshPrefixes (NetworkData &aCompare, uint16_t aRloc16)
 This method indicates whether or not the Thread Network Data contains all of the on mesh prefix information in aCompare associated with aRloc16. More...
 
bool ot::NetworkData::NetworkData::ContainsExternalRoutes (NetworkData &aCompare, uint16_t aRloc16)
 This method indicates whether or not the Thread Network Data contains all of the external route information in aCompare associated with aRloc16. More...
 
void ot::NetworkData::NetworkData::ClearResubmitDelayTimer (void)
 This method cancels the data resubmit delay timer.
 
BorderRouterTlvot::NetworkData::NetworkData::FindBorderRouter (PrefixTlv &aPrefix)
 This method returns a pointer to the Border Router TLV within a given Prefix TLV. More...
 
BorderRouterTlvot::NetworkData::NetworkData::FindBorderRouter (PrefixTlv &aPrefix, bool aStable)
 This method returns a pointer to the stable or non-stable Border Router TLV within a given Prefix TLV. More...
 
HasRouteTlvot::NetworkData::NetworkData::FindHasRoute (PrefixTlv &aPrefix)
 This method returns a pointer to the Has Route TLV within a given Prefix TLV. More...
 
HasRouteTlvot::NetworkData::NetworkData::FindHasRoute (PrefixTlv &aPrefix, bool aStable)
 This method returns a pointer to the stable or non-stable Has Route TLV within a given Prefix TLV. More...
 
ContextTlvot::NetworkData::NetworkData::FindContext (PrefixTlv &aPrefix)
 This method returns a pointer to the Context TLV within a given Prefix TLV. More...
 
PrefixTlvot::NetworkData::NetworkData::FindPrefix (const uint8_t *aPrefix, uint8_t aPrefixLength)
 This method returns a pointer to a Prefix TLV. More...
 
PrefixTlvot::NetworkData::NetworkData::FindPrefix (const uint8_t *aPrefix, uint8_t aPrefixLength, uint8_t *aTlvs, uint8_t aTlvsLength)
 This method returns a pointer to a Prefix TLV in a specified tlvs buffer. More...
 
otError ot::NetworkData::NetworkData::Insert (uint8_t *aStart, uint8_t aLength)
 This method inserts bytes into the Network Data. More...
 
otError ot::NetworkData::NetworkData::Remove (uint8_t *aStart, uint8_t aLength)
 This method removes bytes from the Network Data. More...
 
void ot::NetworkData::NetworkData::RemoveTemporaryData (uint8_t *aData, uint8_t &aDataLength)
 This method strips non-stable data from the Thread Network Data. More...
 
void ot::NetworkData::NetworkData::RemoveTemporaryData (uint8_t *aData, uint8_t &aDataLength, PrefixTlv &aPrefix)
 This method strips non-stable Sub-TLVs from a Prefix TLV. More...
 
int8_t ot::NetworkData::NetworkData::PrefixMatch (const uint8_t *a, const uint8_t *b, uint8_t aLength)
 This method computes the number of IPv6 Prefix bits that match. More...
 
otError ot::NetworkData::NetworkData::SendServerDataNotification (uint16_t aRloc16)
 This method sends a Server Data Notification message to the Leader. More...
 
 ot::NetworkData::NetworkData::NetworkDataIterator::NetworkDataIterator (otNetworkDataIterator *aIterator)
 
uint8_t ot::NetworkData::NetworkData::NetworkDataIterator::GetTlvOffset (void) const
 
uint8_t ot::NetworkData::NetworkData::NetworkDataIterator::GetSubTlvOffset (void) const
 
uint8_t ot::NetworkData::NetworkData::NetworkDataIterator::GetEntryIndex (void) const
 
void ot::NetworkData::NetworkData::NetworkDataIterator::SetTlvOffset (uint8_t aOffset)
 
void ot::NetworkData::NetworkData::NetworkDataIterator::SetSubTlvOffset (uint8_t aOffset)
 
void ot::NetworkData::NetworkData::NetworkDataIterator::SetEntryIndex (uint8_t aIndex)
 
void ot::NetworkData::NetworkData::NetworkDataIterator::SaveTlvOffset (const NetworkDataTlv *aTlv, const uint8_t *aTlvs)
 
void ot::NetworkData::NetworkData::NetworkDataIterator::SaveSubTlvOffset (const NetworkDataTlv *aSubTlv, const NetworkDataTlv *aSubTlvs)
 

Variables

uint8_t ot::NetworkData::NetworkData::mTlvs [kMaxSize]
 The Network Data buffer.
 

Detailed Description

This module includes definitions for managing Thread Network Data.

Enumeration Type Documentation

§ anonymous enum

anonymous enum
Enumerator
kMaxSize 

Maximum size of Thread Network Data in bytes.

Function Documentation

§ ContainsExternalRoutes()

bool ot::NetworkData::NetworkData::ContainsExternalRoutes ( NetworkData aCompare,
uint16_t  aRloc16 
)

This method indicates whether or not the Thread Network Data contains all of the external route information in aCompare associated with aRloc16.

Parameters
[in]aCompareThe Network Data to use for the query.
[in]aRloc16The RLOC16 to consider.
Returns
TRUE if this object contains all external route information in aCompare associated with aRloc16, FALSE otherwise.

§ ContainsOnMeshPrefixes()

bool ot::NetworkData::NetworkData::ContainsOnMeshPrefixes ( NetworkData aCompare,
uint16_t  aRloc16 
)

This method indicates whether or not the Thread Network Data contains all of the on mesh prefix information in aCompare associated with aRloc16.

Parameters
[in]aCompareThe Network Data to use for the query.
[in]aRloc16The RLOC16 to consider.
Returns
TRUE if this object contains all on mesh prefix information in aCompare associated with aRloc16, FALSE otherwise.

§ FindBorderRouter() [1/2]

BorderRouterTlv * ot::NetworkData::NetworkData::FindBorderRouter ( PrefixTlv aPrefix)
protected

This method returns a pointer to the Border Router TLV within a given Prefix TLV.

Parameters
[in]aPrefixA reference to the Prefix TLV.
Returns
A pointer to the Border Router TLV if one is found or NULL if no Border Router TLV exists.

§ FindBorderRouter() [2/2]

BorderRouterTlv * ot::NetworkData::NetworkData::FindBorderRouter ( PrefixTlv aPrefix,
bool  aStable 
)
protected

This method returns a pointer to the stable or non-stable Border Router TLV within a given Prefix TLV.

Parameters
[in]aPrefixA reference to the Prefix TLV.
[in]aStableTRUE if requesting a stable Border Router TLV, FALSE otherwise.
Returns
A pointer to the Border Router TLV if one is found or NULL if no Border Router TLV exists.

§ FindContext()

ContextTlv * ot::NetworkData::NetworkData::FindContext ( PrefixTlv aPrefix)
protected

This method returns a pointer to the Context TLV within a given Prefix TLV.

Parameters
[in]aPrefixA reference to the Prefix TLV.
Returns
A pointer to the Context TLV is one is found or NULL if no Context TLV exists.

§ FindHasRoute() [1/2]

HasRouteTlv * ot::NetworkData::NetworkData::FindHasRoute ( PrefixTlv aPrefix)
protected

This method returns a pointer to the Has Route TLV within a given Prefix TLV.

Parameters
[in]aPrefixA reference to the Prefix TLV.
Returns
A pointer to the Has Route TLV if one is found or NULL if no Has Route TLV exists.

§ FindHasRoute() [2/2]

HasRouteTlv * ot::NetworkData::NetworkData::FindHasRoute ( PrefixTlv aPrefix,
bool  aStable 
)
protected

This method returns a pointer to the stable or non-stable Has Route TLV within a given Prefix TLV.

Parameters
[in]aPrefixA reference to the Prefix TLV.
[in]aStableTRUE if requesting a stable Has Route TLV, FALSE otherwise.
Returns
A pointer to the Has Route TLV if one is found or NULL if no Has Route TLV exists.

§ FindPrefix() [1/2]

PrefixTlv * ot::NetworkData::NetworkData::FindPrefix ( const uint8_t *  aPrefix,
uint8_t  aPrefixLength 
)
protected

This method returns a pointer to a Prefix TLV.

Parameters
[in]aPrefixA pointer to an IPv6 prefix.
[in]aPrefixLengthThe prefix length pointed to by aPrefix.
Returns
A pointer to the Prefix TLV is one is found or NULL if no matching Prefix TLV exists.

§ FindPrefix() [2/2]

PrefixTlv * ot::NetworkData::NetworkData::FindPrefix ( const uint8_t *  aPrefix,
uint8_t  aPrefixLength,
uint8_t *  aTlvs,
uint8_t  aTlvsLength 
)
protected

This method returns a pointer to a Prefix TLV in a specified tlvs buffer.

Parameters
[in]aPrefixA pointer to an IPv6 prefix.
[in]aPrefixLengthThe prefix length pointed to by aPrefix.
[in]aTlvsA pointer to a specified tlvs buffer.
[in]aTlvsLengthThe specified tlvs buffer length pointed to by aTlvs.
Returns
A pointer to the Prefix TLV is one is found or NULL if no matching Prefix TLV exists.

§ GetNetworkData()

otError ot::NetworkData::NetworkData::GetNetworkData ( bool  aStable,
uint8_t *  aData,
uint8_t &  aDataLength 
)

This method provides a full or stable copy of the Thread Network Data.

Parameters
[in]aStableTRUE when copying the stable version, FALSE when copying the full version.
[out]aDataA pointer to the data buffer.
[in,out]aDataLengthOn entry, size of the data buffer pointed to by aData. On exit, number of copied bytes.
Return values
OT_ERROR_NONESuccessfully copied full Thread Network Data.
OT_ERROR_NO_BUFSNot enough space to fully copy Thread Network Data.

§ GetNextExternalRoute() [1/2]

otError ot::NetworkData::NetworkData::GetNextExternalRoute ( otNetworkDataIterator aIterator,
otExternalRouteConfig aConfig 
)

This method provides the next external route in the Thread Network Data.

Parameters
[in,out]aIteratorA pointer to the Network Data iterator context.
[out]aConfigA pointer to where the external route information will be placed.
Return values
OT_ERROR_NONESuccessfully found the next external route.
OT_ERROR_NOT_FOUNDNo subsequent external route exists in the Thread Network Data.

§ GetNextExternalRoute() [2/2]

otError ot::NetworkData::NetworkData::GetNextExternalRoute ( otNetworkDataIterator aIterator,
uint16_t  aRloc16,
otExternalRouteConfig aConfig 
)

This method provides the next external route in the Thread Network Data for a given RLOC16.

Parameters
[in,out]aIteratorA pointer to the Network Data iterator context.
[in]aRloc16The RLOC16 value.
[out]aConfigA pointer to where the external route information will be placed.
Return values
OT_ERROR_NONESuccessfully found the next external route.
OT_ERROR_NOT_FOUNDNo subsequent external route exists in the Thread Network Data.

§ GetNextOnMeshPrefix() [1/2]

otError ot::NetworkData::NetworkData::GetNextOnMeshPrefix ( otNetworkDataIterator aIterator,
otBorderRouterConfig aConfig 
)

This method provides the next On Mesh prefix in the Thread Network Data.

Parameters
[in,out]aIteratorA pointer to the Network Data iterator context.
[out]aConfigA pointer to where the On Mesh Prefix information will be placed.
Return values
OT_ERROR_NONESuccessfully found the next On Mesh prefix.
OT_ERROR_NOT_FOUNDNo subsequent On Mesh prefix exists in the Thread Network Data.

§ GetNextOnMeshPrefix() [2/2]

otError ot::NetworkData::NetworkData::GetNextOnMeshPrefix ( otNetworkDataIterator aIterator,
uint16_t  aRloc16,
otBorderRouterConfig aConfig 
)

This method provides the next On Mesh prefix in the Thread Network Data for a given RLOC16.

Parameters
[in,out]aIteratorA pointer to the Network Data iterator context.
[in]aRloc16The RLOC16 value.
[out]aConfigA pointer to where the On Mesh Prefix information will be placed.
Return values
OT_ERROR_NONESuccessfully found the next On Mesh prefix.
OT_ERROR_NOT_FOUNDNo subsequent On Mesh prefix exists in the Thread Network Data.

§ Insert()

otError ot::NetworkData::NetworkData::Insert ( uint8_t *  aStart,
uint8_t  aLength 
)
protected

This method inserts bytes into the Network Data.

Parameters
[in]aStartA pointer to the beginning of the insertion.
[in]aLengthThe number of bytes to insert.
Return values
OT_ERROR_NONESuccessfully inserted bytes.
OT_ERROR_NO_BUFSInsufficient buffer space to insert bytes.

§ NetworkData()

ot::NetworkData::NetworkData::NetworkData ( Instance aInstance,
bool  aLocal 
)

This constructor initializes the object.

Parameters
[in]aInstanceA reference to the OpenThread instance.
[in]aLocalTRUE if this represents local network data, FALSE otherwise.

§ PrefixMatch()

int8_t ot::NetworkData::NetworkData::PrefixMatch ( const uint8_t *  a,
const uint8_t *  b,
uint8_t  aLength 
)
protected

This method computes the number of IPv6 Prefix bits that match.

Parameters
[in]aA pointer to the first IPv6 Prefix.
[in]bA pointer to the second IPv6 prefix.
[in]aLengthThe maximum length in bits to compare.
Returns
The number of matching bits.

§ Remove()

otError ot::NetworkData::NetworkData::Remove ( uint8_t *  aStart,
uint8_t  aLength 
)
protected

This method removes bytes from the Network Data.

Parameters
[in]aStartA pointer to the beginning of the removal.
[in]aLengthThe number of bytes to remove.
Return values
OT_ERROR_NONESuccessfully removed bytes.

§ RemoveTemporaryData() [1/2]

void ot::NetworkData::NetworkData::RemoveTemporaryData ( uint8_t *  aData,
uint8_t &  aDataLength 
)
protected

This method strips non-stable data from the Thread Network Data.

Parameters
[in,out]aDataA pointer to the Network Data to modify.
[in,out]aDataLengthOn entry, the size of the Network Data in bytes. On exit, the size of the resulting Network Data in bytes.

§ RemoveTemporaryData() [2/2]

void ot::NetworkData::NetworkData::RemoveTemporaryData ( uint8_t *  aData,
uint8_t &  aDataLength,
PrefixTlv aPrefix 
)
protected

This method strips non-stable Sub-TLVs from a Prefix TLV.

Parameters
[in,out]aDataA pointer to the Network Data to modify.
[in,out]aDataLengthOn entry, the size of the Network Data in bytes. On exit, the size of the resulting Network Data in bytes.
[in,out]aPrefixA reference to the Prefix TLV to modify.

§ SendServerDataNotification()

otError ot::NetworkData::NetworkData::SendServerDataNotification ( uint16_t  aRloc16)
protected

This method sends a Server Data Notification message to the Leader.

Parameters
[in]aRloc16The old RLOC16 value that was previously registered.
Return values
OT_ERROR_NONESuccessfully enqueued the notification message.
OT_ERROR_NO_BUFSInsufficient message buffers to generate the notification message.