# History Tracker

# 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.

| ### Enumerations ||
|---|---|
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gadf764cbdea00d65edcd07bb9953ad2b7{ https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadf764cbdea00d65edcd07bb9953ad2b7a03851b1648b77d602556b871bf4be78b = OT_MESSAGE_PRIORITY_LOW, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadf764cbdea00d65edcd07bb9953ad2b7aa3bc23e6957d5848ef8fe874a199d20a = OT_MESSAGE_PRIORITY_NORMAL, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadf764cbdea00d65edcd07bb9953ad2b7a371a583854266215dd8f6da9894621cb = OT_MESSAGE_PRIORITY_HIGH, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadf764cbdea00d65edcd07bb9953ad2b7a5ee785e54aad3313378960d339b37fad = OT_MESSAGE_PRIORITY_HIGH + 1 }` | enumConstants representing message priority used in `https://openthread.io/reference/struct/ot-history-tracker-message-info` struct. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gac2f09439c035505a56eb6f1253551dd2{ https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggac2f09439c035505a56eb6f1253551dd2aacdf7d17158f46240a228b2100ab5f38 = 0, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggac2f09439c035505a56eb6f1253551dd2abc7c25e70a848a6053523e69839a8886 = 1 }` | enumDefines the events for an IPv6 (unicast or multicast) address info (i.e., whether address is added or removed). |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga8e2c4fcb6dc19e0513c3d506f8f6079f{ https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gga8e2c4fcb6dc19e0513c3d506f8f6079fa9c4113101a112caadac7e39ece3a6cb9 = 0, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gga8e2c4fcb6dc19e0513c3d506f8f6079fa5dfaa220994c5274419cc4bd6e7b576b = 1, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gga8e2c4fcb6dc19e0513c3d506f8f6079fa8ac092b6f5bc2f23d31b4d98c52bba87 = 2 }` | enumDefines events for discovered routers on an Adjacent Infrastructure Link (AIL). |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gadc128e2a1951ebcd26efe78be18899bd{ https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bda205dc589cce09fad750fa805903f7e96, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bda7a51e1002ae01e3c2c0290be6171ceea, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bda61f4afaa93d403c92bcaf5b1489b971f, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bda3de4d697b04ed6cae199bb7f056050dc, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bda2e907f5249c2dd56fde751ba737b5128, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bdace59d834ca561246f1f30c9129ea73a4, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bda5d1a16541f4da4df1e58dcf3051ae40d, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bdaf4bd045e6a0d68b74bb1e8479fa5a1cb, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bdac6434da7627ddbcf41c8cc5e552a32e8, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bda6f065c87474b6bc319ad488945faa4db, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bdae310dc7a27308ec4e74c8ed1c1a6d327, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bdadd5322641512f173fb5d7de41a5ac1e4, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggadc128e2a1951ebcd26efe78be18899bda6f47634d37e209bafd3132c0a07a8eaa }` | enumRepresents events during the Border Agent's ePSKc journey. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gafb47bf0b11f8ab63b306331481d78d11{ https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggafb47bf0b11f8ab63b306331481d78d11a88cea37b83b8d2b30290dcd5b4a0b6b6, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggafb47bf0b11f8ab63b306331481d78d11a4872d2c4f2b07463028919b83dffb77d, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggafb47bf0b11f8ab63b306331481d78d11a5a9caf5727771b3546675cd7747faa36 }` | enumRepresents the DNS/SRP server address type parsed from Network Data service entries. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga38a97807a1ebf10b4938f25fc431123d{ https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gga38a97807a1ebf10b4938f25fc431123da28377c9a8c654343aa16982844fb521c = 0, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gga38a97807a1ebf10b4938f25fc431123da02f9db1ee484a63e895ded103aab1de4 = 1, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gga38a97807a1ebf10b4938f25fc431123da10c60004af7ef6aadb19a1314cee29de = 2, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gga38a97807a1ebf10b4938f25fc431123da42f87a91b8bfea4d3ad4ce9c1385e94c = 3 }` | enumDefines the events in a neighbor info (i.e. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gaca44bda447472cf67a5ee42466b27e3b{ https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggaca44bda447472cf67a5ee42466b27e3ba6dfd4e8eada6968382e0bd8fdbf8451d = 0, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggaca44bda447472cf67a5ee42466b27e3ba88a94485c944a6503e533ab697ca4c7b = 1 }` | enumDefines the events for a Network Data entry (i.e., whether an entry is added or removed). |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gabedb147b240c5716440481dd052e9128{ https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggabedb147b240c5716440481dd052e9128aad0c0d8dba5bc161442abbfa41f5ef7f = 0, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggabedb147b240c5716440481dd052e9128a8f41e250894a1bc9c7b5498a1d2ac05a = 1, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggabedb147b240c5716440481dd052e9128a904a4c7ae0e316814ead1ab704fde2aa = 2, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ggabedb147b240c5716440481dd052e9128acfb7ada8b03cd831cb861028d68d540d = 3 }` | enumDefines the events in a router info (i.e. |

| ### Typedefs ||
|---|---|
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gac0d59dbe2ab0a67ed644e2e5f0b5caca` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-ail-router` Represents information about a discovered router on an Adjacent Infrastructure Link (AIL). |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gae4aca2d9d4a1b30d3611b8305c697b0c` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-dhcp6-pd-info` Represents the DHCPv6-PD state and delegated prefix (if any) by a device acting as Border Router (BR). |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga3f0e53ddadf681aca7744aa5120cc270` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-dns-srp-addr-info` Represents DNS/SRP server address information parsed from a Network Data service entry. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga46f0f4aaa46a9ffcb5e30b97f06d3f05` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-external-route-info` Represent a Network Data extern route info. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga8a6442cd4da4f9384d4722a03e629188` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-favored-omr-prefix` Represents a favored OMR prefix tracked by a device acting as a Border Router (BR). |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gada3dd2aa9c73bd810c3ff301dbb52a24` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-favored-on-link-prefix` Represents a favored on-link prefix on AIL tracked by a device acting as a Border Router (BR). |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gaa3b8ef29a05b95e17b70b5f4923ef5c6` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-iterator` Represents an iterator to iterate through a history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga3f14f55eca660f5ff9b14865c714ecd6` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-message-info` Represents a RX/TX IPv6 message info. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga91e11ce7645076e95aac9b229ca682a0` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-multicast-address-info` Represent an IPv6 multicast address info. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga022f501dba5d1cba93de75dbf78b7939` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-neighbor-info` Represents a neighbor info. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga393616d1c1d3731ad06250474845e2b2)(otError aError, const otHistoryTrackerNetworkInfo *aNetworkInfo, uint32_t aEntryAge, void *aContext)` | typedef `void(*` Callback function pointer type to report the retrieved Network Info entries from a query to another device. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gabc4d65d6eb69ff643323fec79a4503cb` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-network-info` Represents Thread network info. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga9df585f0bf6c129b6202f8a743955fb9` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-on-mesh-prefix-info` Represent a Network Data on mesh prefix info. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga834c526d45e8d70bcd0f48e8b8566436` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-router-info` Represents a router table entry event. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gafda100dc00dc0de4eb96a4facf879060` | typedef `struct https://openthread.io/reference/struct/ot-history-tracker-unicast-address-info` Represent a unicast IPv6 address info. |

| ### Functions ||
|---|---|
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga29dea25bf9865cdedd87f6017bb6bbba(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Cancels any ongoing query. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga1f045c3cde042908e874d762e8141cfb(uint32_t aEntryAge, char *aBuffer, uint16_t aSize)` | `void` Converts a given entry age to a human-readable string. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gad823d66555d7a3c30aa2b72f1c2a573d(https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator)` | `void` Initializes an `https://openthread.io/reference/struct/ot-history-tracker-iterator`. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga0607d99fe742e0c8260d3c48afcc0627(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-ail-router *` Iterates over the entries in the BR AIL routers history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga5ad7697bc98669b57c061c714df4c7ed(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gadc128e2a1951ebcd26efe78be18899bd *` Iterates over the entries in the Border Agent ePSKc history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga9213d013815cbdb8ed33eea9a1c90a6d(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-dhcp6-pd-info *` Iterates over the entries in the DHCPv6-PD history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga620263e19f819f25321b39f5393e9be1(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-dns-srp-addr-info *` Iterates over the entries in the Network Data SRP/DNS address history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gab658e8b7a1b0dbe6f43152220404c3b3(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-external-route-info *` Iterates over the entries in the Network Data external route entry history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gabdcfc0473059a9fb86ff42272f92eb67(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-favored-omr-prefix *` Iterates over the entries in the favored OMR prefix history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga2dc86340d5c0a8e73ddf602a05d70db3(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-favored-on-link-prefix *` Iterates over the entries in the favored on-link prefix history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gac6eddd7dd030228042ed74bfadf2196a(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-multicast-address-info *` Iterates over the entries in the multicast address history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga7f7b77402dcea3788262def7ef68647e(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-neighbor-info *` Iterates over the entries in the neighbor history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gaf5edfdefe128a9a37c5b5690b2ae46c3(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-network-info *` Iterates over the entries in the network info history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga06eebd5ab28fd79164999bb6d9e29d80(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-on-mesh-prefix-info *` Iterates over the entries in the Network Data on mesh prefix entry history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gabb4a52d7f6e60e6d841de9fcf88c6c71(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-router-info *` Iterates over the entries in the router history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga547778323fd8c08d52986c1bf2134b20(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-message-info *` Iterates over the entries in the RX message history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga6593cf8bbb31f637db9ca366923b819b(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-message-info *` Iterates over the entries in the TX message history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gaa7807ba275991051720425eae86a40c7(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-history-tracker-iterator *aIterator, uint32_t *aEntryAge)` | `const https://openthread.io/reference/struct/ot-history-tracker-unicast-address-info *` Iterates over the entries in the unicast address history list. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga86f5347ce156c7f788a8b835f466f008(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint16_t aRloc16, uint16_t aMaxEntries, uint32_t aMaxEntryAge, https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga393616d1c1d3731ad06250474845e2b2 aCallback, void *aContext)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Queries for Network Info history entries from a specified RLOC16. |

| ### Macros ||
|---|---|
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga3d519c30df331d1846ba8ca6ba33629e 21` | Recommended size for string representation of an entry age. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gac4b27a13583f9f4db2d1172645795a77 0` | Infinite path cost - used in `https://openthread.io/reference/struct/ot-history-tracker-router-info`. |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga041660c93417819f24dc26a663b924cd (49 * 24 * 60 * 60 * 1000u)` | This constant specifies the maximum age of entries which is 49 days (in msec). |
| `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1ga45716586210f3a2ad4aa715626d6d3f4 63` | No next hop - For `mNextHop` in `https://openthread.io/reference/struct/ot-history-tracker-router-info`. |

| ### Structs ||
|---|---|
| [otHistoryTrackerAilRouter](https://openthread.io/reference/struct/ot-history-tracker-ail-router) | Represents information about a discovered router on an Adjacent Infrastructure Link (AIL). |
| [otHistoryTrackerDhcp6PdInfo](https://openthread.io/reference/struct/ot-history-tracker-dhcp6-pd-info) | Represents the DHCPv6-PD state and delegated prefix (if any) by a device acting as Border Router (BR). |
| [otHistoryTrackerDnsSrpAddrInfo](https://openthread.io/reference/struct/ot-history-tracker-dns-srp-addr-info) | Represents DNS/SRP server address information parsed from a Network Data service entry. |
| [otHistoryTrackerExternalRouteInfo](https://openthread.io/reference/struct/ot-history-tracker-external-route-info) | Represent a Network Data extern route info. |
| [otHistoryTrackerFavoredOmrPrefix](https://openthread.io/reference/struct/ot-history-tracker-favored-omr-prefix) | Represents a favored OMR prefix tracked by a device acting as a Border Router (BR). |
| [otHistoryTrackerFavoredOnLinkPrefix](https://openthread.io/reference/struct/ot-history-tracker-favored-on-link-prefix) | Represents a favored on-link prefix on AIL tracked by a device acting as a Border Router (BR). |
| [otHistoryTrackerIterator](https://openthread.io/reference/struct/ot-history-tracker-iterator) | Represents an iterator to iterate through a history list. |
| [otHistoryTrackerMessageInfo](https://openthread.io/reference/struct/ot-history-tracker-message-info) | Represents a RX/TX IPv6 message info. |
| [otHistoryTrackerMulticastAddressInfo](https://openthread.io/reference/struct/ot-history-tracker-multicast-address-info) | Represent an IPv6 multicast address info. |
| [otHistoryTrackerNeighborInfo](https://openthread.io/reference/struct/ot-history-tracker-neighbor-info) | Represents a neighbor info. |
| [otHistoryTrackerNetworkInfo](https://openthread.io/reference/struct/ot-history-tracker-network-info) | Represents Thread network info. |
| [otHistoryTrackerOnMeshPrefixInfo](https://openthread.io/reference/struct/ot-history-tracker-on-mesh-prefix-info) | Represent a Network Data on mesh prefix info. |
| [otHistoryTrackerRouterInfo](https://openthread.io/reference/struct/ot-history-tracker-router-info) | Represents a router table entry event. |
| [otHistoryTrackerUnicastAddressInfo](https://openthread.io/reference/struct/ot-history-tracker-unicast-address-info) | Represent a unicast IPv6 address info. |

## Enumerations

### Anonymous Enum 1

```
 Anonymous Enum 1
```
Constants representing message priority used in `https://openthread.io/reference/struct/ot-history-tracker-message-info` struct.

| Properties ||
|---|---|
| `OT_HISTORY_TRACKER_MSG_PRIORITY_HIGH` | High priority level. |
| `OT_HISTORY_TRACKER_MSG_PRIORITY_LOW` | Low priority level. |
| `OT_HISTORY_TRACKER_MSG_PRIORITY_NET` | Network Control priority level. |
| `OT_HISTORY_TRACKER_MSG_PRIORITY_NORMAL` | Normal priority level. |

### otHistoryTrackerAddressEvent

```
 otHistoryTrackerAddressEvent
```
Defines the events for an IPv6 (unicast or multicast) address info (i.e., whether address is added or removed).

| Properties ||
|---|---|
| `OT_HISTORY_TRACKER_ADDRESS_EVENT_ADDED` | Address is added. |
| `OT_HISTORY_TRACKER_ADDRESS_EVENT_REMOVED` | Address is removed. |

### otHistoryTrackerAilRouterEvent

```
 otHistoryTrackerAilRouterEvent
```
Defines events for discovered routers on an Adjacent Infrastructure Link (AIL).

This applies when a device is acting as a Border Router, processing received Router Advertisements and tracking AIL routers.

`OT_HISTORY_TRACKER_AIL_ROUTER_EVENT_CHANGED` is used if any of the properties in the `https://openthread.io/reference/struct/ot-history-tracker-ail-router` structure associated with a specific router changes.

| Properties ||
|---|---|
| `OT_HISTORY_TRACKER_AIL_ROUTER_EVENT_ADDED` | A new AIL router is discovered. |
| `OT_HISTORY_TRACKER_AIL_ROUTER_EVENT_CHANGED` | A property in the router's information has changed. |
| `OT_HISTORY_TRACKER_AIL_ROUTER_EVENT_REMOVED` | The AIL router is removed and no longer tracked. |

### otHistoryTrackerBorderAgentEpskcEvent

```
 otHistoryTrackerBorderAgentEpskcEvent
```
Represents events during the Border Agent's ePSKc journey.

| Properties ||
|---|---|
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_ACTIVATED` | ePSKc mode is activated. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_CONNECTED` | Secure session is connected. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_DEACTIVATED_EPSKC_TIMEOUT` | ePSKc mode timed out. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_DEACTIVATED_LOCAL_CLOSE` | Deactivated by a call to the API. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_DEACTIVATED_MAX_ATTEMPTS` | Max allowed attempts reached. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_DEACTIVATED_REMOTE_CLOSE` | Disconnected by the peer. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_DEACTIVATED_SESSION_ERROR` | Disconnected due to some error. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_DEACTIVATED_SESSION_TIMEOUT` | Disconnected due to timeout. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_DEACTIVATED_UNKNOWN` | Deactivated for an unknown reason. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_KEEP_ALIVE` | Keep alive message is received. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_PETITIONED` | Commissioner petition is received. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_RETRIEVED_ACTIVE_DATASET` | Active dataset is retrieved. |
| `OT_HISTORY_TRACKER_BORDER_AGENT_EPSKC_EVENT_RETRIEVED_PENDING_DATASET` | Pending dataset is retrieved. |

### otHistoryTrackerDnsSrpAddrType

```
 otHistoryTrackerDnsSrpAddrType
```
Represents the DNS/SRP server address type parsed from Network Data service entries.

| Properties ||
|---|---|
| `OT_HISTORY_TRACKER_DNS_SRP_ADDR_TYPE_ANYCAST` | Anycast address type. |
| `OT_HISTORY_TRACKER_DNS_SRP_ADDR_TYPE_UNICAST_INFRA` | Unicast address type infrastructure (in service data). |
| `OT_HISTORY_TRACKER_DNS_SRP_ADDR_TYPE_UNICAST_LOCAL` | Unicast address type local (in server data). |

### 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.

| Properties ||
|---|---|
| `OT_HISTORY_TRACKER_NEIGHBOR_EVENT_ADDED` | Neighbor is added. |
| `OT_HISTORY_TRACKER_NEIGHBOR_EVENT_CHANGED` | Neighbor changed (e.g., device mode flags changed). |
| `OT_HISTORY_TRACKER_NEIGHBOR_EVENT_REMOVED` | Neighbor is removed. |
| `OT_HISTORY_TRACKER_NEIGHBOR_EVENT_RESTORING` | Neighbor is being restored (applicable to child only). |

### otHistoryTrackerNetDataEvent

```
 otHistoryTrackerNetDataEvent
```
Defines the events for a Network Data entry (i.e., whether an entry is added or removed).

| Properties ||
|---|---|
| `OT_HISTORY_TRACKER_NET_DATA_ENTRY_ADDED` | Network data entry is added. |
| `OT_HISTORY_TRACKER_NET_DATA_ENTRY_REMOVED` | Network data entry is removed. |

### otHistoryTrackerRouterEvent

```
 otHistoryTrackerRouterEvent
```
Defines the events in a router info (i.e.

whether router is added, removed, or changed).

| Properties ||
|---|---|
| `OT_HISTORY_TRACKER_ROUTER_EVENT_ADDED` | Router is added (router ID allocated). |
| `OT_HISTORY_TRACKER_ROUTER_EVENT_COST_CHANGED` | Router entry path cost changed (next hop as before). |
| `OT_HISTORY_TRACKER_ROUTER_EVENT_NEXT_HOP_CHANGED` | Router entry next hop and cost changed. |
| `OT_HISTORY_TRACKER_ROUTER_EVENT_REMOVED` | Router entry is removed (router ID released). |

## Typedefs

### otHistoryTrackerAilRouter

```
struct otHistoryTrackerAilRouter otHistoryTrackerAilRouter
```
Represents information about a discovered router on an Adjacent Infrastructure Link (AIL).

This applies when a device is acting as a Border Router, processing received Router Advertisements and tracking information about discovered AIL routers.

`mProvidesDefaultRoute` indicates whether the router provides a default route. If it does, `mDefRoutePreference` specifies the route preference.

`mFavoredOnLinkPrefix` indicates the favored on-link prefix advertised by the router. If there is no on-link prefix, this will be an empty prefix (i.e., its length will be zero).

### otHistoryTrackerDhcp6PdInfo

```
struct otHistoryTrackerDhcp6PdInfo otHistoryTrackerDhcp6PdInfo
```
Represents the DHCPv6-PD state and delegated prefix (if any) by a device acting as Border Router (BR).

### otHistoryTrackerDnsSrpAddrInfo

```
struct otHistoryTrackerDnsSrpAddrInfo otHistoryTrackerDnsSrpAddrInfo
```
Represents DNS/SRP server address information parsed from a Network Data service entry.

The `mType` field specifies the entry type. Some fields are only applicable to specific types.

- The `mPort` field is only applicable for `OT_HISTORY_TRACKER_DNS_SRP_ADDR_TYPE_UNICAST_*` types.
- The `mSequenceNumber` field is only applicable for the `OT_HISTORY_TRACKER_DNS_SRP_ADDR_TYPE_ANYCAST` type.
- Other fields are common and used for all address types.

<br />

### otHistoryTrackerExternalRouteInfo

```
struct otHistoryTrackerExternalRouteInfo otHistoryTrackerExternalRouteInfo
```
Represent a Network Data extern route info.

### otHistoryTrackerFavoredOmrPrefix

```
struct otHistoryTrackerFavoredOmrPrefix otHistoryTrackerFavoredOmrPrefix
```
Represents a favored OMR prefix tracked by a device acting as a Border Router (BR).

The `mIsLocal` field indicates whether the favored OMR prefix is the same as the local one maintained by this BR. The local OMR prefix can be either based on (random) ULA or a prefix delegated via DHCPv6-PD.

### otHistoryTrackerFavoredOnLinkPrefix

```
struct otHistoryTrackerFavoredOnLinkPrefix otHistoryTrackerFavoredOnLinkPrefix
```
Represents a favored on-link prefix on AIL tracked by a device acting as a Border Router (BR).

The `mIsLocal` field indicates whether the favored on-link prefix is the same as the local one maintained by this BR.

### 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 `https://openthread.io/reference/group/api-history-tracker#group__api-history-tracker_1gad823d66555d7a3c30aa2b72f1c2a573d`,

### 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.

### otHistoryTrackerNetInfoCallback

```
void(* otHistoryTrackerNetInfoCallback)(otError aError, const otHistoryTrackerNetworkInfo *aNetworkInfo, uint32_t aEntryAge, void *aContext)
```
Callback function pointer type to report the retrieved Network Info entries from a query to another device.

Used when `OPENTHREAD_CONFIG_HISTORY_TRACKER_CLIENT_ENABLE` is enabled.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aError` | Indicates the status of the query and entries being reported: - `OT_ERROR_PENDING`: There are more entries to be reported. - `OT_ERROR_NONE`: This is the last entry, and the query is complete. - `OT_ERROR_RESPONSE_TIMEOUT`: Timed out waiting for a response. - `OT_ERROR_PARSE`: The received query answer does not follow the expected format. | | `[in] aNetworkInfo` | The network information entry. This may be `NULL` if `aError` is `OT_ERROR_NONE` (indicating the end of the list) or on certain error conditions. | | `[in] aEntryAge` | The entry age in milliseconds. Applicable only when `aNetworkInfo` is not `NULL`. | | `[in] aContext` | An arbitrary callback context provided by the caller during the query. | |

### 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

### otHistoryTrackerCancelQuery

```
void otHistoryTrackerCancelQuery(
  otInstance *aInstance
)
```
Cancels any ongoing query.

Requires `OPENTHREAD_CONFIG_HISTORY_TRACKER_CLIENT_ENABLE`.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | The OpenThread instance. | |

### 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.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aEntryAge` | The entry age (duration in msec). | | `[out] aBuffer` | A pointer to a char array to output the string (MUST NOT be NULL). | | `[in] aSize` | The size of `aBuffer`. Recommended to use `OT_HISTORY_TRACKER_ENTRY_AGE_STRING_SIZE`. | |

### otHistoryTrackerInitIterator

```
void otHistoryTrackerInitIterator(
  otHistoryTrackerIterator *aIterator
)
```
Initializes an `https://openthread.io/reference/struct/ot-history-tracker-iterator`.

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.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aIterator` | A pointer to the iterator to initialize (MUST NOT be NULL). | |

### otHistoryTrackerIterateAilRoutersHistory

```
const otHistoryTrackerAilRouter * otHistoryTrackerIterateAilRoutersHistory(
  otInstance *aInstance,
  otHistoryTrackerIterator *aIterator,
  uint32_t *aEntryAge
)
```
Iterates over the entries in the BR AIL routers history list.

Requires `OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` (device acting as Border Router).

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when the entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than the max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-ail-router` entry or `NULL` if no more entries in the list. |

### otHistoryTrackerIterateBorderAgentEpskcEventHistory

```
const otHistoryTrackerBorderAgentEpskcEvent * otHistoryTrackerIterateBorderAgentEpskcEventHistory(
  otInstance *aInstance,
  otHistoryTrackerIterator *aIterator,
  uint32_t *aEntryAge
)
```
Iterates over the entries in the Border Agent ePSKc history list.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | The `otHistoryTrackerBorderAgentEpskcEvent` entry or `NULL` if no more entries in the list. |

### otHistoryTrackerIterateDhcp6PdHistory

```
const otHistoryTrackerDhcp6PdInfo * otHistoryTrackerIterateDhcp6PdHistory(
  otInstance *aInstance,
  otHistoryTrackerIterator *aIterator,
  uint32_t *aEntryAge
)
```
Iterates over the entries in the DHCPv6-PD history list.

Requires both `OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` and `OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE`.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-dhcp6-pd-info` entry or `NULL` if no more entries in the list. |

### otHistoryTrackerIterateDnsSrpAddrHistory

```
const otHistoryTrackerDnsSrpAddrInfo * otHistoryTrackerIterateDnsSrpAddrHistory(
  otInstance *aInstance,
  otHistoryTrackerIterator *aIterator,
  uint32_t *aEntryAge
)
```
Iterates over the entries in the Network Data SRP/DNS address history list.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-dns-srp-addr-info` entry or `NULL` if no more entries in the list. |

### otHistoryTrackerIterateExternalRouteHistory

```
const otHistoryTrackerExternalRouteInfo * otHistoryTrackerIterateExternalRouteHistory(
  otInstance *aInstance,
  otHistoryTrackerIterator *aIterator,
  uint32_t *aEntryAge
)
```
Iterates over the entries in the Network Data external route entry history list.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-external-route-info` entry or `NULL` if no more entries in the list. |

### otHistoryTrackerIterateFavoredOmrPrefixHistory

```
const otHistoryTrackerFavoredOmrPrefix * otHistoryTrackerIterateFavoredOmrPrefixHistory(
  otInstance *aInstance,
  otHistoryTrackerIterator *aIterator,
  uint32_t *aEntryAge
)
```
Iterates over the entries in the favored OMR prefix history list.

Requires `OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` (device acting as Border Router).

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-favored-omr-prefix` entry or `NULL` if no more entries in the list. |

### otHistoryTrackerIterateFavoredOnLinkPrefixHistory

```
const otHistoryTrackerFavoredOnLinkPrefix * otHistoryTrackerIterateFavoredOnLinkPrefixHistory(
  otInstance *aInstance,
  otHistoryTrackerIterator *aIterator,
  uint32_t *aEntryAge
)
```
Iterates over the entries in the favored on-link prefix history list.

Requires `OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` (device acting as Border Router).

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when the entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than the max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-favored-on-link-prefix` 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.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | A pointer to `https://openthread.io/reference/struct/ot-history-tracker-multicast-address-info` 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.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-neighbor-info` 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.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | A pointer to `https://openthread.io/reference/struct/ot-history-tracker-network-info` 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.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-on-mesh-prefix-info` 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.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-router-info` 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.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-message-info` 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.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | The `https://openthread.io/reference/struct/ot-history-tracker-message-info` 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.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to the OpenThread instance. | | `[in,out] aIterator` | A pointer to an iterator. MUST be initialized or the behavior is undefined. | | `[out] aEntryAge` | A pointer to a variable to output the entry's age. MUST NOT be NULL. Age is provided as the duration (in milliseconds) from when entry was recorded to `aIterator` initialization time. It is set to `OT_HISTORY_TRACKER_MAX_AGE` for entries older than max age. | |
| **Returns** | A pointer to `https://openthread.io/reference/struct/ot-history-tracker-unicast-address-info` entry or `NULL` if no more entries in the list. |

### otHistoryTrackerQueryNetInfo

```
otError otHistoryTrackerQueryNetInfo(
  otInstance *aInstance,
  uint16_t aRloc16,
  uint16_t aMaxEntries,
  uint32_t aMaxEntryAge,
  otHistoryTrackerNetInfoCallback aCallback,
  void *aContext
)
```
Queries for Network Info history entries from a specified RLOC16.

Requires `OPENTHREAD_CONFIG_HISTORY_TRACKER_CLIENT_ENABLE`.

Upon successful initiation of the query, the provided `aCallback` will be invoked to report the requested entries.

The callback parameter `aError` indicates if any error occurs. If there are more entries to be provided, `aError` will be set to `OT_ERROR_PENDING`. The end of the list is indicated by `aError` being set to `OT_ERROR_NONE` with a null entry pointer. Any other errors, such as `OT_ERROR_RESPONSE_TIMEOUT` or `OT_ERROR_PARSE` (if the received response has an invalid format), will also be indicated by `aError`.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | The OpenThread instance. | | `[in] aRloc16` | The RLOC16 of the device to query. | | `[in] aMaxEntries` | The maximum number of entries to request (0 indicates all available entries). | | `[in] aMaxEntryAge` | The maximum age (in milliseconds) of entries to request (0 indicates no age limit). | | `[in] aCallback` | A pointer to a callback function to be called when the query response is received. | | `[in] aContext` | A user-defined context pointer to be passed to the callback function. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | If the query was successfully sent. | | `OT_ERROR_BUSY` | If a query is already in progress. | | `OT_ERROR_NO_BUFS` | If there are insufficient message buffers to send the query. | | `OT_ERROR_INVALID_STATE` | If device is not attached. | |

## 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 `https://openthread.io/reference/struct/ot-history-tracker-router-info`.

### 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 `https://openthread.io/reference/struct/ot-history-tracker-router-info`.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).