[netif] add address callback (#3249)

This commit is contained in:
Yakun Xu
2018-11-13 19:29:52 -08:00
committed by Jonathan Hui
parent 08747cf7a7
commit 33b0ee9330
6 changed files with 123 additions and 5 deletions
+25
View File
@@ -408,6 +408,31 @@ typedef void (*otIp6ReceiveCallback)(otMessage *aMessage, void *aContext);
*/
void otIp6SetReceiveCallback(otInstance *aInstance, otIp6ReceiveCallback aCallback, void *aCallbackContext);
/**
* This function pointer is called when an internal IPv6 address is added or removed.
*
* @param[in] aAddress A pointer to the IPv6 address.
* @param[in] aPrefixLength The prefix length if @p aAddress is unicast address, and 128 for multicast address.
* @param[in] aIsAdded TRUE if the @p aAddress was added, FALSE if @p aAddress was removed.
* @param[in] aContext A pointer to application-specific context.
*
*/
typedef void (*otIp6AddressCallback)(const otIp6Address *aAddress,
uint8_t aPrefixLength,
bool aIsAdded,
void * aContext);
/**
* This function registers a callback to notify internal IPv6 address changes.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aCallback A pointer to a function that is called when an internal IPv6 address is added or
* removed. NULL to disable the callback.
* @param[in] aCallbackContext A pointer to application-specific context.
*
*/
void otIp6SetAddressCallback(otInstance *aInstance, otIp6AddressCallback aCallback, void *aCallbackContext);
/**
* This function indicates whether or not Thread control traffic is filtered out when delivering IPv6 datagrams
* via the callback specified in otIp6SetReceiveCallback().