mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-27 12:35:26 +00:00
Add some asserts to netif callback functions
This commit is contained in:
parent
4434762a08
commit
d46d8bcda2
@ -1409,6 +1409,9 @@ netif_find(const char *name)
|
||||
*/
|
||||
void netif_add_ext_callback(netif_ext_callback_t* callback, netif_ext_callback_fn fn)
|
||||
{
|
||||
LWIP_ASSERT("callback must be != NULL", callback != NULL);
|
||||
LWIP_ASSERT("fn must be != NULL", fn != NULL);
|
||||
|
||||
if (callback->callback_fn != NULL) {
|
||||
return; /* already registered */
|
||||
}
|
||||
@ -1428,6 +1431,8 @@ void netif_add_ext_callback(netif_ext_callback_t* callback, netif_ext_callback_f
|
||||
*/
|
||||
void netif_invoke_ext_callback(struct netif* netif, netif_nsc_reason_t reason, u16_t num, const void* arg)
|
||||
{
|
||||
LWIP_ASSERT("netif must be != NULL", netif != NULL);
|
||||
|
||||
netif_ext_callback_t* callback = ext_callback;
|
||||
|
||||
while (callback != NULL)
|
||||
|
@ -507,7 +507,7 @@ struct netif* netif_get_by_index(u8_t idx);
|
||||
|
||||
/**
|
||||
* @ingroup netif
|
||||
* Extended netif callback reasons enumeration.
|
||||
* Extended netif status callback (NSC) reasons enumeration.
|
||||
* May be extended in the future!
|
||||
*/
|
||||
typedef enum
|
||||
|
Loading…
x
Reference in New Issue
Block a user