added netif remove callback (bug #32397)

This commit is contained in:
Simon Goldschmidt
2011-08-24 22:00:10 +02:00
parent 249e19769b
commit 0a5755145c
4 changed files with 37 additions and 1 deletions

View File

@@ -306,6 +306,11 @@ netif_remove(struct netif *netif)
/* reset default netif */
netif_set_default(NULL);
}
#if LWIP_NETIF_REMOVE_CALLBACK
if (netif->remove_callback) {
netif->remove_callback(netif);
}
#endif /* LWIP_NETIF_REMOVE_CALLBACK */
LWIP_DEBUGF( NETIF_DEBUG, ("netif_remove: removed netif\n") );
}
@@ -550,6 +555,19 @@ void netif_set_status_callback(struct netif *netif, netif_status_callback_fn sta
}
#endif /* LWIP_NETIF_STATUS_CALLBACK */
#if LWIP_NETIF_REMOVE_CALLBACK
/**
* Set callback to be called when the interface has been removed
*/
void
netif_set_remove_callback(struct netif *netif, netif_status_callback_fn remove_callback)
{
if (netif) {
netif->remove_callback = remove_callback;
}
}
#endif /* LWIP_NETIF_REMOVE_CALLBACK */
/**
* Called by a driver when its link goes up
*/