# IPv6

This module includes functions that control IPv6 communication.

## Summary

| ### Enumerations ||
|---|---|
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga99fb83031ce9923c84392b4e92f956b5{ https://openthread.io/reference/group/api-ip6#group__api-ip6_1gga99fb83031ce9923c84392b4e92f956b5a95cc7ac6c36d460793023899da84c2eb = 0, https://openthread.io/reference/group/api-ip6#group__api-ip6_1gga99fb83031ce9923c84392b4e92f956b5a6a4aa772a3a3ec487b4158492c88e46d = 1, https://openthread.io/reference/group/api-ip6#group__api-ip6_1gga99fb83031ce9923c84392b4e92f956b5ac6e3160a88df22cefbcb8346a5251c76 = 2, https://openthread.io/reference/group/api-ip6#group__api-ip6_1gga99fb83031ce9923c84392b4e92f956b5a52a354e37d221d9f681e6867604acdb7 = 3 }` | enumIPv6 Address origins. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gabc6126af1d45847bc59afa0aa3216b04{ https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggabc6126af1d45847bc59afa0aa3216b04aeb4dac1e41e44eef9a0c8b93843abb73 = 0x0, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggabc6126af1d45847bc59afa0aa3216b04a2677550988cff6e9d51bad6b62e75aac = 0x2, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggabc6126af1d45847bc59afa0aa3216b04a1caeb83783a292db40dcd1412e1bacc7 = 0x1, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggabc6126af1d45847bc59afa0aa3216b04ad8fd25e803b110375836c6c102beeadd = 0x3 }` | enumECN statuses, represented as in the IP header. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gadc29c2ff13d900c2f185ee95427fb06c{ https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggadc29c2ff13d900c2f185ee95427fb06ca7e14335f2fdfa0695778b615da02c314 = 0, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggadc29c2ff13d900c2f185ee95427fb06ca62c03f323e0dc242f9558f2167c33741 = 6, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggadc29c2ff13d900c2f185ee95427fb06ca23b1f8fa4a259ff811537e2820385ea7 = 17, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggadc29c2ff13d900c2f185ee95427fb06cac6c53c23633f16c88b03ff85357614e6 = 41, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggadc29c2ff13d900c2f185ee95427fb06ca06201707803dd0456a732be8b014a92a = 43, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggadc29c2ff13d900c2f185ee95427fb06ca88f651904c2d84dd3cc1a176b8b8d47e = 44, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggadc29c2ff13d900c2f185ee95427fb06ca1a3bc7615be43cfc57acb46b38850727 = 58, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggadc29c2ff13d900c2f185ee95427fb06caed3d73173290d0bd75a9a577a145dae1 = 59, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ggadc29c2ff13d900c2f185ee95427fb06cacbe327aee4806981117a42f587f10448 = 60 }` | enumInternet Protocol Numbers. |

| ### Typedefs ||
|---|---|
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga69187c53e6e6c7a114b4ab8be5136331` | typedef `struct https://openthread.io/reference/struct/ot-border-routing-counters` Represents the counters of packets forwarded via Border Routing. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga401a73f54d430dbf89474db74fa7884a` | typedef `struct https://openthread.io/reference/struct/ot-ip6-address` Represents an IPv6 address. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaaceecbebe4c6f0e3f72b9750b9efe1ec)(const otIp6AddressInfo *aAddressInfo, bool aIsAdded, void *aContext)` | typedef `void(*` Pointer is called when an internal IPv6 address is added or removed. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga0c639abb0d90d4eea10ccdb2c8876dd6` | typedef `struct https://openthread.io/reference/struct/ot-ip6-address-components` Represents the components of an IPv6 address. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gac50eb86a5b9a7886eb9dda4fcc319d47` | typedef `struct https://openthread.io/reference/struct/ot-ip6-address-info` Represents IPv6 address information. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga41d2200b316884414652945964b8207c` | typedef `struct https://openthread.io/reference/struct/ot-ip6-interface-identifier` Represents the Interface Identifier of an IPv6 address. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga76e06de4276bf00c4df317cd226d4b84` | typedef `struct https://openthread.io/reference/struct/ot-ip6-network-prefix` Represents the Network Prefix of an IPv6 address (most significant 64 bits of the address). |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gab98d28621a5ef9be9be200ef72f16c39` | typedef `struct https://openthread.io/reference/struct/ot-ip6-prefix` Represents an IPv6 prefix. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga4c0548cdced5c6d19aaab0aa9ddcfa97)(otMessage *aMessage, void *aContext)` | typedef `void(*` Pointer is called when an IPv6 datagram is received. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga3894a57ec32344559378d863602de6a8)(void *aContext, otError aError, uint8_t aMlrStatus, const otIp6Address *aFailedAddresses, uint8_t aFailedAddressNum)` | typedef `void(*` Pointer is called with results of `otIp6RegisterMulticastListeners`. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga6f01c0b18e638e7dc0deaadaab345fb5)(otInstance *aInstance, const otIp6Prefix *aPrefix)` | typedef `bool(*` Pointer allows user to filter prefixes and not allow an SLAAC address based on a prefix to be added. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga626382fa8118ffa6fed7d9dab7439a96` | typedef `struct https://openthread.io/reference/struct/ot-message-info` Represents the local and peer IPv6 socket addresses. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga152e09663f3c8972a8c217a14fef1d80` | typedef `struct https://openthread.io/reference/struct/ot-netif-address` Represents an IPv6 network interface unicast address. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gae7c4895df08c58ba2dd0b9e7bbd480be` | typedef `struct https://openthread.io/reference/struct/ot-netif-multicast-address` Represents an IPv6 network interface multicast address. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga8806030b1779bb8a2c51e0179d96bc37` | typedef `struct https://openthread.io/reference/struct/ot-packets-and-bytes` Represents the counters for packets and bytes. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga966fff91ccb31448707035a32ae4fb76` | typedef `struct https://openthread.io/reference/struct/ot-sock-addr` Represents an IPv6 socket address. |

| ### Variables ||
|---|---|
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1c9afc7d1fcf4af54d61f95329a5bba9` | `https://openthread.io/reference/group/plat-toolchain#group__plat-toolchain_1gaba6ad63129c3a790957a9b149a65891b struct https://openthread.io/reference/struct/ot-ip6-interface-identifier` |

| ### Functions ||
|---|---|
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gafba5b6ff43be8ec8eeefadfb97beccb8(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-netif-address *aAddress)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Adds a Network Interface Address to the Thread interface. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga337396785b502c2d933fe9d8e84630e9(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint16_t aPort)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Adds a port to the allowed unsecured port list. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga0cd28834a145abc348ba00bf6a52527a(const char *aString, https://openthread.io/reference/struct/ot-ip6-address *aAddress)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Converts a human-readable IPv6 address string into a binary representation. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga7a060760286d06f4a2b6ab34307fe9f6(const https://openthread.io/reference/struct/ot-ip6-address *aAddress, char *aBuffer, uint16_t aSize)` | `void` Converts a given IPv6 address to a human-readable string. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaca9cc9d3396e09101f5d0bdf4abb0332(const https://openthread.io/reference/struct/ot-ip6-prefix *aFirst, const https://openthread.io/reference/struct/ot-ip6-prefix *aSecond)` | `bool` Test if two IPv6 prefixes are the same. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga5a8b94331563abb692b5896bed3b5466(const https://openthread.io/reference/struct/ot-ip6-address *aAddress, https://openthread.io/reference/struct/ot-ext-address *aExtAddress)` | `void` Extracts the MAC Extended Address from the Interface Identifier of the given IPv6 address. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga2f08f7dde5f9738640d15dbc9de37b42(const https://openthread.io/reference/struct/ot-ext-address *aExtAddress, https://openthread.io/reference/struct/ot-ip6-address *aAddress)` | `void` Forms a link-local unicast IPv6 address from the Interface Identifier generated from the given MAC Extended Address with the universal/local bit inverted. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga470c07bc31660079f1f2cdea86856dea(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `const https://openthread.io/reference/struct/ot-border-routing-counters *` Gets the Border Routing counters. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga20125582448c6b3101808f726f469f61(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `const https://openthread.io/reference/struct/ot-netif-multicast-address *` Gets the list of IPv6 multicast addresses subscribed to the Thread interface. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga542ed0e1196ced9b19b087f63fea80a3(const https://openthread.io/reference/struct/ot-ip6-address *aAddress, uint8_t aLength, https://openthread.io/reference/struct/ot-ip6-prefix *aPrefix)` | `void` Gets a prefix with `aLength` from `aAddress`. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1ea85353729e421a87ba0aa14cd00cdd(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `const https://openthread.io/reference/struct/ot-netif-address *` Gets the list of IPv6 addresses assigned to the Thread interface. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga27c2c884bee5ebca73748237f62187d7(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint8_t *aNumEntries)` | `const uint16_t *` Returns a pointer to the unsecure port list. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga0a49fabeb2f89a7c62f2b5575f9dc7b1(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ip6-address *aAddress)` | `bool` Indicates whether or not a unicast IPv6 address is assigned to the Thread interface. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1267e60c738b2695c32c9fb2af2a552b(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-netif-address *aUnicastAddrPool, uint16_t aUnicastAddrPoolSize, https://openthread.io/reference/struct/ot-netif-multicast-address *aMulticastAddrPool, uint16_t aMulticastAddrPoolSize)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Initializes the IPv6 interface and its external address pools. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga071fcc2f9431515e0979fed0b8df7333(const https://openthread.io/reference/struct/ot-ip6-address *aFirst, const https://openthread.io/reference/struct/ot-ip6-address *aSecond)` | `bool` Test if two IPv6 addresses are the same. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga6700e6099203f7eeefc2be70d062e072(const https://openthread.io/reference/struct/ot-ip6-address *aAddress)` | `bool` Indicates whether or not a given IPv6 address is the Unspecified Address. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaaede0c1e8bebc7fb228727a650ac0f75(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether or not the IPv6 interface is up. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga58ee23b36b5d772031e77f59e63653e5(const https://openthread.io/reference/struct/ot-ip6-address *aAddress)` | `bool` Test whether or not the IPv6 address is a link-local unicast address. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gae3117a710584f3ea0dc494bb8597009f(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether or not Thread control traffic is filtered out when delivering IPv6 datagrams via the callback specified in [otIp6SetReceiveCallback()](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1d8423905816ad0159c9445ed1d6cc42). |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga01b60237cc61123f5bfba904a416da13(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether the SLAAC module is enabled or not. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga4bff725cf2b6a9198632480c8c5b2606(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether allowing link-local unsecure IPv6 datagrams when the Thread role is disabled is enabled. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gae8bbc8125663bbf1c74bc4d83b54b984(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-message-settings *aSettings)` | `https://openthread.io/reference/group/api-message#group__api-message_1ga42d128a0a9ad58de0eb79673843c2955 *` Allocate a new message buffer for sending an IPv6 message. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gabedcc64ba37dce564c2d6b73c692f2c0(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const uint8_t *aData, uint16_t aDataLength, const https://openthread.io/reference/struct/ot-message-settings *aSettings)` | `https://openthread.io/reference/group/api-message#group__api-message_1ga42d128a0a9ad58de0eb79673843c2955 *` Allocate a new message buffer and write the IPv6 datagram to the message buffer for sending an IPv6 message. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaca92089772914d61e8688d8a318703fd(const char *aString, https://openthread.io/reference/struct/ot-ip6-prefix *aPrefix)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Converts a human-readable IPv6 prefix string into a binary representation. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga4133edcf0a1ea5e618741060969d9bc7(const https://openthread.io/reference/struct/ot-ip6-address *aFirst, const https://openthread.io/reference/struct/ot-ip6-address *aSecond)` | `uint8_t` Returns the prefix match length (bits) for two IPv6 addresses. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gae84cf738cc7b3b131d14933482804cac(const https://openthread.io/reference/struct/ot-ip6-prefix *aPrefix, char *aBuffer, uint16_t aSize)` | `void` Converts a given IPv6 prefix to a human-readable string. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaffe130cea463195b98621e64c9672afe(uint8_t aIpProto)` | `const char *` Converts a given IP protocol number to a human-readable string. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaa723ddc99b7546ef8b78267122811b48(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ip6-address *aAddresses, uint8_t aAddressNum, const uint32_t *aTimeout, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga3894a57ec32344559378d863602de6a8 aCallback, void *aContext)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Registers Multicast Listeners to Primary Backbone Router. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga4e13970081f28575118184a9836d4c22(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Removes all ports from the allowed unsecure port list. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gae736cfaad0c6f3fbbdfb489951e98703(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ip6-address *aAddress)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Removes a Network Interface Address from the Thread interface. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gacc5cb6166a6a86ea8cd3101c822089d1(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint16_t aPort)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Removes a port from the allowed unsecure port list. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gae084ca29e3893eef11f8f18d9bbcdd0e(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Resets the Border Routing counters. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga5375556e1592ace6ec95c8493b22e6a7(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-message-info *aMessageInfo)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Perform OpenThread source address selection. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga6dc618bef02089e031ee882cd8bfd63c(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/group/api-message#group__api-message_1ga42d128a0a9ad58de0eb79673843c2955 *aMessage)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Sends an IPv6 datagram via the Thread interface. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga5b4ceaf21fec163ece33517a0c28aed9(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaaceecbebe4c6f0e3f72b9750b9efe1ec aCallback, void *aCallbackContext)` | `void` Registers a callback to notify internal IPv6 address changes. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga6938b2d0025c3820290b9c96e6fbf39c(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, bool aAllow)` | `void` Sets whether to allow link-local unsecure IPv6 datagrams when the Thread role is disabled. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga5c01df2121fb605fad92bb153302e6e2(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, bool aEnabled)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Brings the IPv6 interface up or down. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaad753e4cabd04c63fc7b2c19c8333315(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ip6-interface-identifier *aIid)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Sets the Mesh Local IID (for test purpose). |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1d8423905816ad0159c9445ed1d6cc42(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga4c0548cdced5c6d19aaab0aa9ddcfa97 aCallback, void *aCallbackContext)` | `void` Registers a callback to provide received IPv6 datagrams. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga51cc60fc85f913a7241fc32a64bcf597(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, bool aEnabled)` | `void` Sets whether or not Thread control traffic is filtered out when delivering IPv6 datagrams via the callback specified in [otIp6SetReceiveCallback()](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1d8423905816ad0159c9445ed1d6cc42). |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga8a25d9b287ada01e05650f1a720a3510(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, bool aEnabled)` | `void` Enables/disables the SLAAC module. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga036d09266d795b0a4136303980736ab0(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga6f01c0b18e638e7dc0deaadaab345fb5 aFilter)` | `void` Sets the SLAAC module filter handler. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga8b3d9e43d1624ba836106008a977d115(const https://openthread.io/reference/struct/ot-sock-addr *aSockAddr, char *aBuffer, uint16_t aSize)` | `void` Converts a given IPv6 socket address to a human-readable string. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaaad3f2b2e8bb16aaba23c811796852a0(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ip6-address *aAddress)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Subscribes the Thread interface to a Network Interface Multicast Address. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaf6552c66cbcd0b88fb8efa139c22b22a(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ip6-address *aAddress)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Unsubscribes the Thread interface to a Network Interface Multicast Address. |

| ### Macros ||
|---|---|
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga2df5db1fc8ece396377bd0f3f8438d5b (OT_IP6_ADDRESS_SIZE * 8)` | Size of an IPv6 address (bits) |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gadeeae0fb64b080081b41ebbbcfe06d6e 16` | Size of an IPv6 address (bytes) |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga96a655977f5633148c3f5dda80b6aedc 40` | Recommended size for string representation of an IPv6 address. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga42c85d52f9a1f063e9983ffa89ec18cf 6` | Offset of the proto field in the IPv6 header (bytes) |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga48ede00f919a96555435a0687632d877 40` | Size of an IPv6 header (bytes) |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga92c5732c35eea687e818fc8a60ee77a9 8` | Size of an IPv6 Interface Identifier (bytes) |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga83262106ae5dacbdaca6f3459cfa80c9 15` | Max number of IPv6 addresses supported by Multicast Listener Registration. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gabca0b8d09ce11cea85dba1271f4188f5 (OT_IP6_PREFIX_SIZE * 8)` | Size of an IPv6 prefix (bits) |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga2b1f04705445677af9de0d494f0ffe82 8` | Size of an IPv6 prefix (bytes) |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1473a3e9c074ba8ae3d186086609b00f 45` | Recommended size for string representation of an IPv6 prefix. |
| `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gad504e59d637ddef27b1027b748fe2229 48` | Recommended size for string representation of an IPv6 socket address. |

| ### Structs ||
|---|---|
| [otBorderRoutingCounters](https://openthread.io/reference/struct/ot-border-routing-counters) | Represents the counters of packets forwarded via Border Routing. |
| [otIp6Address](https://openthread.io/reference/struct/ot-ip6-address) | Represents an IPv6 address. |
| [otIp6AddressComponents](https://openthread.io/reference/struct/ot-ip6-address-components) | Represents the components of an IPv6 address. |
| [otIp6AddressInfo](https://openthread.io/reference/struct/ot-ip6-address-info) | Represents IPv6 address information. |
| [otIp6InterfaceIdentifier](https://openthread.io/reference/struct/ot-ip6-interface-identifier) | Represents the Interface Identifier of an IPv6 address. |
| [otIp6NetworkPrefix](https://openthread.io/reference/struct/ot-ip6-network-prefix) | Represents the Network Prefix of an IPv6 address (most significant 64 bits of the address). |
| [otIp6Prefix](https://openthread.io/reference/struct/ot-ip6-prefix) | Represents an IPv6 prefix. |
| [otMessageInfo](https://openthread.io/reference/struct/ot-message-info) | Represents the local and peer IPv6 socket addresses. |
| [otNetifAddress](https://openthread.io/reference/struct/ot-netif-address) | Represents an IPv6 network interface unicast address. |
| [otNetifMulticastAddress](https://openthread.io/reference/struct/ot-netif-multicast-address) | Represents an IPv6 network interface multicast address. |
| [otPacketsAndBytes](https://openthread.io/reference/struct/ot-packets-and-bytes) | Represents the counters for packets and bytes. |
| [otSockAddr](https://openthread.io/reference/struct/ot-sock-addr) | Represents an IPv6 socket address. |

| ### Unions ||
|---|---|
| [otIp6InterfaceIdentifier::OT_TOOL_PACKED_FIELD](https://openthread.io/reference/union/ot-ip6-interface-identifier/o-t-t-o-o-l-p-a-c-k-e-d-f-i-e-l-d) |   |

## Enumerations

### Anonymous Enum 2

```
 Anonymous Enum 2
```
IPv6 Address origins.

| Properties ||
|---|---|
| `OT_ADDRESS_ORIGIN_DHCPV6` | DHCPv6 assigned (used in `https://openthread.io/reference/struct/ot-netif-address` and not in `https://openthread.io/reference/struct/ot-netif-multicast-address`). |
| `OT_ADDRESS_ORIGIN_MANUAL` | Manually assigned address. |
| `OT_ADDRESS_ORIGIN_SLAAC` | SLAAC assigned (used in `https://openthread.io/reference/struct/ot-netif-address` and not in `https://openthread.io/reference/struct/ot-netif-multicast-address`). |
| `OT_ADDRESS_ORIGIN_THREAD` | Thread assigned (ALOC, RLOC, MLEID, etc.) |

### Anonymous Enum 3

```
 Anonymous Enum 3
```
ECN statuses, represented as in the IP header.

| Properties ||
|---|---|
| `OT_ECN_CAPABLE_0` | ECT(0) |
| `OT_ECN_CAPABLE_1` | ECT(1) |
| `OT_ECN_MARKED` | Congestion encountered (CE) |
| `OT_ECN_NOT_CAPABLE` | Non-ECT. |

### Anonymous Enum 4

```
 Anonymous Enum 4
```
Internet Protocol Numbers.

| Properties ||
|---|---|
| `OT_IP6_PROTO_DST_OPTS` | Destination Options for IPv6. |
| `OT_IP6_PROTO_FRAGMENT` | Fragment Header for IPv6. |
| `OT_IP6_PROTO_HOP_OPTS` | IPv6 Hop-by-Hop Option. |
| `OT_IP6_PROTO_ICMP6` | ICMP for IPv6. |
| `OT_IP6_PROTO_IP6` | IPv6 encapsulation. |
| `OT_IP6_PROTO_NONE` | No Next Header for IPv6. |
| `OT_IP6_PROTO_ROUTING` | Routing Header for IPv6. |
| `OT_IP6_PROTO_TCP` | Transmission Control Protocol. |
| `OT_IP6_PROTO_UDP` | User Datagram. |

## Typedefs

### otBorderRoutingCounters

```
struct otBorderRoutingCounters otBorderRoutingCounters
```
Represents the counters of packets forwarded via Border Routing.

### otIp6Address

```
struct otIp6Address otIp6Address
```
Represents an IPv6 address.

### otIp6AddressCallback

```
void(* otIp6AddressCallback)(const otIp6AddressInfo *aAddressInfo, bool aIsAdded, void *aContext)
```
Pointer is called when an internal IPv6 address is added or removed.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aAddressInfo` | A pointer to the IPv6 address information. | | `[in] aIsAdded` | TRUE if the `aAddress` was added, FALSE if `aAddress` was removed. | | `[in] aContext` | A pointer to application-specific context. | |

### otIp6AddressComponents

```
struct otIp6AddressComponents otIp6AddressComponents
```
Represents the components of an IPv6 address.

### otIp6AddressInfo

```
struct otIp6AddressInfo otIp6AddressInfo
```
Represents IPv6 address information.

### otIp6InterfaceIdentifier

```
struct otIp6InterfaceIdentifier otIp6InterfaceIdentifier
```
Represents the Interface Identifier of an IPv6 address.

### otIp6NetworkPrefix

```
struct otIp6NetworkPrefix otIp6NetworkPrefix
```
Represents the Network Prefix of an IPv6 address (most significant 64 bits of the address).

### otIp6Prefix

```
struct otIp6Prefix otIp6Prefix
```
Represents an IPv6 prefix.

### otIp6ReceiveCallback

```
void(* otIp6ReceiveCallback)(otMessage *aMessage, void *aContext)
```
Pointer is called when an IPv6 datagram is received.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aMessage` | A pointer to the message buffer containing the received IPv6 datagram. This function transfers the ownership of the `aMessage` to the receiver of the callback. The message should be freed by the receiver of the callback after it is processed (see [otMessageFree()](https://openthread.io/reference/group/api-message#group__api-message_1ga70291a9d11f2f2a0bff290bf8ff4ea20)). | | `[in] aContext` | A pointer to application-specific context. | |

### otIp6RegisterMulticastListenersCallback

```
void(* otIp6RegisterMulticastListenersCallback)(void *aContext, otError aError, uint8_t aMlrStatus, const otIp6Address *aFailedAddresses, uint8_t aFailedAddressNum)
```
Pointer is called with results of `otIp6RegisterMulticastListeners`.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aContext` | A pointer to the user context. | | `[in] aError` | OT_ERROR_NONE when successfully sent MLR.req and received MLR.rsp, OT_ERROR_RESPONSE_TIMEOUT when failed to receive MLR.rsp, OT_ERROR_PARSE when failed to parse MLR.rsp. | | `[in] aMlrStatus` | The Multicast Listener Registration status when `aError` is OT_ERROR_NONE. | | `[in] aFailedAddresses` | A pointer to the failed IPv6 addresses when `aError` is OT_ERROR_NONE. | | `[in] aFailedAddressNum` | The number of failed IPv6 addresses when `aError` is OT_ERROR_NONE. | |

**See also:**   
[otIp6RegisterMulticastListeners](https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaa723ddc99b7546ef8b78267122811b48)   

### otIp6SlaacPrefixFilter

```
bool(* otIp6SlaacPrefixFilter)(otInstance *aInstance, const otIp6Prefix *aPrefix)
```
Pointer allows user to filter prefixes and not allow an SLAAC address based on a prefix to be added.

`https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga036d09266d795b0a4136303980736ab0` can be used to set the filter handler. The filter handler is invoked by SLAAC module when it is about to add a SLAAC address based on a prefix. Its boolean return value determines whether the address is filtered (not added) or not.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aPrefix` | A pointer to prefix for which SLAAC address is about to be added. | |
| Return Values | |---|---| | `TRUE` | Indicates that the SLAAC address based on the prefix should be filtered and NOT added. | | `FALSE` | Indicates that the SLAAC address based on the prefix should be added. | |

### otMessageInfo

```
struct otMessageInfo otMessageInfo
```
Represents the local and peer IPv6 socket addresses.

### otNetifAddress

```
struct otNetifAddress otNetifAddress
```
Represents an IPv6 network interface unicast address.

### otNetifMulticastAddress

```
struct otNetifMulticastAddress otNetifMulticastAddress
```
Represents an IPv6 network interface multicast address.

The `mAddressOrigin` field is set to either `OT_ADDRESS_ORIGIN_THREAD` if the multicast address is subscribed by OpenThread core or `OT_ADDRESS_ORIGIN_MANUAL` if it is subscribed manually using `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaaad3f2b2e8bb16aaba23c811796852a0`.

The multicast addresses subscribed by OpenThread core include addresses such as

- link-local all nodes (`ff02::01`),
- realm-local all nodes (`ff03::01`),
- link-local all routers (`ff02::02`),
- realm-local all routers (`ff03::02`),
- realm-local all MPL forwarders (`ff03::fc`),
- link-local all Thread nodes,
- realm-local all Thread nodes.

<br />

### otPacketsAndBytes

```
struct otPacketsAndBytes otPacketsAndBytes
```
Represents the counters for packets and bytes.

### otSockAddr

```
struct otSockAddr otSockAddr
```
Represents an IPv6 socket address.

## Variables

### OT_TOOL_PACKED_END

```
OT_TOOL_PACKED_BEGIN struct otIp6InterfaceIdentifier OT_TOOL_PACKED_END
```

## Functions

### otIp6AddUnicastAddress

```
otError otIp6AddUnicastAddress(
  otInstance *aInstance,
  const otNetifAddress *aAddress
)
```
Adds a Network Interface Address to the Thread interface.

The passed-in instance `aAddress` is copied by the Thread interface. The Thread interface only supports a fixed number of externally added unicast addresses. See `OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS` and `OPENTHREAD_CONFIG_IP6_INIT_EXT_ADDR_POOL_ENABLE`.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aAddress` | A pointer to a Network Interface Address. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully added (or updated) the Network Interface Address. | | `OT_ERROR_INVALID_ARGS` | The IP Address indicated by `aAddress` is an internal address. | | `OT_ERROR_NO_BUFS` | The Network Interface is already storing the maximum allowed external addresses. | |

### otIp6AddUnsecurePort

```
otError otIp6AddUnsecurePort(
  otInstance *aInstance,
  uint16_t aPort
)
```
Adds a port to the allowed unsecured port list.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aPort` | The port value. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | The port was successfully added to the allowed unsecure port list. | | `OT_ERROR_INVALID_ARGS` | The port is invalid (value 0 is reserved for internal use). | | `OT_ERROR_NO_BUFS` | The unsecure port list is full. | |

### otIp6AddressFromString

```
otError otIp6AddressFromString(
  const char *aString,
  otIp6Address *aAddress
)
```
Converts a human-readable IPv6 address string into a binary representation.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aString` | A pointer to a NULL-terminated string. | | `[out] aAddress` | A pointer to an IPv6 address. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully parsed `aString` and updated `aAddress`. | | `OT_ERROR_PARSE` | Failed to parse `aString` as an IPv6 address. | |

### otIp6AddressToString

```
void otIp6AddressToString(
  const otIp6Address *aAddress,
  char *aBuffer,
  uint16_t aSize
)
```
Converts a given IPv6 address to a human-readable string.

The IPv6 address string is formatted as 16 hex values separated by ':' (i.e., "%x:%x:%x:...:%x").

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] aAddress` | A pointer to an IPv6 address (MUST NOT be NULL). | | `[out] aBuffer` | A pointer to a char array to output the string (MUST NOT be NULL). | | `[in] aSize` | The size of `aBuffer` (in bytes). Recommended to use `OT_IP6_ADDRESS_STRING_SIZE`. | |

### otIp6ArePrefixesEqual

```
bool otIp6ArePrefixesEqual(
  const otIp6Prefix *aFirst,
  const otIp6Prefix *aSecond
)
```
Test if two IPv6 prefixes are the same.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aFirst` | A pointer to the first IPv6 prefix to compare. | | `[in] aSecond` | A pointer to the second IPv6 prefix to compare. | |
| Return Values | |---|---| | `TRUE` | The two IPv6 prefixes are the same. | | `FALSE` | The two IPv6 prefixes are not the same. | |

### otIp6ExtractExtAddressFromIp6AddressIid

```
void otIp6ExtractExtAddressFromIp6AddressIid(
  const otIp6Address *aAddress,
  otExtAddress *aExtAddress
)
```
Extracts the MAC Extended Address from the Interface Identifier of the given IPv6 address.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aAddress` | A pointer to the IPv6 address. | | `[out] aExtAddress` | A pointer to output the MAC Extended Address (generated from the IID). | |

### otIp6FormLinkLocalAddressFromExtAddress

```
void otIp6FormLinkLocalAddressFromExtAddress(
  const otExtAddress *aExtAddress,
  otIp6Address *aAddress
)
```
Forms a link-local unicast IPv6 address from the Interface Identifier generated from the given MAC Extended Address with the universal/local bit inverted.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aExtAddress` | A pointer to the MAC Extended Address (used to generate the IID). | | `[out] aAddress` | A pointer to output the IPv6 link-local unicast address. | |

### otIp6GetBorderRoutingCounters

```
const otBorderRoutingCounters * otIp6GetBorderRoutingCounters(
  otInstance *aInstance
)
```
Gets the Border Routing counters.

`OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE` build-time feature must be enabled.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |
| **Returns** | A pointer to the Border Routing counters. |

### otIp6GetMulticastAddresses

```
const otNetifMulticastAddress * otIp6GetMulticastAddresses(
  otInstance *aInstance
)
```
Gets the list of IPv6 multicast addresses subscribed to the Thread interface.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |
| **Returns** | A pointer to the first Network Interface Multicast Address. |

### otIp6GetPrefix

```
void otIp6GetPrefix(
  const otIp6Address *aAddress,
  uint8_t aLength,
  otIp6Prefix *aPrefix
)
```
Gets a prefix with `aLength` from `aAddress`.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aAddress` | A pointer to an IPv6 address. | | `[in] aLength` | The length of prefix in bits. | | `[out] aPrefix` | A pointer to output the IPv6 prefix. | |

### otIp6GetUnicastAddresses

```
const otNetifAddress * otIp6GetUnicastAddresses(
  otInstance *aInstance
)
```
Gets the list of IPv6 addresses assigned to the Thread interface.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |
| **Returns** | A pointer to the first Network Interface Address. |

### otIp6GetUnsecurePorts

```
const uint16_t * otIp6GetUnsecurePorts(
  otInstance *aInstance,
  uint8_t *aNumEntries
)
```
Returns a pointer to the unsecure port list.


> [!NOTE]
> **Note:** Port value 0 is used to indicate an invalid entry.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[out] aNumEntries` | The number of entries in the list. | |
| **Returns** | A pointer to the unsecure port list. |

### otIp6HasUnicastAddress

```
bool otIp6HasUnicastAddress(
  otInstance *aInstance,
  const otIp6Address *aAddress
)
```
Indicates whether or not a unicast IPv6 address is assigned to the Thread interface.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aAddress` | A pointer to the unicast address. | |
| Return Values | |---|---| | `TRUE` | If `aAddress` is assigned to the Thread interface. | | `FALSE` | If `aAddress` is not assigned to the Thread interface. | |

### otIp6Init

```
otError otIp6Init(
  otInstance *aInstance,
  otNetifAddress *aUnicastAddrPool,
  uint16_t aUnicastAddrPoolSize,
  otNetifMulticastAddress *aMulticastAddrPool,
  uint16_t aMulticastAddrPoolSize
)
```
Initializes the IPv6 interface and its external address pools.

Requires `OPENTHREAD_CONFIG_IP6_INIT_EXT_ADDR_POOL_ENABLE`.

It provides the memory buffers for the external unicast and multicast address pools and must be called before enabling the IPv6 interface.

The provided memory buffers MUST persist and remain valid as long as the OpenThread instance is initialized. OpenThread will use these provided buffers to manage the pools of externally added unicast and multicast addresses (i.e., those added via `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gafba5b6ff43be8ec8eeefadfb97beccb8` and `https://openthread.io/reference/group/api-ip6#group__api-ip6_1gaaad3f2b2e8bb16aaba23c811796852a0`).

This function can only be called once. Subsequent calls will return `OT_ERROR_ALREADY`.

The `OPENTHREAD_CONFIG_IP6_INIT_EXT_ADDR_POOL_ENABLE` feature and this function allow the external unicast/multicast address pools to be configured at run-time after OpenThread instance initialization, rather than build-time. When this feature is disabled, the build-time configs `OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS` and `OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS` specify the pool sizes used by the OpenThread stack.

This feature allows the OpenThread stack to be compiled as a library without specifying the address pool sizes. It delegates the configuration of the pools to the next layer, allowing the OpenThread stack to be integrated into various projects without requiring a new OpenThread stack configuration to be built.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aUnicastAddrPool` | A pointer to an array of `https://openthread.io/reference/struct/ot-netif-address`. | | `[in] aUnicastAddrPoolSize` | The number of entries in `aUnicastAddrPool`. | | `[in] aMulticastAddrPool` | A pointer to an array of `https://openthread.io/reference/struct/ot-netif-multicast-address`. | | `[in] aMulticastAddrPoolSize` | The number of entries in `aMulticastAddrPool`. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully initialized the IPv6 interface. | | `OT_ERROR_ALREADY` | The IPv6 interface is already initialized. | |

### otIp6IsAddressEqual

```
bool otIp6IsAddressEqual(
  const otIp6Address *aFirst,
  const otIp6Address *aSecond
)
```
Test if two IPv6 addresses are the same.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aFirst` | A pointer to the first IPv6 address to compare. | | `[in] aSecond` | A pointer to the second IPv6 address to compare. | |
| Return Values | |---|---| | `TRUE` | The two IPv6 addresses are the same. | | `FALSE` | The two IPv6 addresses are not the same. | |

### otIp6IsAddressUnspecified

```
bool otIp6IsAddressUnspecified(
  const otIp6Address *aAddress
)
```
Indicates whether or not a given IPv6 address is the Unspecified Address.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aAddress` | A pointer to an IPv6 address. | |
| Return Values | |---|---| | `TRUE` | If the IPv6 address is the Unspecified Address. | | `FALSE` | If the IPv6 address is not the Unspecified Address. | |

### otIp6IsEnabled

```
bool otIp6IsEnabled(
  otInstance *aInstance
)
```
Indicates whether or not the IPv6 interface is up.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |
| Return Values | |---|---| | `TRUE` | The IPv6 interface is enabled. | | `FALSE` | The IPv6 interface is disabled. | |

### otIp6IsLinkLocalUnicast

```
bool otIp6IsLinkLocalUnicast(
  const otIp6Address *aAddress
)
```
Test whether or not the IPv6 address is a link-local unicast address.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aAddress` | A pointer to the IPv6 address to test. | |
| Return Values | |---|---| | `TRUE` | If the IPv6 address is a link-local unicast address. | | `FALSE` | If the IPv6 address is not a link-local unicast address. | |

### otIp6IsReceiveFilterEnabled

```
bool otIp6IsReceiveFilterEnabled(
  otInstance *aInstance
)
```
Indicates whether or not Thread control traffic is filtered out when delivering IPv6 datagrams via the callback specified in [otIp6SetReceiveCallback()](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1d8423905816ad0159c9445ed1d6cc42).

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |
| **Returns** | TRUE if Thread control traffic is filtered out, FALSE otherwise. |

**See also:**   
[otIp6SetReceiveCallback](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1d8423905816ad0159c9445ed1d6cc42)   
[otIp6SetReceiveFilterEnabled](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga51cc60fc85f913a7241fc32a64bcf597)   

### otIp6IsSlaacEnabled

```
bool otIp6IsSlaacEnabled(
  otInstance *aInstance
)
```
Indicates whether the SLAAC module is enabled or not.

`OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE` build-time feature must be enabled.

<br />

| Details ||
|---|---|
| Return Values | |---|---| | `TRUE` | SLAAC module is enabled. | | `FALSE` | SLAAC module is disabled. | |

### otIp6IsUnsecureAllowedWhenDisabled

```
bool otIp6IsUnsecureAllowedWhenDisabled(
  otInstance *aInstance
)
```
Indicates whether allowing link-local unsecure IPv6 datagrams when the Thread role is disabled is enabled.

Available only when `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is enabled.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |
| Return Values | |---|---| | `TRUE` | Does allow unsecure IPv6 datagrams when the Thread role is disabled. | | `FALSE` | Does not allow unsecure IPv6 datagrams when the Thread role is disabled. | |

### otIp6NewMessage

```
otMessage * otIp6NewMessage(
  otInstance *aInstance,
  const otMessageSettings *aSettings
)
```
Allocate a new message buffer for sending an IPv6 message.


> [!NOTE]
> **Note:** If `aSettings` is 'NULL', the link layer security is enabled and the message priority is set to OT_MESSAGE_PRIORITY_NORMAL by default.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aSettings` | A pointer to the message settings or NULL to set default settings. | |
| **Returns** | A pointer to the message buffer or NULL if no message buffers are available or parameters are invalid. |

**See also:**   
[otMessageFree](https://openthread.io/reference/group/api-message#group__api-message_1ga70291a9d11f2f2a0bff290bf8ff4ea20)   

### otIp6NewMessageFromBuffer

```
otMessage * otIp6NewMessageFromBuffer(
  otInstance *aInstance,
  const uint8_t *aData,
  uint16_t aDataLength,
  const otMessageSettings *aSettings
)
```
Allocate a new message buffer and write the IPv6 datagram to the message buffer for sending an IPv6 message.


> [!NOTE]
> **Note:** If `aSettings` is NULL, the link layer security is enabled and the message priority is obtained from IPv6 message itself. If `aSettings` is not NULL, the `aSetting->mPriority` is ignored and obtained from IPv6 message itself.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aData` | A pointer to the IPv6 datagram buffer. | | `[in] aDataLength` | The size of the IPv6 datagram buffer pointed by `aData`. | | `[in] aSettings` | A pointer to the message settings or NULL to set default settings. | |
| **Returns** | A pointer to the message or NULL if malformed IPv6 header or insufficient message buffers are available. |

**See also:**   
[otMessageFree](https://openthread.io/reference/group/api-message#group__api-message_1ga70291a9d11f2f2a0bff290bf8ff4ea20)   

### otIp6PrefixFromString

```
otError otIp6PrefixFromString(
  const char *aString,
  otIp6Prefix *aPrefix
)
```
Converts a human-readable IPv6 prefix string into a binary representation.

The `aString` parameter should be a string in the format "
/", where is an IPv6 address and is a prefix length.

<br />

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aString` | A pointer to a NULL-terminated string. | | `[out] aPrefix` | A pointer to an IPv6 prefix. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully parsed the string as an IPv6 prefix and updated `aPrefix`. | | `OT_ERROR_PARSE` | Failed to parse `aString` as an IPv6 prefix. | |

### otIp6PrefixMatch

```
uint8_t otIp6PrefixMatch(
  const otIp6Address *aFirst,
  const otIp6Address *aSecond
)
```
Returns the prefix match length (bits) for two IPv6 addresses.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aFirst` | A pointer to the first IPv6 address. | | `[in] aSecond` | A pointer to the second IPv6 address. | |
| **Returns** | The prefix match length in bits. |

### otIp6PrefixToString

```
void otIp6PrefixToString(
  const otIp6Prefix *aPrefix,
  char *aBuffer,
  uint16_t aSize
)
```
Converts a given IPv6 prefix to a human-readable string.

The IPv6 address string is formatted as "%x:%x:%x:...\[::\]/plen".

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] aPrefix` | A pointer to an IPv6 prefix (MUST NOT be NULL). | | `[out] aBuffer` | A pointer to a char array to output the string (MUST NOT be NULL). | | `[in] aSize` | The size of `aBuffer` (in bytes). Recommended to use `OT_IP6_PREFIX_STRING_SIZE`. | |

### otIp6ProtoToString

```
const char * otIp6ProtoToString(
  uint8_t aIpProto
)
```
Converts a given IP protocol number to a human-readable string.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aIpProto` | An IP protocol number (`OT_IP6_PROTO_*` enumeration). | |
| **Returns** | A string representing `aIpProto`. |

### otIp6RegisterMulticastListeners

```
otError otIp6RegisterMulticastListeners(
  otInstance *aInstance,
  const otIp6Address *aAddresses,
  uint8_t aAddressNum,
  const uint32_t *aTimeout,
  otIp6RegisterMulticastListenersCallback aCallback,
  void *aContext
)
```
Registers Multicast Listeners to Primary Backbone Router.

`OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE` and `OPENTHREAD_CONFIG_COMMISSIONER_ENABLE` must be enabled.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aAddresses` | A Multicast Address Array to register. | | `[in] aAddressNum` | The number of Multicast Address to register (0 if `aAddresses` is NULL). | | `[in] aTimeout` | A pointer to the timeout value (in seconds) to be included in MLR.req. A timeout value of 0 removes the corresponding Multicast Listener. If NULL, MLR.req would have no Timeout Tlv by default. | | `[in] aCallback` | A pointer to the callback function. | | `[in] aContext` | A pointer to the user context. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully sent MLR.req. The `aCallback` will be called iff this method returns OT_ERROR_NONE. | | `OT_ERROR_BUSY` | If a previous registration was ongoing. | | `OT_ERROR_INVALID_ARGS` | If one or more arguments are invalid. | | `OT_ERROR_INVALID_STATE` | If the device was not in a valid state to send MLR.req (e.g. Commissioner not started, Primary Backbone Router not found). | | `OT_ERROR_NO_BUFS` | If insufficient message buffers available. | |

**See also:**   
[otIp6RegisterMulticastListenersCallback](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga3894a57ec32344559378d863602de6a8)   

### otIp6RemoveAllUnsecurePorts

```
void otIp6RemoveAllUnsecurePorts(
  otInstance *aInstance
)
```
Removes all ports from the allowed unsecure port list.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |

### otIp6RemoveUnicastAddress

```
otError otIp6RemoveUnicastAddress(
  otInstance *aInstance,
  const otIp6Address *aAddress
)
```
Removes a Network Interface Address from the Thread interface.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aAddress` | A pointer to an IP Address. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully removed the Network Interface Address. | | `OT_ERROR_INVALID_ARGS` | The IP Address indicated by `aAddress` is an internal address. | | `OT_ERROR_NOT_FOUND` | The IP Address indicated by `aAddress` was not found. | |

### otIp6RemoveUnsecurePort

```
otError otIp6RemoveUnsecurePort(
  otInstance *aInstance,
  uint16_t aPort
)
```
Removes a port from the allowed unsecure port list.


> [!NOTE]
> **Note:** This function removes `aPort` by overwriting `aPort` with the element after `aPort` in the internal port list. Be careful when calling [otIp6GetUnsecurePorts()](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga27c2c884bee5ebca73748237f62187d7) followed by [otIp6RemoveUnsecurePort()](https://openthread.io/reference/group/api-ip6#group__api-ip6_1gacc5cb6166a6a86ea8cd3101c822089d1) to remove unsecure ports.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aPort` | The port value. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | The port was successfully removed from the allowed unsecure port list. | | `OT_ERROR_INVALID_ARGS` | The port is invalid (value 0 is reserved for internal use). | | `OT_ERROR_NOT_FOUND` | The port was not found in the unsecure port list. | |

### otIp6ResetBorderRoutingCounters

```
void otIp6ResetBorderRoutingCounters(
  otInstance *aInstance
)
```
Resets the Border Routing counters.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |

### otIp6SelectSourceAddress

```
otError otIp6SelectSourceAddress(
  otInstance *aInstance,
  otMessageInfo *aMessageInfo
)
```
Perform OpenThread source address selection.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in,out] aMessageInfo` | A pointer to the message information. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Found a source address and is filled into mSockAddr of `aMessageInfo`. | | `OT_ERROR_NOT_FOUND` | No source address was found and `aMessageInfo` is unchanged. | |

### otIp6Send

```
otError otIp6Send(
  otInstance *aInstance,
  otMessage *aMessage
)
```
Sends an IPv6 datagram via the Thread interface.

The caller transfers ownership of `aMessage` when making this call. OpenThread will free `aMessage` when processing is complete, including when a value other than `OT_ERROR_NONE` is returned.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aMessage` | A pointer to the message buffer containing the IPv6 datagram. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully processed the message. | | `OT_ERROR_DROP` | Message was well-formed but not fully processed due to packet processing rules. | | `OT_ERROR_NO_BUFS` | Could not allocate necessary message buffers when processing the datagram. | | `OT_ERROR_NO_ROUTE` | No route to host. | | `OT_ERROR_INVALID_SOURCE_ADDRESS` | Source address is invalid, e.g. an anycast address or a multicast address. | | `OT_ERROR_PARSE` | Encountered a malformed header when processing the message. | | `OT_ERROR_INVALID_ARGS` | The message's metadata is invalid, e.g. the message uses `OT_MESSAGE_ORIGIN_THREAD_NETIF` as the origin. | |

### otIp6SetAddressCallback

```
void otIp6SetAddressCallback(
  otInstance *aInstance,
  otIp6AddressCallback aCallback,
  void *aCallbackContext
)
```
Registers a callback to notify internal IPv6 address changes.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aCallback` | A pointer to a function that is called when an internal IPv6 address is added or removed. NULL to disable the callback. | | `[in] aCallbackContext` | A pointer to application-specific context. | |

### otIp6SetAllowUnsecureWhenDisabled

```
void otIp6SetAllowUnsecureWhenDisabled(
  otInstance *aInstance,
  bool aAllow
)
```
Sets whether to allow link-local unsecure IPv6 datagrams when the Thread role is disabled.

Available only when `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is enabled. This is intended for testing. By default, this is disabled (i.e., unsecure traffic is always dropped regardless of the device's role).

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aAllow` | TRUE to allow, FALSE otherwise. | |

### otIp6SetEnabled

```
otError otIp6SetEnabled(
  otInstance *aInstance,
  bool aEnabled
)
```
Brings the IPv6 interface up or down.

Call this to enable or disable IPv6 communication.

When `OPENTHREAD_CONFIG_IP6_INIT_EXT_ADDR_POOL_ENABLE` is enabled, `https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1267e60c738b2695c32c9fb2af2a552b` MUST be called prior to calling this function. If it is not, this function will return `OT_ERROR_INVALID_STATE`.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aEnabled` | TRUE to enable IPv6, FALSE otherwise. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully brought the IPv6 interface up/down. | | `OT_ERROR_INVALID_STATE` | IPv6 interface is not available since device is operating in raw-link mode (applicable only when `OPENTHREAD_CONFIG_LINK_RAW_ENABLE` feature is enabled), or not initialized under `OPENTHREAD_CONFIG_IP6_INIT_EXT_ADDR_POOL_ENABLE`. | |

### otIp6SetMeshLocalIid

```
otError otIp6SetMeshLocalIid(
  otInstance *aInstance,
  const otIp6InterfaceIdentifier *aIid
)
```
Sets the Mesh Local IID (for test purpose).

Requires `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE`.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aIid` | A pointer to the Mesh Local IID to set. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully set the Mesh Local IID. | | `OT_ERROR_INVALID_STATE` | Thread protocols are enabled. | |

### otIp6SetReceiveCallback

```
void otIp6SetReceiveCallback(
  otInstance *aInstance,
  otIp6ReceiveCallback aCallback,
  void *aCallbackContext
)
```
Registers a callback to provide received IPv6 datagrams.

By default, this callback does not pass Thread control traffic. See [otIp6SetReceiveFilterEnabled()](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga51cc60fc85f913a7241fc32a64bcf597) to change the Thread control traffic filter setting.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aCallback` | A pointer to a function that is called when an IPv6 datagram is received or NULL to disable the callback. | | `[in] aCallbackContext` | A pointer to application-specific context. | |

**See also:**   
[otIp6IsReceiveFilterEnabled](https://openthread.io/reference/group/api-ip6#group__api-ip6_1gae3117a710584f3ea0dc494bb8597009f)   
[otIp6SetReceiveFilterEnabled](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga51cc60fc85f913a7241fc32a64bcf597)   

### otIp6SetReceiveFilterEnabled

```
void otIp6SetReceiveFilterEnabled(
  otInstance *aInstance,
  bool aEnabled
)
```
Sets whether or not Thread control traffic is filtered out when delivering IPv6 datagrams via the callback specified in [otIp6SetReceiveCallback()](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1d8423905816ad0159c9445ed1d6cc42).

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aEnabled` | TRUE if Thread control traffic is filtered out, FALSE otherwise. | |

**See also:**   
[otIp6SetReceiveCallback](https://openthread.io/reference/group/api-ip6#group__api-ip6_1ga1d8423905816ad0159c9445ed1d6cc42)  
otIsReceiveIp6FilterEnabled   

### otIp6SetSlaacEnabled

```
void otIp6SetSlaacEnabled(
  otInstance *aInstance,
  bool aEnabled
)
```
Enables/disables the SLAAC module.

`OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE` build-time feature must be enabled.

When SLAAC module is enabled, SLAAC addresses (based on on-mesh prefixes in Network Data) are added to the interface. When SLAAC module is disabled any previously added SLAAC address is removed.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aEnabled` | TRUE to enable, FALSE to disable. | |

### otIp6SetSlaacPrefixFilter

```
void otIp6SetSlaacPrefixFilter(
  otInstance *aInstance,
  otIp6SlaacPrefixFilter aFilter
)
```
Sets the SLAAC module filter handler.

`OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE` build-time feature must be enabled.

The filter handler is called by SLAAC module when it is about to add a SLAAC address based on a prefix to decide whether the address should be added or not.

A NULL filter handler disables filtering and allows all SLAAC addresses to be added.

If this function is not called, the default filter used by SLAAC module will be NULL (filtering is disabled).

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aFilter` | A pointer to SLAAC prefix filter handler, or NULL to disable filtering. | |

### otIp6SockAddrToString

```
void otIp6SockAddrToString(
  const otSockAddr *aSockAddr,
  char *aBuffer,
  uint16_t aSize
)
```
Converts a given IPv6 socket address to a human-readable string.

The IPv6 socket address string is formatted as \[`address`\]:`port` where `address` is shown as 16 hex values separated by `:` and `port` is the port number in decimal format, for example "\[%x:%x:...:%x\]:%u".

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] aSockAddr` | A pointer to an IPv6 socket address (MUST NOT be NULL). | | `[out] aBuffer` | A pointer to a char array to output the string (MUST NOT be NULL). | | `[in] aSize` | The size of `aBuffer` (in bytes). Recommended to use `OT_IP6_SOCK_ADDR_STRING_SIZE`. | |

### otIp6SubscribeMulticastAddress

```
otError otIp6SubscribeMulticastAddress(
  otInstance *aInstance,
  const otIp6Address *aAddress
)
```
Subscribes the Thread interface to a Network Interface Multicast Address.

The passed in instance `aAddress` will be copied by the Thread interface. The Thread interface only supports a fixed number of externally added multicast addresses. See `OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS` and `OPENTHREAD_CONFIG_IP6_INIT_EXT_ADDR_POOL_ENABLE`.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aAddress` | A pointer to an IP Address. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully subscribed to the Network Interface Multicast Address. | | `OT_ERROR_ALREADY` | The multicast address is already subscribed. | | `OT_ERROR_INVALID_ARGS` | The IP Address indicated by `aAddress` is an invalid multicast address. | | `OT_ERROR_REJECTED` | The IP Address indicated by `aAddress` is an internal multicast address. | | `OT_ERROR_NO_BUFS` | The Network Interface is already storing the maximum allowed external multicast addresses. | |

### otIp6UnsubscribeMulticastAddress

```
otError otIp6UnsubscribeMulticastAddress(
  otInstance *aInstance,
  const otIp6Address *aAddress
)
```
Unsubscribes the Thread interface to a Network Interface Multicast Address.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aAddress` | A pointer to an IP Address. | |
| Return Values | |---|---| | `OT_ERROR_NONE` | Successfully unsubscribed to the Network Interface Multicast Address. | | `OT_ERROR_REJECTED` | The IP Address indicated by `aAddress` is an internal address. | | `OT_ERROR_NOT_FOUND` | The IP Address indicated by `aAddress` was not found. | |

## Macros

### OT_IP6_ADDRESS_BITSIZE

```
 OT_IP6_ADDRESS_BITSIZE (OT_IP6_ADDRESS_SIZE * 8)
```
Size of an IPv6 address (bits)

### OT_IP6_ADDRESS_SIZE

```
 OT_IP6_ADDRESS_SIZE 16
```
Size of an IPv6 address (bytes)

### OT_IP6_ADDRESS_STRING_SIZE

```
 OT_IP6_ADDRESS_STRING_SIZE 40
```
Recommended size for string representation of an IPv6 address.

### OT_IP6_HEADER_PROTO_OFFSET

```
 OT_IP6_HEADER_PROTO_OFFSET 6
```
Offset of the proto field in the IPv6 header (bytes)

### OT_IP6_HEADER_SIZE

```
 OT_IP6_HEADER_SIZE 40
```
Size of an IPv6 header (bytes)

### OT_IP6_IID_SIZE

```
 OT_IP6_IID_SIZE 8
```
Size of an IPv6 Interface Identifier (bytes)

### OT_IP6_MAX_MLR_ADDRESSES

```
 OT_IP6_MAX_MLR_ADDRESSES 15
```
Max number of IPv6 addresses supported by Multicast Listener Registration.

### OT_IP6_PREFIX_BITSIZE

```
 OT_IP6_PREFIX_BITSIZE (OT_IP6_PREFIX_SIZE * 8)
```
Size of an IPv6 prefix (bits)

### OT_IP6_PREFIX_SIZE

```
 OT_IP6_PREFIX_SIZE 8
```
Size of an IPv6 prefix (bytes)

### OT_IP6_PREFIX_STRING_SIZE

```
 OT_IP6_PREFIX_STRING_SIZE 45
```
Recommended size for string representation of an IPv6 prefix.

### OT_IP6_SOCK_ADDR_STRING_SIZE

```
 OT_IP6_SOCK_ADDR_STRING_SIZE 48
```
Recommended size for string representation of an IPv6 socket address.

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