Modules#
IPv6#
This module includes functions that control IPv6 communication.
Enumerations#
IPv6 Address origins.
ECN statuses, represented as in the IP header.
Internet Protocol Numbers.
Typedefs#
This structure represents the Interface Identifier of an IPv6 address.
This structure represents the Network Prefix of an IPv6 address (most significant 64 bits of the address).
This structure represents the components of an IPv6 address.
This structure represents an IPv6 address.
This structure represents an IPv6 prefix.
This structure represents an IPv6 network interface unicast address.
This structure represents an IPv6 network interface multicast address.
This structure represents an IPv6 socket address.
This structure represents the local and peer IPv6 socket addresses.
This function pointer is called when an IPv6 datagram is received.
This function pointer is called when an internal IPv6 address is added or removed.
This function pointer allows user to filter prefixes and not allow an SLAAC address based on a prefix to be added.
This function pointer is called with results of otIp6RegisterMulticastListeners
.
This structure represents the counters for packets and bytes.
This structure represents the counters of packets forwarded via Border Routing.
Variables#
Functions#
Brings the IPv6 interface up or down.
Indicates whether or not the IPv6 interface is up.
Adds a Network Interface Address to the Thread interface.
Removes a Network Interface Address from the Thread interface.
Gets the list of IPv6 addresses assigned to the Thread interface.
Subscribes the Thread interface to a Network Interface Multicast Address.
Unsubscribes the Thread interface to a Network Interface Multicast Address.
Gets the list of IPv6 multicast addresses subscribed to the Thread interface.
Checks if multicast promiscuous mode is enabled on the Thread interface.
Enables or disables multicast promiscuous mode on the Thread interface.
Allocate a new message buffer for sending an IPv6 message.
Allocate a new message buffer and write the IPv6 datagram to the message buffer for sending an IPv6 message.
This function registers a callback to provide received IPv6 datagrams.
This function registers a callback to notify internal IPv6 address changes.
This function indicates whether or not Thread control traffic is filtered out when delivering IPv6 datagrams via the callback specified in otIp6SetReceiveCallback().
This function sets whether or not Thread control traffic is filtered out when delivering IPv6 datagrams via the callback specified in otIp6SetReceiveCallback().
This function adds a port to the allowed unsecured port list.
This function removes a port from the allowed unsecure port list.
This function removes all ports from the allowed unsecure port list.
This function returns a pointer to the unsecure port list.
Test if two IPv6 addresses are the same.
Test if two IPv6 prefixes are the same.
This function converts a human-readable IPv6 address string into a binary representation.
This function converts a human-readable IPv6 prefix string into a binary representation.
This function converts a given IPv6 address to a human-readable string.
This function converts a given IPv6 socket address to a human-readable string.
This function converts a given IPv6 prefix to a human-readable string.
This function returns the prefix match length (bits) for two IPv6 addresses.
This method gets a prefix with aLength
from aAddress
.
This function indicates whether or not a given IPv6 address is the Unspecified Address.
This function perform OpenThread source address selection.
This function indicates whether the SLAAC module is enabled or not.
This function enables/disables the SLAAC module.
This function sets the SLAAC module filter handler.
This function registers Multicast Listeners to Primary Backbone Router.
This function sets the Mesh Local IID (for test purpose).
This function converts a given IP protocol number to a human-readable string.
Gets the Border Routing counters.
Resets the Border Routing counters.
Macros#
Size of an IPv6 prefix (bytes)
Size of an IPv6 prefix (bits)
Size of an IPv6 Interface Identifier (bytes)
Size of an IPv6 address (bytes)
Recommended size for string representation of an IPv6 address.
Recommended size for string representation of an IPv6 socket address.
Recommended size for string representation of an IPv6 prefix.
Max number of IPv6 addresses supported by Multicast Listener Registration.
Enumeration Documentation#
@3#
@3
IPv6 Address origins.
Enumerator | |
---|---|
OT_ADDRESS_ORIGIN_THREAD | Thread assigned address (ALOC, RLOC, MLEID, etc) |
OT_ADDRESS_ORIGIN_SLAAC | SLAAC assigned address. |
OT_ADDRESS_ORIGIN_DHCPV6 | DHCPv6 assigned address. |
OT_ADDRESS_ORIGIN_MANUAL | Manually assigned address. |
@4#
@4
ECN statuses, represented as in the IP header.
Enumerator | |
---|---|
OT_ECN_NOT_CAPABLE | Non-ECT. |
OT_ECN_CAPABLE_0 | ECT(0) |
OT_ECN_CAPABLE_1 | ECT(1) |
OT_ECN_MARKED | Congestion encountered (CE) |
@5#
@5
Internet Protocol Numbers.
Enumerator | |
---|---|
OT_IP6_PROTO_HOP_OPTS | IPv6 Hop-by-Hop Option. |
OT_IP6_PROTO_TCP | Transmission Control Protocol. |
OT_IP6_PROTO_UDP | User Datagram. |
OT_IP6_PROTO_IP6 | IPv6 encapsulation. |
OT_IP6_PROTO_ROUTING | Routing Header for IPv6. |
OT_IP6_PROTO_FRAGMENT | Fragment Header for IPv6. |
OT_IP6_PROTO_ICMP6 | ICMP for IPv6. |
OT_IP6_PROTO_NONE | No Next Header for IPv6. |
OT_IP6_PROTO_DST_OPTS | Destination Options for IPv6. |
Typedef Documentation#
otIp6InterfaceIdentifier#
typedef struct otIp6InterfaceIdentifier otIp6InterfaceIdentifier
This structure represents the Interface Identifier of an IPv6 address.
otIp6NetworkPrefix#
typedef struct otIp6NetworkPrefix otIp6NetworkPrefix
This structure represents the Network Prefix of an IPv6 address (most significant 64 bits of the address).
otIp6AddressComponents#
typedef struct otIp6AddressComponents otIp6AddressComponents
This structure represents the components of an IPv6 address.
otNetifAddress#
typedef struct otNetifAddress otNetifAddress
This structure represents an IPv6 network interface unicast address.
otNetifMulticastAddress#
typedef struct otNetifMulticastAddress otNetifMulticastAddress
This structure represents an IPv6 network interface multicast address.
otMessageInfo#
typedef struct otMessageInfo otMessageInfo
This structure represents the local and peer IPv6 socket addresses.
otIp6ReceiveCallback#
typedef void(* otIp6ReceiveCallback) (otMessage *aMessage, void *aContext) )(otMessage *aMessage, void *aContext)
This function pointer is called when an IPv6 datagram is received.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aMessage | A pointer to the message buffer containing the received IPv6 datagram. This function transfers the ownership of the | |
[in] | aContext | A pointer to application-specific context. |
otIp6AddressCallback#
typedef void(* otIp6AddressCallback) (const otIp6AddressInfo *aAddressInfo, bool aIsAdded, void *aContext) )(const otIp6AddressInfo *aAddressInfo, bool aIsAdded, void *aContext)
This function pointer is called when an internal IPv6 address is added or removed.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aAddressInfo | A pointer to the IPv6 address information. | |
[in] | aIsAdded | TRUE if the | |
[in] | aContext | A pointer to application-specific context. |
otIp6SlaacPrefixFilter#
typedef bool(* otIp6SlaacPrefixFilter) (otInstance *aInstance, const otIp6Prefix *aPrefix) )(otInstance *aInstance, const otIp6Prefix *aPrefix)
This function pointer allows user to filter prefixes and not allow an SLAAC address based on a prefix to be added.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aInstance | A pointer to an OpenThread instance. | |
[in] | aPrefix | A pointer to prefix for which SLAAC address is about to be added. |
otIp6SetSlaacPrefixFilter()
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.
otIp6RegisterMulticastListenersCallback#
typedef void(* otIp6RegisterMulticastListenersCallback) (void *aContext, otError aError, uint8_t aMlrStatus, const otIp6Address *aFailedAddresses, uint8_t aFailedAddressNum) )(void *aContext, otError aError, uint8_t aMlrStatus, const otIp6Address *aFailedAddresses, uint8_t aFailedAddressNum)
This function pointer is called with results of otIp6RegisterMulticastListeners
.
Type | Direction | Argument Name | Description |
---|---|---|---|
[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 | |
[in] | aFailedAddresses | A pointer to the failed IPv6 addresses when | |
[in] | aFailedAddressNum | The number of failed IPv6 addresses when |
See Also
otPacketsAndBytes#
typedef struct otPacketsAndBytes otPacketsAndBytes
This structure represents the counters for packets and bytes.
otBorderRoutingCounters#
typedef struct otBorderRoutingCounters otBorderRoutingCounters
This structure represents the counters of packets forwarded via Border Routing.
Variable Documentation#
Function Documentation#
otIp6SetEnabled#
otError otIp6SetEnabled (otInstance * aInstance, bool aEnabled)
Brings the IPv6 interface up or down.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
bool | [in] | aEnabled | TRUE to enable IPv6, FALSE otherwise. |
Call this to enable or disable IPv6 communication.
otIp6IsEnabled#
bool otIp6IsEnabled (otInstance * aInstance)
Indicates whether or not the IPv6 interface is up.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otIp6AddUnicastAddress#
otError otIp6AddUnicastAddress (otInstance * aInstance, const otNetifAddress * aAddress)
Adds a Network Interface Address to the Thread interface.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otNetifAddress * | [in] | aAddress | A pointer to a Network Interface Address. |
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
.
otIp6RemoveUnicastAddress#
otError otIp6RemoveUnicastAddress (otInstance * aInstance, const otIp6Address * aAddress)
Removes a Network Interface Address from the Thread interface.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otIp6Address * | [in] | aAddress | A pointer to an IP Address. |
otIp6GetUnicastAddresses#
const otNetifAddress * otIp6GetUnicastAddresses (otInstance * aInstance)
Gets the list of IPv6 addresses assigned to the Thread interface.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
A pointer to the first Network Interface Address.
otIp6SubscribeMulticastAddress#
otError otIp6SubscribeMulticastAddress (otInstance * aInstance, const otIp6Address * aAddress)
Subscribes the Thread interface to a Network Interface Multicast Address.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otIp6Address * | [in] | aAddress | A pointer to an IP 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
.
otIp6UnsubscribeMulticastAddress#
otError otIp6UnsubscribeMulticastAddress (otInstance * aInstance, const otIp6Address * aAddress)
Unsubscribes the Thread interface to a Network Interface Multicast Address.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otIp6Address * | [in] | aAddress | A pointer to an IP Address. |
otIp6GetMulticastAddresses#
const otNetifMulticastAddress * otIp6GetMulticastAddresses (otInstance * aInstance)
Gets the list of IPv6 multicast addresses subscribed to the Thread interface.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
A pointer to the first Network Interface Multicast Address.
otIp6IsMulticastPromiscuousEnabled#
bool otIp6IsMulticastPromiscuousEnabled (otInstance * aInstance)
Checks if multicast promiscuous mode is enabled on the Thread interface.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
See Also
otIp6SetMulticastPromiscuousEnabled#
void otIp6SetMulticastPromiscuousEnabled (otInstance * aInstance, bool aEnabled)
Enables or disables multicast promiscuous mode on the Thread interface.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
bool | [in] | aEnabled | TRUE to enable Multicast Promiscuous mode, FALSE otherwise. |
See Also
otIp6NewMessage#
otMessage * otIp6NewMessage (otInstance * aInstance, const otMessageSettings * aSettings)
Allocate a new message buffer for sending an IPv6 message.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otMessageSettings * | [in] | aSettings | A pointer to the message settings or NULL to set default settings. |
Note
If
aSettings
is 'NULL', the link layer security is enabled and the message priority is set to OT_MESSAGE_PRIORITY_NORMAL by default.
Returns
A pointer to the message buffer or NULL if no message buffers are available or parameters are invalid.
See Also
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const uint8_t * | [in] | aData | A pointer to the IPv6 datagram buffer. |
uint16_t | [in] | aDataLength | The size of the IPv6 datagram buffer pointed by |
const otMessageSettings * | [in] | aSettings | A pointer to the message settings or NULL to set default settings. |
Note
If
aSettings
is NULL, the link layer security is enabled and the message priority is obtained from IPv6 message itself. IfaSettings
is not NULL, theaSetting->mPriority
is ignored and obtained from IPv6 message itself.
Returns
A pointer to the message or NULL if malformed IPv6 header or insufficient message buffers are available.
See Also
otIp6SetReceiveCallback#
void otIp6SetReceiveCallback (otInstance * aInstance, otIp6ReceiveCallback aCallback, void * aCallbackContext)
This function registers a callback to provide received IPv6 datagrams.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otIp6ReceiveCallback | [in] | aCallback | A pointer to a function that is called when an IPv6 datagram is received or NULL to disable the callback. |
void * | [in] | aCallbackContext | A pointer to application-specific context. |
By default, this callback does not pass Thread control traffic. See otIp6SetReceiveFilterEnabled() to change the Thread control traffic filter setting.
See Also
otIp6SetAddressCallback#
void otIp6SetAddressCallback (otInstance * aInstance, otIp6AddressCallback aCallback, void * aCallbackContext)
This function registers a callback to notify internal IPv6 address changes.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otIp6AddressCallback | [in] | aCallback | A pointer to a function that is called when an internal IPv6 address is added or removed. NULL to disable the callback. |
void * | [in] | aCallbackContext | A pointer to application-specific context. |
otIp6IsReceiveFilterEnabled#
bool otIp6IsReceiveFilterEnabled (otInstance * aInstance)
This function indicates whether or not Thread control traffic is filtered out when delivering IPv6 datagrams via the callback specified in otIp6SetReceiveCallback().
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
TRUE if Thread control traffic is filtered out, FALSE otherwise.
See Also
otIp6SetReceiveFilterEnabled#
void otIp6SetReceiveFilterEnabled (otInstance * aInstance, bool aEnabled)
This function sets whether or not Thread control traffic is filtered out when delivering IPv6 datagrams via the callback specified in otIp6SetReceiveCallback().
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
bool | [in] | aEnabled | TRUE if Thread control traffic is filtered out, FALSE otherwise. |
See Also
otIsReceiveIp6FilterEnabled
otIp6Send#
otError otIp6Send (otInstance * aInstance, otMessage * aMessage)
This function sends an IPv6 datagram via the Thread interface.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otMessage * | [in] | aMessage | A pointer to the message buffer containing the IPv6 datagram. |
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.
otIp6AddUnsecurePort#
otError otIp6AddUnsecurePort (otInstance * aInstance, uint16_t aPort)
This function adds a port to the allowed unsecured port list.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aPort | The port value. |
otIp6RemoveUnsecurePort#
otError otIp6RemoveUnsecurePort (otInstance * aInstance, uint16_t aPort)
This function removes a port from the allowed unsecure port list.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aPort | The port value. |
Note
This function removes
aPort
by overwritingaPort
with the element afteraPort
in the internal port list. Be careful when calling otIp6GetUnsecurePorts() followed by otIp6RemoveUnsecurePort() to remove unsecure ports.
otIp6RemoveAllUnsecurePorts#
void otIp6RemoveAllUnsecurePorts (otInstance * aInstance)
This function removes all ports from the allowed unsecure port list.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otIp6GetUnsecurePorts#
const uint16_t * otIp6GetUnsecurePorts (otInstance * aInstance, uint8_t * aNumEntries)
This function returns a pointer to the unsecure port list.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t * | [out] | aNumEntries | The number of entries in the list. |
Note
Port value 0 is used to indicate an invalid entry.
Returns
A pointer to the unsecure port list.
otIp6IsAddressEqual#
bool otIp6IsAddressEqual (const otIp6Address * aFirst, const otIp6Address * aSecond)
Test if two IPv6 addresses are the same.
Type | Direction | Argument Name | Description |
---|---|---|---|
const otIp6Address * | [in] | aFirst | A pointer to the first IPv6 address to compare. |
const otIp6Address * | [in] | aSecond | A pointer to the second IPv6 address to compare. |
otIp6ArePrefixesEqual#
bool otIp6ArePrefixesEqual (const otIp6Prefix * aFirst, const otIp6Prefix * aSecond)
Test if two IPv6 prefixes are the same.
Type | Direction | Argument Name | Description |
---|---|---|---|
const otIp6Prefix * | [in] | aFirst | A pointer to the first IPv6 prefix to compare. |
const otIp6Prefix * | [in] | aSecond | A pointer to the second IPv6 prefix to compare. |
otIp6AddressFromString#
otError otIp6AddressFromString (const char * aString, otIp6Address * aAddress)
This function converts a human-readable IPv6 address string into a binary representation.
Type | Direction | Argument Name | Description |
---|---|---|---|
const char * | [in] | aString | A pointer to a NULL-terminated string. |
otIp6Address * | [out] | aAddress | A pointer to an IPv6 address. |
otIp6PrefixFromString#
otError otIp6PrefixFromString (const char * aString, otIp6Prefix * aPrefix)
This function converts a human-readable IPv6 prefix string into a binary representation.
Type | Direction | Argument Name | Description |
---|---|---|---|
const char * | [in] | aString | A pointer to a NULL-terminated string. |
otIp6Prefix * | [out] | aPrefix | A pointer to an IPv6 prefix. |
The aString
parameter should be a string in the format "<address>/<plen>", where <address>
is an IPv6 address and <plen>
is a prefix length.
otIp6AddressToString#
void otIp6AddressToString (const otIp6Address * aAddress, char * aBuffer, uint16_t aSize)
This function converts a given IPv6 address to a human-readable string.
Type | Direction | Argument Name | Description |
---|---|---|---|
const otIp6Address * | [in] | aAddress | A pointer to an IPv6 address (MUST NOT be NULL). |
char * | [out] | aBuffer | A pointer to a char array to output the string (MUST NOT be NULL). |
uint16_t | [in] | aSize | The size of |
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.
otIp6SockAddrToString#
void otIp6SockAddrToString (const otSockAddr * aSockAddr, char * aBuffer, uint16_t aSize)
This function converts a given IPv6 socket address to a human-readable string.
Type | Direction | Argument Name | Description |
---|---|---|---|
const otSockAddr * | [in] | aSockAddr | A pointer to an IPv6 socket address (MUST NOT be NULL). |
char * | [out] | aBuffer | A pointer to a char array to output the string (MUST NOT be NULL). |
uint16_t | [in] | aSize | The size of |
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.
otIp6PrefixToString#
void otIp6PrefixToString (const otIp6Prefix * aPrefix, char * aBuffer, uint16_t aSize)
This function converts a given IPv6 prefix to a human-readable string.
Type | Direction | Argument Name | Description |
---|---|---|---|
const otIp6Prefix * | [in] | aPrefix | A pointer to an IPv6 prefix (MUST NOT be NULL). |
char * | [out] | aBuffer | A pointer to a char array to output the string (MUST NOT be NULL). |
uint16_t | [in] | aSize | The size of |
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.
otIp6PrefixMatch#
uint8_t otIp6PrefixMatch (const otIp6Address * aFirst, const otIp6Address * aSecond)
This function returns the prefix match length (bits) for two IPv6 addresses.
Type | Direction | Argument Name | Description |
---|---|---|---|
const otIp6Address * | [in] | aFirst | A pointer to the first IPv6 address. |
const otIp6Address * | [in] | aSecond | A pointer to the second IPv6 address. |
Returns
The prefix match length in bits.
otIp6GetPrefix#
void otIp6GetPrefix (const otIp6Address * aAddress, uint8_t aLength, otIp6Prefix * aPrefix)
This method gets a prefix with aLength
from aAddress
.
Type | Direction | Argument Name | Description |
---|---|---|---|
const otIp6Address * | [in] | aAddress | A pointer to an IPv6 address. |
uint8_t | [in] | aLength | The length of prefix in bits. |
otIp6Prefix * | [out] | aPrefix | A pointer to output the IPv6 prefix. |
otIp6IsAddressUnspecified#
bool otIp6IsAddressUnspecified (const otIp6Address * aAddress)
This function indicates whether or not a given IPv6 address is the Unspecified Address.
Type | Direction | Argument Name | Description |
---|---|---|---|
const otIp6Address * | [in] | aAddress | A pointer to an IPv6 address. |
otIp6SelectSourceAddress#
otError otIp6SelectSourceAddress (otInstance * aInstance, otMessageInfo * aMessageInfo)
This function perform OpenThread source address selection.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otMessageInfo * | [inout] | aMessageInfo | A pointer to the message information. |
otIp6IsSlaacEnabled#
bool otIp6IsSlaacEnabled (otInstance * aInstance)
This function indicates whether the SLAAC module is enabled or not.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | N/A | aInstance |
This function requires the build-time feature OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
to be enabled.
otIp6SetSlaacEnabled#
void otIp6SetSlaacEnabled (otInstance * aInstance, bool aEnabled)
This function enables/disables the SLAAC module.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
bool | [in] | aEnabled | TRUE to enable, FALSE to disable. |
This function requires the build-time feature OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
to 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.
otIp6SetSlaacPrefixFilter#
void otIp6SetSlaacPrefixFilter (otInstance * aInstance, otIp6SlaacPrefixFilter aFilter)
This function sets the SLAAC module filter handler.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otIp6SlaacPrefixFilter | [in] | aFilter | A pointer to SLAAC prefix filter handler, or NULL to disable filtering. |
This function requires the build-time feature OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
to 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).
otIp6RegisterMulticastListeners#
otError otIp6RegisterMulticastListeners (otInstance * aInstance, const otIp6Address * aAddresses, uint8_t aAddressNum, const uint32_t * aTimeout, otIp6RegisterMulticastListenersCallback aCallback, void * aContext)
This function registers Multicast Listeners to Primary Backbone Router.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otIp6Address * | [in] | aAddresses | A Multicast Address Array to register. |
uint8_t | [in] | aAddressNum | The number of Multicast Address to register (0 if |
const uint32_t * | [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. |
otIp6RegisterMulticastListenersCallback | [in] | aCallback | A pointer to the callback function. |
void * | [in] | aContext | A pointer to the user context. |
Note: only available when both OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE
and OPENTHREAD_CONFIG_COMMISSIONER_ENABLE
are enabled)
See Also
otIp6SetMeshLocalIid#
otError otIp6SetMeshLocalIid (otInstance * aInstance, const otIp6InterfaceIdentifier * aIid)
This function sets the Mesh Local IID (for test purpose).
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otIp6InterfaceIdentifier * | [in] | aIid | A pointer to the Mesh Local IID to set. |
Only available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
is enabled.
otIp6ProtoToString#
const char * otIp6ProtoToString (uint8_t aIpProto)
This function converts a given IP protocol number to a human-readable string.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | aIpProto | An IP protocol number ( |
Returns
A string representing
aIpProto
.
otIp6GetBorderRoutingCounters#
const otBorderRoutingCounters * otIp6GetBorderRoutingCounters (otInstance * aInstance)
Gets the Border Routing counters.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
This function requires the build-time feature OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE
to be enabled.
Returns
A pointer to the Border Routing counters.
otIp6ResetBorderRoutingCounters#
void otIp6ResetBorderRoutingCounters (otInstance * aInstance)
Resets the Border Routing counters.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |