mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-21 23:56:59 +08:00
* netif.c, netif.h: Apply patch#4197 with some changes (originator: rireland@hmgsl.com).
Provides callback on netif up/down state change.
This commit is contained in:
@@ -90,6 +90,11 @@ struct netif {
|
||||
* to send a packet on the interface. This function outputs
|
||||
* the pbuf as-is on the link medium. */
|
||||
err_t (* linkoutput)(struct netif *netif, struct pbuf *p);
|
||||
#if LWIP_NETIF_CALLBACK
|
||||
/** This function is called when the netif state is set to up or down
|
||||
*/
|
||||
void (* status_callback)(struct netif *netif);
|
||||
#endif /* end, LWIP_NETIF_CALLBACK */
|
||||
/** This field can be set by the device driver and could point
|
||||
* to state information for the device. */
|
||||
void *state;
|
||||
@@ -165,5 +170,11 @@ void netif_set_gw(struct netif *netif, struct ip_addr *gw);
|
||||
void netif_set_up(struct netif *netif);
|
||||
void netif_set_down(struct netif *netif);
|
||||
u8_t netif_is_up(struct netif *netif);
|
||||
#if LWIP_NETIF_CALLBACK
|
||||
/*
|
||||
* Set callback to be called when interface is brought up/down
|
||||
*/
|
||||
void netif_set_status_callback( struct netif *netif, void (* status_callback)(struct netif *netif ));
|
||||
#endif /* LWIP_NETIF_CALLBACK */
|
||||
|
||||
#endif /* __LWIP_NETIF_H__ */
|
||||
|
||||
Reference in New Issue
Block a user