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

@@ -197,6 +197,10 @@ struct netif {
*/
netif_status_callback_fn link_callback;
#endif /* LWIP_NETIF_LINK_CALLBACK */
#if LWIP_NETIF_REMOVE_CALLBACK
/** This function is called when the netif has been removed */
netif_status_callback_fn remove_callback;
#endif /* LWIP_NETIF_REMOVE_CALLBACK */
/** This field can be set by the device driver and could point
* to state information for the device. */
void *state;
@@ -331,6 +335,9 @@ void netif_set_down(struct netif *netif);
#if LWIP_NETIF_STATUS_CALLBACK
void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback);
#endif /* LWIP_NETIF_STATUS_CALLBACK */
#if LWIP_NETIF_REMOVE_CALLBACK
void netif_set_remove_callback(struct netif *netif, netif_status_callback_fn remove_callback);
#endif /* LWIP_NETIF_REMOVE_CALLBACK */
void netif_set_link_up(struct netif *netif);
void netif_set_link_down(struct netif *netif);

View File

@@ -1115,6 +1115,14 @@
#define LWIP_NETIF_LINK_CALLBACK 0
#endif
/**
* LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called
* when a netif has been removed
*/
#ifndef LWIP_NETIF_REMOVE_CALLBACK
#define LWIP_NETIF_REMOVE_CALLBACK 0
#endif
/**
* LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
* indices) in struct netif. TCP and UDP can make use of this to prevent