History Tracker
Records the history of different events, for example RX and TX messages or network info changes.
Summary
All tracked entries are timestamped.
The functions in this module are available when OPENTHREAD_CONFIG_HISTORY_TRACKER_ENABLE
is enabled.
Typedefs |
|
---|---|
otHistoryTrackerExternalRouteInfo
|
typedef Represent a Network Data extern route info. |
otHistoryTrackerIterator
|
typedefstruct otHistoryTrackerIterator
Represents an iterator to iterate through a history list. |
otHistoryTrackerMessageInfo
|
typedefstruct otHistoryTrackerMessageInfo
Represents a RX/TX IPv6 message info. |
otHistoryTrackerMulticastAddressInfo
|
typedef Represent an IPv6 multicast address info. |
otHistoryTrackerNeighborInfo
|
typedefstruct otHistoryTrackerNeighborInfo
Represents a neighbor info. |
otHistoryTrackerNetworkInfo
|
typedefstruct otHistoryTrackerNetworkInfo
Represents Thread network info. |
otHistoryTrackerOnMeshPrefixInfo
|
typedef Represent a Network Data on mesh prefix info. |
otHistoryTrackerRouterInfo
|
typedefstruct otHistoryTrackerRouterInfo
Represents a router table entry event. |
otHistoryTrackerUnicastAddressInfo
|
typedef Represent a unicast IPv6 address info. |
Functions |
|
---|---|
otHistoryTrackerEntryAgeToString(uint32_t aEntryAge, char *aBuffer, uint16_t aSize)
|
void
Converts a given entry age to a human-readable string.
|
otHistoryTrackerInitIterator(otHistoryTrackerIterator *aIterator)
|
void
Initializes an
otHistoryTrackerIterator . |
otHistoryTrackerIterateExternalRouteHistory(otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge)
|
Iterates over the entries in the Network Data external route entry history list.
|
otHistoryTrackerIterateMulticastAddressHistory(otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge)
|
Iterates over the entries in the multicast address history list.
|
otHistoryTrackerIterateNeighborHistory(otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge)
|
const otHistoryTrackerNeighborInfo *
Iterates over the entries in the neighbor history list.
|
otHistoryTrackerIterateNetInfoHistory(otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge)
|
const otHistoryTrackerNetworkInfo *
Iterates over the entries in the network info history list.
|
otHistoryTrackerIterateOnMeshPrefixHistory(otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge)
|
const otHistoryTrackerOnMeshPrefixInfo *
Iterates over the entries in the Network Data on mesh prefix entry history list.
|
otHistoryTrackerIterateRouterHistory(otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge)
|
const otHistoryTrackerRouterInfo *
Iterates over the entries in the router history list.
|
otHistoryTrackerIterateRxHistory(otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge)
|
const otHistoryTrackerMessageInfo *
Iterates over the entries in the RX message history list.
|
otHistoryTrackerIterateTxHistory(otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge)
|
const otHistoryTrackerMessageInfo *
Iterates over the entries in the TX message history list.
|
otHistoryTrackerIterateUnicastAddressHistory(otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge)
|
Iterates over the entries in the unicast address history list.
|
Macros |
|
---|---|
OT_HISTORY_TRACKER_ENTRY_AGE_STRING_SIZE 21
|
Recommended size for string representation of an entry age.
|
OT_HISTORY_TRACKER_INFINITE_PATH_COST 0
|
Infinite path cost - used in
otHistoryTrackerRouterInfo . |
OT_HISTORY_TRACKER_MAX_AGE (49 * 24 * 60 * 60 * 1000u)
|
This constant specifies the maximum age of entries which is 49 days (in msec).
|
OT_HISTORY_TRACKER_NO_NEXT_HOP 63
|
No next hop - For
mNextHop in otHistoryTrackerRouterInfo . |
Structs |
|
---|---|
otHistoryTrackerExternalRouteInfo |
Represent a Network Data extern route info. |
otHistoryTrackerIterator |
Represents an iterator to iterate through a history list. |
otHistoryTrackerMessageInfo |
Represents a RX/TX IPv6 message info. |
otHistoryTrackerMulticastAddressInfo |
Represent an IPv6 multicast address info. |
otHistoryTrackerNeighborInfo |
Represents a neighbor info. |
otHistoryTrackerNetworkInfo |
Represents Thread network info. |
otHistoryTrackerOnMeshPrefixInfo |
Represent a Network Data on mesh prefix info. |
otHistoryTrackerRouterInfo |
Represents a router table entry event. |
otHistoryTrackerUnicastAddressInfo |
Represent a unicast IPv6 address info. |
Enumerations
Anonymous Enum 2
Anonymous Enum 2
Constants representing message priority used in otHistoryTrackerMessageInfo
struct.
otHistoryTrackerAddressEvent
otHistoryTrackerAddressEvent
otHistoryTrackerNeighborEvent
otHistoryTrackerNeighborEvent
Defines the events in a neighbor info (i.e.
whether neighbor is added, removed, or changed).
Event OT_HISTORY_TRACKER_NEIGHBOR_EVENT_RESTORING
is applicable to child neighbors only. It is triggered after the device (re)starts and when the previous children list is retrieved from non-volatile settings and the device tries to restore connection to them.
otHistoryTrackerNetDataEvent
otHistoryTrackerNetDataEvent
otHistoryTrackerRouterEvent
otHistoryTrackerRouterEvent
Defines the events in a router info (i.e.
whether router is added, removed, or changed).
Typedefs
otHistoryTrackerExternalRouteInfo
struct otHistoryTrackerExternalRouteInfo otHistoryTrackerExternalRouteInfo
Represent a Network Data extern route info.
otHistoryTrackerIterator
struct otHistoryTrackerIterator otHistoryTrackerIterator
Represents an iterator to iterate through a history list.
The fields in this type are opaque (intended for use by OpenThread core) and therefore should not be accessed/used by caller.
Before using an iterator, it MUST be initialized using otHistoryTrackerInitIterator()
,
otHistoryTrackerMessageInfo
struct otHistoryTrackerMessageInfo otHistoryTrackerMessageInfo
Represents a RX/TX IPv6 message info.
Some of the fields in this struct are applicable to a RX message or a TX message only, e.g., mAveRxRss
is the average RSS of all fragment frames that form a received message and is only applicable for a RX message.
otHistoryTrackerMulticastAddressInfo
struct otHistoryTrackerMulticastAddressInfo otHistoryTrackerMulticastAddressInfo
Represent an IPv6 multicast address info.
otHistoryTrackerNeighborInfo
struct otHistoryTrackerNeighborInfo otHistoryTrackerNeighborInfo
Represents a neighbor info.
otHistoryTrackerNetworkInfo
struct otHistoryTrackerNetworkInfo otHistoryTrackerNetworkInfo
Represents Thread network info.
otHistoryTrackerOnMeshPrefixInfo
struct otHistoryTrackerOnMeshPrefixInfo otHistoryTrackerOnMeshPrefixInfo
Represent a Network Data on mesh prefix info.
otHistoryTrackerRouterInfo
struct otHistoryTrackerRouterInfo otHistoryTrackerRouterInfo
Represents a router table entry event.
otHistoryTrackerUnicastAddressInfo
struct otHistoryTrackerUnicastAddressInfo otHistoryTrackerUnicastAddressInfo
Represent a unicast IPv6 address info.
Functions
otHistoryTrackerEntryAgeToString
void otHistoryTrackerEntryAgeToString( uint32_t aEntryAge, char *aBuffer, uint16_t aSize )
Converts a given entry age to a human-readable string.
The entry age string follows the format hours:minutes:seconds:milliseconds
(if shorter than one day) or days:hours:minutes:seconds
(if longer than one day).
If the resulting string does not fit in aBuffer
(within its aSize
characters), the string will be truncated but the outputted string is always null-terminated.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otHistoryTrackerInitIterator
void otHistoryTrackerInitIterator( otHistoryTrackerIterator *aIterator )
Initializes an otHistoryTrackerIterator
.
An iterator MUST be initialized before it is used.
An iterator can be initialized again to start from the beginning of the list.
When iterating over entries in a list, to ensure the entry ages are consistent, the age is given relative to the time the iterator was initialized, i.e., the entry age is provided as the duration (in milliseconds) from the event (when entry was recorded) to the iterator initialization time.
Details | |||
---|---|---|---|
Parameters |
|
otHistoryTrackerIterateExternalRouteHistory
const otHistoryTrackerExternalRouteInfo * otHistoryTrackerIterateExternalRouteHistory( otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge )
Iterates over the entries in the Network Data external route entry history list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
The
otHistoryTrackerExternalRouteInfo entry or NULL if no more entries in the list. |
otHistoryTrackerIterateMulticastAddressHistory
const otHistoryTrackerMulticastAddressInfo * otHistoryTrackerIterateMulticastAddressHistory( otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge )
Iterates over the entries in the multicast address history list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
A pointer to
otHistoryTrackerMulticastAddressInfo entry or NULL if no more entries in the list. |
otHistoryTrackerIterateNeighborHistory
const otHistoryTrackerNeighborInfo * otHistoryTrackerIterateNeighborHistory( otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge )
Iterates over the entries in the neighbor history list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
The
otHistoryTrackerNeighborInfo entry or NULL if no more entries in the list. |
otHistoryTrackerIterateNetInfoHistory
const otHistoryTrackerNetworkInfo * otHistoryTrackerIterateNetInfoHistory( otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge )
Iterates over the entries in the network info history list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
A pointer to
otHistoryTrackerNetworkInfo entry or NULL if no more entries in the list. |
otHistoryTrackerIterateOnMeshPrefixHistory
const otHistoryTrackerOnMeshPrefixInfo * otHistoryTrackerIterateOnMeshPrefixHistory( otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge )
Iterates over the entries in the Network Data on mesh prefix entry history list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
The
otHistoryTrackerOnMeshPrefixInfo entry or NULL if no more entries in the list. |
otHistoryTrackerIterateRouterHistory
const otHistoryTrackerRouterInfo * otHistoryTrackerIterateRouterHistory( otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge )
Iterates over the entries in the router history list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
The
otHistoryTrackerRouterInfo entry or NULL if no more entries in the list. |
otHistoryTrackerIterateRxHistory
const otHistoryTrackerMessageInfo * otHistoryTrackerIterateRxHistory( otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge )
Iterates over the entries in the RX message history list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
The
otHistoryTrackerMessageInfo entry or NULL if no more entries in the list. |
otHistoryTrackerIterateTxHistory
const otHistoryTrackerMessageInfo * otHistoryTrackerIterateTxHistory( otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge )
Iterates over the entries in the TX message history list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
The
otHistoryTrackerMessageInfo entry or NULL if no more entries in the list. |
otHistoryTrackerIterateUnicastAddressHistory
const otHistoryTrackerUnicastAddressInfo * otHistoryTrackerIterateUnicastAddressHistory( otInstance *aInstance, otHistoryTrackerIterator *aIterator, uint32_t *aEntryAge )
Iterates over the entries in the unicast address history list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
A pointer to
otHistoryTrackerUnicastAddressInfo entry or NULL if no more entries in the list. |
Macros
OT_HISTORY_TRACKER_ENTRY_AGE_STRING_SIZE
OT_HISTORY_TRACKER_ENTRY_AGE_STRING_SIZE 21
Recommended size for string representation of an entry age.
OT_HISTORY_TRACKER_INFINITE_PATH_COST
OT_HISTORY_TRACKER_INFINITE_PATH_COST 0
Infinite path cost - used in otHistoryTrackerRouterInfo
.
OT_HISTORY_TRACKER_MAX_AGE
OT_HISTORY_TRACKER_MAX_AGE (49 * 24 * 60 * 60 * 1000u)
This constant specifies the maximum age of entries which is 49 days (in msec).
Entries older than the max age will give this value as their age.
OT_HISTORY_TRACKER_NO_NEXT_HOP
OT_HISTORY_TRACKER_NO_NEXT_HOP 63
No next hop - For mNextHop
in otHistoryTrackerRouterInfo
.
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.