mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-04 05:39:53 +00:00
Continue working on ext netif callback
Docs, better callback points (e.g. before netif is set down)
This commit is contained in:
parent
d46d8bcda2
commit
454927151d
@ -692,6 +692,8 @@ void
|
|||||||
netif_set_down(struct netif *netif)
|
netif_set_down(struct netif *netif)
|
||||||
{
|
{
|
||||||
if (netif->flags & NETIF_FLAG_UP) {
|
if (netif->flags & NETIF_FLAG_UP) {
|
||||||
|
netif_invoke_ext_callback(netif, LWIP_NSC_STATUS_CHANGED, 0, NULL);
|
||||||
|
|
||||||
netif->flags &= ~NETIF_FLAG_UP;
|
netif->flags &= ~NETIF_FLAG_UP;
|
||||||
MIB2_COPY_SYSUPTIME_TO(&netif->ts);
|
MIB2_COPY_SYSUPTIME_TO(&netif->ts);
|
||||||
|
|
||||||
@ -706,7 +708,6 @@ netif_set_down(struct netif *netif)
|
|||||||
#endif /* LWIP_IPV6 */
|
#endif /* LWIP_IPV6 */
|
||||||
|
|
||||||
NETIF_STATUS_CALLBACK(netif);
|
NETIF_STATUS_CALLBACK(netif);
|
||||||
netif_invoke_ext_callback(netif, LWIP_NSC_STATUS_CHANGED, 0, NULL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,13 +512,17 @@ struct netif* netif_get_by_index(u8_t idx);
|
|||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
/** netif was added. num: 0; arg: NULL */
|
/** netif was added. num: 0; arg: NULL\n
|
||||||
|
* Called AFTER netif was added. */
|
||||||
LWIP_NSC_NETIF_ADDED,
|
LWIP_NSC_NETIF_ADDED,
|
||||||
/** netif was removed. num: 0; arg: NULL */
|
/** netif was removed. num: 0; arg: NULL\n
|
||||||
|
* Called BEFORE netif is removed. */
|
||||||
LWIP_NSC_NETIF_REMOVED,
|
LWIP_NSC_NETIF_REMOVED,
|
||||||
/** link changed. num: 1 up, 0 down; arg: NULL */
|
/** link changed. num: 1 up, 0 down; arg: NULL */
|
||||||
LWIP_NSC_LINK_CHANGED,
|
LWIP_NSC_LINK_CHANGED,
|
||||||
/** netif administrative status changed. num: 1 up, 0 down; arg: NULL */
|
/** netif administrative status changed. num: 1 up, 0 down; arg: NULL\n
|
||||||
|
* up is called AFTER netif is set up.\n
|
||||||
|
* down is called BEFORE the netif is actually set down. */
|
||||||
LWIP_NSC_STATUS_CHANGED,
|
LWIP_NSC_STATUS_CHANGED,
|
||||||
/** IPv4 address has changed. num: 0; arg is ip_addr_t* old address */
|
/** IPv4 address has changed. num: 0; arg is ip_addr_t* old address */
|
||||||
LWIP_NSC_IPV4_ADDRESS_CHANGED,
|
LWIP_NSC_IPV4_ADDRESS_CHANGED,
|
||||||
|
Loading…
Reference in New Issue
Block a user