IPv6
This module includes functions that control IPv6 communication.
Summary
Enumerations |
|
---|---|
Anonymous Enum 10{
|
enum Internet Protocol Numbers. |
Anonymous Enum 8{
|
enum IPv6 Address origins. |
Anonymous Enum 9{
|
enum ECN statuses, represented as in the IP header. |
Typedefs |
|
---|---|
otIp6Address
|
typedefstruct otIp6Address
This structure represents an IPv6 address. |
otIp6AddressCallback)(const otIp6AddressInfo *aAddressInfo, bool aIsAdded, void *aContext)
|
typedefvoid(*
This function pointer is called when an internal IPv6 address is added or removed. |
otIp6AddressComponents
|
typedefstruct otIp6AddressComponents
This structure represents the components of an IPv6 address. |
otIp6AddressInfo
|
typedefstruct otIp6AddressInfo
|
otIp6InterfaceIdentifier
|
typedefstruct otIp6InterfaceIdentifier
This structure represents the Interface Identifier of an IPv6 address. |
otIp6NetworkPrefix
|
typedefstruct otIp6NetworkPrefix
This structure represents the Network Prefix of an IPv6 address (most significant 64 bits of the address). |
otIp6Prefix
|
typedefstruct otIp6Prefix
This structure represents an IPv6 prefix. |
otIp6ReceiveCallback)(otMessage *aMessage, void *aContext)
|
typedefvoid(*
This function pointer is called when an IPv6 datagram is received. |
otIp6RegisterMulticastListenersCallback)(void *aContext, otError aError, uint8_t aMlrStatus, const otIp6Address *aFailedAddresses, uint8_t aFailedAddressNum)
|
typedefvoid(*
This function pointer is called with results of otIp6RegisterMulticastListeners . |
otIp6SlaacPrefixFilter)(otInstance *aInstance, const otIp6Prefix *aPrefix)
|
typedefbool(*
This function pointer allows user to filter prefixes and not allow an SLAAC address based on a prefix to be added. |
otMessageInfo
|
typedefstruct otMessageInfo
This structure represents the local and peer IPv6 socket addresses. |
otNetifAddress
|
typedefstruct otNetifAddress
This structure represents an IPv6 network interface unicast address. |
otNetifMulticastAddress
|
typedefstruct otNetifMulticastAddress
This structure represents an IPv6 network interface multicast address. |
otSockAddr
|
typedefstruct otSockAddr
This structure represents an IPv6 socket address. |
Variables |
|
---|---|
OT_TOOL_PACKED_END
|
Functions |
|
---|---|
otIp6AddUnicastAddress(otInstance *aInstance, const otNetifAddress *aAddress)
|
Adds a Network Interface Address to the Thread interface.
|
otIp6AddUnsecurePort(otInstance *aInstance, uint16_t aPort)
|
This function adds a port to the allowed unsecured port list.
|
otIp6AddressFromString(const char *aString, otIp6Address *aAddress)
|
This function converts a human-readable IPv6 address string into a binary representation.
|
otIp6AddressToString(const otIp6Address *aAddress, char *aBuffer, uint16_t aSize)
|
void
This function converts a given IPv6 address to a human-readable string.
|
otIp6ArePrefixesEqual(const otIp6Prefix *aFirst, const otIp6Prefix *aSecond)
|
bool
Test if two IPv6 prefixes are the same.
|
otIp6GetMulticastAddresses(otInstance *aInstance)
|
const otNetifMulticastAddress *
Gets the list of IPv6 multicast addresses subscribed to the Thread interface.
|
otIp6GetPrefix(const otIp6Address *aAddress, uint8_t aLength, otIp6Prefix *aPrefix)
|
void
This method gets a prefix with
aLength from aAddress . |
otIp6GetUnicastAddresses(otInstance *aInstance)
|
const otNetifAddress *
Gets the list of IPv6 addresses assigned to the Thread interface.
|
otIp6GetUnsecurePorts(otInstance *aInstance, uint8_t *aNumEntries)
|
const uint16_t *
This function returns a pointer to the unsecure port list.
|
otIp6IsAddressEqual(const otIp6Address *aFirst, const otIp6Address *aSecond)
|
bool
Test if two IPv6 addresses are the same.
|
otIp6IsAddressUnspecified(const otIp6Address *aAddress)
|
bool
This function indicates whether or not a given IPv6 address is the Unspecified Address.
|
otIp6IsEnabled(otInstance *aInstance)
|
bool
Indicates whether or not the IPv6 interface is up.
|
otIp6IsMulticastPromiscuousEnabled(otInstance *aInstance)
|
bool
Checks if multicast promiscuous mode is enabled on the Thread interface.
|
otIp6IsReceiveFilterEnabled(otInstance *aInstance)
|
bool
This function indicates whether or not Thread control traffic is filtered out when delivering IPv6 datagrams via the callback specified in otIp6SetReceiveCallback().
|
otIp6IsSlaacEnabled(otInstance *aInstance)
|
bool
This function indicates whether the SLAAC module is enabled or not.
|
otIp6NewMessage(otInstance *aInstance, const otMessageSettings *aSettings)
|
Allocate a new message buffer for sending an IPv6 message.
|
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.
|
otIp6PrefixMatch(const otIp6Address *aFirst, const otIp6Address *aSecond)
|
uint8_t
This function returns the prefix match length (bits) for two IPv6 addresses.
|
otIp6PrefixToString(const otIp6Prefix *aPrefix, char *aBuffer, uint16_t aSize)
|
void
This function converts a given IPv6 prefix to a human-readable string.
|
otIp6ProtoToString(uint8_t aIpProto)
|
const char *
This function converts a given IP protocol number to a human-readable string.
|
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.
|
otIp6RemoveAllUnsecurePorts(otInstance *aInstance)
|
void
This function removes all ports from the allowed unsecure port list.
|
otIp6RemoveUnicastAddress(otInstance *aInstance, const otIp6Address *aAddress)
|
Removes a Network Interface Address from the Thread interface.
|
otIp6RemoveUnsecurePort(otInstance *aInstance, uint16_t aPort)
|
This function removes a port from the allowed unsecure port list.
|
otIp6SelectSourceAddress(otInstance *aInstance, otMessageInfo *aMessageInfo)
|
This function perform OpenThread source address selection.
|
otIp6Send(otInstance *aInstance, otMessage *aMessage)
|
This function sends an IPv6 datagram via the Thread interface.
|
otIp6SetAddressCallback(otInstance *aInstance, otIp6AddressCallback aCallback, void *aCallbackContext)
|
void
This function registers a callback to notify internal IPv6 address changes.
|
otIp6SetEnabled(otInstance *aInstance, bool aEnabled)
|
Brings the IPv6 interface up or down.
|
otIp6SetMeshLocalIid(otInstance *aInstance, const otIp6InterfaceIdentifier *aIid)
|
This function sets the Mesh Local IID (for test purpose).
|
otIp6SetMulticastPromiscuousEnabled(otInstance *aInstance, bool aEnabled)
|
void
Enables or disables multicast promiscuous mode on the Thread interface.
|
otIp6SetReceiveCallback(otInstance *aInstance, otIp6ReceiveCallback aCallback, void *aCallbackContext)
|
void
This function registers a callback to provide received IPv6 datagrams.
|
otIp6SetReceiveFilterEnabled(otInstance *aInstance, bool aEnabled)
|
void
This function sets whether or not Thread control traffic is filtered out when delivering IPv6 datagrams via the callback specified in otIp6SetReceiveCallback().
|
otIp6SetSlaacEnabled(otInstance *aInstance, bool aEnabled)
|
void
This function enables/disables the SLAAC module.
|
otIp6SetSlaacPrefixFilter(otInstance *aInstance, otIp6SlaacPrefixFilter aFilter)
|
void
This function sets the SLAAC module filter handler.
|
otIp6SockAddrToString(const otSockAddr *aSockAddr, char *aBuffer, uint16_t aSize)
|
void
This function converts a given IPv6 socket address to a human-readable string.
|
otIp6SubscribeMulticastAddress(otInstance *aInstance, const otIp6Address *aAddress)
|
Subscribes the Thread interface to a Network Interface Multicast Address.
|
otIp6UnsubscribeMulticastAddress(otInstance *aInstance, const otIp6Address *aAddress)
|
Unsubscribes the Thread interface to a Network Interface Multicast Address.
|
Macros |
|
---|---|
OT_IP6_ADDRESS_SIZE 16
|
Size of an IPv6 address (bytes)
|
OT_IP6_ADDRESS_STRING_SIZE 40
|
Recommended size for string representation of an IPv6 address.
|
OT_IP6_IID_SIZE 8
|
Size of an IPv6 Interface Identifier (bytes)
|
OT_IP6_MAX_MLR_ADDRESSES 15
|
Max number of IPv6 addresses supported by Multicast Listener Registration.
|
OT_IP6_PREFIX_BITSIZE (OT_IP6_PREFIX_SIZE * 8)
|
Size of an IPv6 prefix (bits)
|
OT_IP6_PREFIX_SIZE 8
|
Size of an IPv6 prefix (bytes)
|
OT_IP6_PREFIX_STRING_SIZE 45
|
Recommended size for string representation of an IPv6 prefix.
|
OT_IP6_SOCK_ADDR_STRING_SIZE 48
|
Recommended size for string representation of an IPv6 socket address.
|
Structs |
|
---|---|
otIp6Address |
This structure represents an IPv6 address. |
otIp6AddressComponents |
This structure represents the components of an IPv6 address. |
otIp6AddressInfo |
This structure represents IPv6 address information. |
otIp6InterfaceIdentifier |
This structure represents the Interface Identifier of an IPv6 address. |
otIp6NetworkPrefix |
This structure represents the Network Prefix of an IPv6 address (most significant 64 bits of the address). |
otIp6Prefix |
This structure represents an IPv6 prefix. |
otMessageInfo |
This structure represents the local and peer IPv6 socket addresses. |
otNetifAddress |
This structure represents an IPv6 network interface unicast address. |
otNetifMulticastAddress |
This structure represents an IPv6 network interface multicast address. |
otSockAddr |
This structure represents an IPv6 socket address. |
Enumerations
Anonymous Enum 10
Anonymous Enum 10
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. |
Anonymous Enum 8
Anonymous Enum 8
IPv6 Address origins.
Properties | |
---|---|
OT_ADDRESS_ORIGIN_DHCPV6
|
DHCPv6 assigned address. |
OT_ADDRESS_ORIGIN_MANUAL
|
Manually assigned address. |
OT_ADDRESS_ORIGIN_SLAAC
|
SLAAC assigned address. |
OT_ADDRESS_ORIGIN_THREAD
|
Thread assigned address (ALOC, RLOC, MLEID, etc) |
Anonymous Enum 9
Anonymous Enum 9
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. |
Typedefs
otIp6AddressCallback
void(* otIp6AddressCallback)(const otIp6AddressInfo *aAddressInfo, bool aIsAdded, void *aContext)
This function pointer is called when an internal IPv6 address is added or removed.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otIp6AddressComponents
struct otIp6AddressComponents otIp6AddressComponents
This structure represents the components of an IPv6 address.
otIp6AddressInfo
struct otIp6AddressInfo otIp6AddressInfo
otIp6InterfaceIdentifier
struct otIp6InterfaceIdentifier otIp6InterfaceIdentifier
This structure represents the Interface Identifier of an IPv6 address.
otIp6NetworkPrefix
struct otIp6NetworkPrefix otIp6NetworkPrefix
This structure represents the Network Prefix of an IPv6 address (most significant 64 bits of the address).
otIp6ReceiveCallback
void(* otIp6ReceiveCallback)(otMessage *aMessage, void *aContext)
This function pointer is called when an IPv6 datagram is received.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otIp6RegisterMulticastListenersCallback
void(* otIp6RegisterMulticastListenersCallback)(void *aContext, otError aError, uint8_t aMlrStatus, const otIp6Address *aFailedAddresses, uint8_t aFailedAddressNum)
This function pointer is called with results of otIp6RegisterMulticastListeners
.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
otIp6RegisterMulticastListeners
otIp6SlaacPrefixFilter
bool(* otIp6SlaacPrefixFilter)(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.
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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otMessageInfo
struct otMessageInfo otMessageInfo
This structure represents the local and peer IPv6 socket addresses.
otNetifAddress
struct otNetifAddress otNetifAddress
This structure represents an IPv6 network interface unicast address.
otNetifMulticastAddress
struct otNetifMulticastAddress otNetifMulticastAddress
This structure represents an IPv6 network interface multicast 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
.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otIp6AddUnsecurePort
otError otIp6AddUnsecurePort( otInstance *aInstance, uint16_t aPort )
This function adds a port to the allowed unsecured port list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otIp6AddressFromString
otError otIp6AddressFromString( const char *aString, otIp6Address *aAddress )
This function converts a human-readable IPv6 address string into a binary representation.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otIp6AddressToString
void otIp6AddressToString( const otIp6Address *aAddress, char *aBuffer, uint16_t aSize )
This function 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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otIp6ArePrefixesEqual
bool otIp6ArePrefixesEqual( const otIp6Prefix *aFirst, const otIp6Prefix *aSecond )
Test if two IPv6 prefixes are the same.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otIp6GetMulticastAddresses
const otNetifMulticastAddress * otIp6GetMulticastAddresses( otInstance *aInstance )
Gets the list of IPv6 multicast addresses subscribed to the Thread interface.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the first Network Interface Multicast Address.
|
otIp6GetPrefix
void otIp6GetPrefix( const otIp6Address *aAddress, uint8_t aLength, otIp6Prefix *aPrefix )
This method gets a prefix with aLength
from aAddress
.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otIp6GetUnicastAddresses
const otNetifAddress * otIp6GetUnicastAddresses( otInstance *aInstance )
Gets the list of IPv6 addresses assigned to the Thread interface.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the first Network Interface Address.
|
otIp6GetUnsecurePorts
const uint16_t * otIp6GetUnsecurePorts( otInstance *aInstance, uint8_t *aNumEntries )
This function returns a pointer to the unsecure port list.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otIp6IsAddressUnspecified
bool otIp6IsAddressUnspecified( const otIp6Address *aAddress )
This function indicates whether or not a given IPv6 address is the Unspecified Address.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otIp6IsEnabled
bool otIp6IsEnabled( otInstance *aInstance )
Indicates whether or not the IPv6 interface is up.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otIp6IsMulticastPromiscuousEnabled
bool otIp6IsMulticastPromiscuousEnabled( otInstance *aInstance )
Checks if multicast promiscuous mode is enabled on the Thread interface.
Details | |||
---|---|---|---|
Parameters |
|
otIp6SetMulticastPromiscuousEnabled
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().
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
TRUE if Thread control traffic is filtered out, FALSE otherwise.
|
otIp6SetReceiveCallback
otIp6SetReceiveFilterEnabled
otIp6IsSlaacEnabled
bool otIp6IsSlaacEnabled( otInstance *aInstance )
This function indicates whether the SLAAC module is enabled or not.
This function requires the build-time feature OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
to be enabled.
Details | |||||
---|---|---|---|---|---|
Return Values |
|
otIp6NewMessage
otMessage * otIp6NewMessage( otInstance *aInstance, const otMessageSettings *aSettings )
Allocate a new message buffer for sending an IPv6 message.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to the message buffer or NULL if no message buffers are available or parameters are invalid.
|
otMessageFree
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.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Returns |
A pointer to the message or NULL if malformed IPv6 header or insufficient message buffers are available.
|
otMessageFree
otIp6PrefixMatch
uint8_t otIp6PrefixMatch( const otIp6Address *aFirst, const otIp6Address *aSecond )
This function returns the prefix match length (bits) for two IPv6 addresses.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
The prefix match length in bits.
|
otIp6PrefixToString
void otIp6PrefixToString( const otIp6Prefix *aPrefix, char *aBuffer, uint16_t aSize )
This function 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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otIp6ProtoToString
const char * otIp6ProtoToString( uint8_t aIpProto )
This function converts a given IP protocol number to a human-readable string.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A string representing
aIpProto . |
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.
Note: only available when both OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE
and OPENTHREAD_CONFIG_COMMISSIONER_ENABLE
are enabled)
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
otIp6RegisterMulticastListenersCallback
otIp6RemoveAllUnsecurePorts
void otIp6RemoveAllUnsecurePorts( otInstance *aInstance )
This function removes all ports from the allowed unsecure port list.
Details | |||
---|---|---|---|
Parameters |
|
otIp6RemoveUnicastAddress
otError otIp6RemoveUnicastAddress( otInstance *aInstance, const otIp6Address *aAddress )
Removes a Network Interface Address from the Thread interface.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otIp6RemoveUnsecurePort
otError otIp6RemoveUnsecurePort( otInstance *aInstance, uint16_t aPort )
This function removes a port from the allowed unsecure port list.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otIp6SelectSourceAddress
otError otIp6SelectSourceAddress( otInstance *aInstance, otMessageInfo *aMessageInfo )
This function perform OpenThread source address selection.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otIp6Send
otError otIp6Send( otInstance *aInstance, otMessage *aMessage )
This function 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.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
otIp6SetAddressCallback
void otIp6SetAddressCallback( otInstance *aInstance, otIp6AddressCallback aCallback, void *aCallbackContext )
This function registers a callback to notify internal IPv6 address changes.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otIp6SetEnabled
otError otIp6SetEnabled( otInstance *aInstance, bool aEnabled )
Brings the IPv6 interface up or down.
Call this to enable or disable IPv6 communication.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otIp6SetMeshLocalIid
otError otIp6SetMeshLocalIid( otInstance *aInstance, const otIp6InterfaceIdentifier *aIid )
This function sets the Mesh Local IID (for test purpose).
Only available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otIp6SetMulticastPromiscuousEnabled
void otIp6SetMulticastPromiscuousEnabled( otInstance *aInstance, bool aEnabled )
Enables or disables multicast promiscuous mode on the Thread interface.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otIp6IsMulticastPromiscuousEnabled
otIp6SetReceiveCallback
void otIp6SetReceiveCallback( otInstance *aInstance, otIp6ReceiveCallback aCallback, void *aCallbackContext )
This function registers a callback to provide received IPv6 datagrams.
By default, this callback does not pass Thread control traffic. See otIp6SetReceiveFilterEnabled() to change the Thread control traffic filter setting.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otIp6IsReceiveFilterEnabled
otIp6SetReceiveFilterEnabled
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().
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otIp6SetReceiveCallback
otIsReceiveIp6FilterEnabled
otIp6SetSlaacEnabled
void otIp6SetSlaacEnabled( otInstance *aInstance, bool aEnabled )
This function enables/disables the SLAAC module.
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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otIp6SetSlaacPrefixFilter
void otIp6SetSlaacPrefixFilter( otInstance *aInstance, otIp6SlaacPrefixFilter aFilter )
This function sets the SLAAC module filter handler.
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).
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otIp6SockAddrToString
void otIp6SockAddrToString( const otSockAddr *aSockAddr, char *aBuffer, uint16_t aSize )
This function 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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
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
.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
otIp6UnsubscribeMulticastAddress
otError otIp6UnsubscribeMulticastAddress( otInstance *aInstance, const otIp6Address *aAddress )
Unsubscribes the Thread interface to a Network Interface Multicast Address.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
Macros
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_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. For more information, or to contribute to our documentation, refer to Resources.