![]() |
0.01.00
|
This module includes functions that control IPv6 communication. More...
Typedefs | |
| typedef otError(* | otIp6SlaacIidCreate) (otInstance *aInstance, otNetifAddress *aAddress, void *aContext) |
| This function pointer is called to create IPv6 IID during SLAAC procedure. More... | |
| typedef void(* | otIp6ReceiveCallback) (otMessage *aMessage, void *aContext) |
| This function pointer is called when an IPv6 datagram is received. More... | |
Functions | |
| OTAPI otError OTCALL | otIp6SetEnabled (otInstance *aInstance, bool aEnabled) |
| This function brings up the IPv6 interface. More... | |
| OTAPI bool OTCALL | otIp6IsEnabled (otInstance *aInstance) |
| This function indicates whether or not the IPv6 interface is up. More... | |
| OTAPI otError OTCALL | otIp6AddUnicastAddress (otInstance *aInstance, const otNetifAddress *aAddress) |
| Add a Network Interface Address to the Thread interface. More... | |
| OTAPI otError OTCALL | otIp6RemoveUnicastAddress (otInstance *aInstance, const otIp6Address *aAddress) |
| Remove a Network Interface Address from the Thread interface. More... | |
| OTAPI const otNetifAddress *OTCALL | otIp6GetUnicastAddresses (otInstance *aInstance) |
| Get the list of IPv6 addresses assigned to the Thread interface. More... | |
| otError | otIp6SubscribeMulticastAddress (otInstance *aInstance, const otIp6Address *aAddress) |
| Subscribe the Thread interface to a Network Interface Multicast Address. More... | |
| otError | otIp6UnsubscribeMulticastAddress (otInstance *aInstance, const otIp6Address *aAddress) |
| Unsubscribe the Thread interface to a Network Interface Multicast Address. More... | |
| const otNetifMulticastAddress * | otIp6GetMulticastAddresses (otInstance *aInstance) |
| Get the list of IPv6 multicast addresses subscribed to the Thread interface. More... | |
| bool | otIp6IsMulticastPromiscuousEnabled (otInstance *aInstance) |
| Check if multicast promiscuous mode is enabled on the Thread interface. More... | |
| void | otIp6SetMulticastPromiscuousEnabled (otInstance *aInstance, bool aEnabled) |
| Enable multicast promiscuous mode on the Thread interface. More... | |
| void | otIp6SlaacUpdate (otInstance *aInstance, otNetifAddress *aAddresses, uint32_t aNumAddresses, otIp6SlaacIidCreate aIidCreate, void *aContext) |
| Update all automatically created IPv6 addresses for prefixes from current Network Data with SLAAC procedure. More... | |
| otError | otIp6CreateRandomIid (otInstance *aInstance, otNetifAddress *aAddresses, void *aContext) |
| Create random IID for given IPv6 address. More... | |
| otError | otIp6CreateMacIid (otInstance *aInstance, otNetifAddress *aAddresses, void *aContext) |
| Create IID for given IPv6 address using extended MAC address. More... | |
| otError | otIp6CreateSemanticallyOpaqueIid (otInstance *aInstance, otNetifAddress *aAddresses, void *aContext) |
| Create semantically opaque IID for given IPv6 address. More... | |
| otMessage * | otIp6NewMessage (otInstance *aInstance, bool aLinkSecurityEnabled) |
| Allocate a new message buffer for sending an IPv6 message. More... | |
| void | otIp6SetReceiveCallback (otInstance *aInstance, otIp6ReceiveCallback aCallback, void *aCallbackContext) |
| This function registers a callback to provide received IPv6 datagrams. More... | |
| 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(). More... | |
| 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(). More... | |
| otError | otIp6Send (otInstance *aInstance, otMessage *aMessage) |
| This function sends an IPv6 datagram via the Thread interface. More... | |
| otError | otIp6AddUnsecurePort (otInstance *aInstance, uint16_t aPort) |
| This function adds a port to the allowed unsecured port list. More... | |
| otError | otIp6RemoveUnsecurePort (otInstance *aInstance, uint16_t aPort) |
| This function removes a port from the allowed unsecure port list. More... | |
| const uint16_t * | otIp6GetUnsecurePorts (otInstance *aInstance, uint8_t *aNumEntries) |
| This function returns a pointer to the unsecure port list. More... | |
| OTAPI bool OTCALL | otIp6IsAddressEqual (const otIp6Address *a, const otIp6Address *b) |
| Test if two IPv6 addresses are the same. More... | |
| OTAPI otError OTCALL | otIp6AddressFromString (const char *aString, otIp6Address *aAddress) |
| Convert a human-readable IPv6 address string into a binary representation. More... | |
| OTAPI uint8_t OTCALL | otIp6PrefixMatch (const otIp6Address *aFirst, const otIp6Address *aSecond) |
| This function returns the prefix match length (bits) for two IPv6 addresses. More... | |
This module includes functions that control IPv6 communication.
| typedef void(* otIp6ReceiveCallback) (otMessage *aMessage, void *aContext) |
This function pointer is called when an IPv6 datagram is received.
| [in] | aMessage | A pointer to the message buffer containing the received IPv6 datagram. |
| [in] | aContext | A pointer to application-specific context. |
| typedef otError(* otIp6SlaacIidCreate) (otInstance *aInstance, otNetifAddress *aAddress, void *aContext) |
This function pointer is called to create IPv6 IID during SLAAC procedure.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in,out] | aAddress | A pointer to structure containing IPv6 address for which IID is being created. |
| [in,out] | aContext | A pointer to creator-specific context. |
| OT_ERROR_NONE | Created valid IID for given IPv6 address. |
| OT_ERROR_IP6_ADDRESS_CREATION_FAILURE | Creation of valid IID for given IPv6 address failed. |
| OTAPI otError OTCALL otIp6AddressFromString | ( | const char * | aString, |
| otIp6Address * | aAddress | ||
| ) |
Convert a human-readable IPv6 address string into a binary representation.
| [in] | aString | A pointer to a NULL-terminated string. |
| [out] | aAddress | A pointer to an IPv6 address. |
| OT_ERROR_NONE | Successfully parsed the string. |
| OT_ERROR_INVALID_ARGS | Failed to parse the string. |
| OTAPI otError OTCALL otIp6AddUnicastAddress | ( | otInstance * | aInstance, |
| const otNetifAddress * | aAddress | ||
| ) |
Add 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_MAX_EXT_IP_ADDRS.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aAddress | A pointer to a Network Interface Address. |
| 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. |
| otError otIp6AddUnsecurePort | ( | otInstance * | aInstance, |
| uint16_t | aPort | ||
| ) |
This function adds a port to the allowed unsecured port list.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aPort | The port value. |
| OT_ERROR_NONE | The port was successfully added to the allowed unsecure port list. |
| OT_ERROR_NO_BUFS | The unsecure port list is full. |
| otError otIp6CreateMacIid | ( | otInstance * | aInstance, |
| otNetifAddress * | aAddresses, | ||
| void * | aContext | ||
| ) |
Create IID for given IPv6 address using extended MAC address.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in,out] | aAddresses | A pointer to structure containing IPv6 address for which IID is being created. |
| [in] | aContext | A pointer to unused data. |
| OT_ERROR_NONE | Created valid IID for given IPv6 address. |
| otError otIp6CreateRandomIid | ( | otInstance * | aInstance, |
| otNetifAddress * | aAddresses, | ||
| void * | aContext | ||
| ) |
Create random IID for given IPv6 address.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in,out] | aAddresses | A pointer to structure containing IPv6 address for which IID is being created. |
| [in] | aContext | A pointer to unused data. |
| OT_ERROR_NONE | Created valid IID for given IPv6 address. |
| otError otIp6CreateSemanticallyOpaqueIid | ( | otInstance * | aInstance, |
| otNetifAddress * | aAddresses, | ||
| void * | aContext | ||
| ) |
Create semantically opaque IID for given IPv6 address.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in,out] | aAddresses | A pointer to structure containing IPv6 address for which IID is being created. |
| [in,out] | aContext | A pointer to a otSemanticallyOpaqueIidGeneratorData structure. |
| OT_ERROR_NONE | Created valid IID for given IPv6 address. |
| OT_ERROR_IP6_ADDRESS_CREATION_FAILURE | Could not create valid IID for given IPv6 address. |
| const otNetifMulticastAddress* otIp6GetMulticastAddresses | ( | otInstance * | aInstance | ) |
Get the list of IPv6 multicast addresses subscribed to the Thread interface.
| [in] | aInstance | A pointer to an OpenThread instance. |
| OTAPI const otNetifAddress* OTCALL otIp6GetUnicastAddresses | ( | otInstance * | aInstance | ) |
Get the list of IPv6 addresses assigned to the Thread interface.
| [in] | aInstance | A pointer to an OpenThread instance. |
| const uint16_t* otIp6GetUnsecurePorts | ( | otInstance * | aInstance, |
| uint8_t * | aNumEntries | ||
| ) |
This function returns a pointer to the unsecure port list.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [out] | aNumEntries | The number of entries in the list. |
| OTAPI bool OTCALL otIp6IsAddressEqual | ( | const otIp6Address * | a, |
| const otIp6Address * | b | ||
| ) |
Test if two IPv6 addresses are the same.
| [in] | a | A pointer to the first IPv6 address to compare. |
| [in] | b | A pointer to the second IPv6 address to compare. |
| TRUE | The two IPv6 addresses are the same. |
| FALSE | The two IPv6 addresses are not the same. |
| OTAPI bool OTCALL otIp6IsEnabled | ( | otInstance * | aInstance | ) |
This function indicates whether or not the IPv6 interface is up.
| [in] | aInstance | A pointer to an OpenThread instance. |
| TRUE | The IPv6 interface is enabled. |
| FALSE | The IPv6 interface is disabled. |
| bool otIp6IsMulticastPromiscuousEnabled | ( | otInstance * | aInstance | ) |
Check if multicast promiscuous mode is enabled on the Thread interface.
| [in] | aInstance | A pointer to an OpenThread instance. |
| 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().
| [in] | aInstance | A pointer to an OpenThread instance. |
| otMessage* otIp6NewMessage | ( | otInstance * | aInstance, |
| bool | aLinkSecurityEnabled | ||
| ) |
Allocate a new message buffer for sending an IPv6 message.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aLinkSecurityEnabled | TRUE if the message should be secured at Layer 2 |
| OTAPI uint8_t OTCALL otIp6PrefixMatch | ( | const otIp6Address * | aFirst, |
| const otIp6Address * | aSecond | ||
| ) |
This function returns the prefix match length (bits) for two IPv6 addresses.
| [in] | aFirst | A pointer to the first IPv6 address. |
| [in] | aSecond | A pointer to the second IPv6 address. |
| OTAPI otError OTCALL otIp6RemoveUnicastAddress | ( | otInstance * | aInstance, |
| const otIp6Address * | aAddress | ||
| ) |
Remove a Network Interface Address from the Thread interface.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aAddress | A pointer to an IP Address. |
| 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. |
| otError otIp6RemoveUnsecurePort | ( | otInstance * | aInstance, |
| uint16_t | aPort | ||
| ) |
This function removes a port from the allowed unsecure port list.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aPort | The port value. |
| OT_ERROR_NONE | The port was successfully removed from the allowed unsecure port list. |
| OT_ERROR_NOT_FOUND | The port was not found in the unsecure port list. |
| otError otIp6Send | ( | otInstance * | aInstance, |
| otMessage * | aMessage | ||
| ) |
This function sends an IPv6 datagram via the Thread interface.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aMessage | A pointer to the message buffer containing the IPv6 datagram. |
| OTAPI otError OTCALL otIp6SetEnabled | ( | otInstance * | aInstance, |
| bool | aEnabled | ||
| ) |
This function brings up the IPv6 interface.
Call this function to enable/disable IPv6 communication.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aEnabled | TRUE to enable IPv6, FALSE otherwise. |
| OT_ERROR_NONE | Successfully enabled the IPv6 interface, or the interface was already enabled. |
| void otIp6SetMulticastPromiscuousEnabled | ( | otInstance * | aInstance, |
| bool | aEnabled | ||
| ) |
Enable multicast promiscuous mode on the Thread interface.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aEnabled | TRUE to enable Multicast Promiscuous mode, FALSE otherwise. |
| 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.
| [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. |
| 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().
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aEnabled | TRUE if Thread control traffic is filtered out, FALSE otherwise. |
| void otIp6SlaacUpdate | ( | otInstance * | aInstance, |
| otNetifAddress * | aAddresses, | ||
| uint32_t | aNumAddresses, | ||
| otIp6SlaacIidCreate | aIidCreate, | ||
| void * | aContext | ||
| ) |
Update all automatically created IPv6 addresses for prefixes from current Network Data with SLAAC procedure.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in,out] | aAddresses | A pointer to an array of automatically created IPv6 addresses. |
| [in] | aNumAddresses | The number of slots in aAddresses array. |
| [in] | aIidCreate | A pointer to a function that is called to create IPv6 IIDs. |
| [in] | aContext | A pointer to data passed to aIidCreate function. |
| otError otIp6SubscribeMulticastAddress | ( | otInstance * | aInstance, |
| const otIp6Address * | aAddress | ||
| ) |
Subscribe 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_MAX_EXT_MULTICAST_IP_ADDRS.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aAddress | A pointer to an IP Address. |
| 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 invalid address. |
| OT_ERROR_NO_BUFS | The Network Interface is already storing the maximum allowed external multicast addresses. |
| otError otIp6UnsubscribeMulticastAddress | ( | otInstance * | aInstance, |
| const otIp6Address * | aAddress | ||
| ) |
Unsubscribe the Thread interface to a Network Interface Multicast Address.
| [in] | aInstance | A pointer to an OpenThread instance. |
| [in] | aAddress | A pointer to an IP Address. |
| OT_ERROR_NONE | Successfully unsubscribed to the Network Interface Multicast 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. |