Continue working on ext netif callback

Docs, better callback points (e.g. before netif is set down)
This commit is contained in:
Dirk Ziegelmeier 2017-02-14 21:02:38 +01:00
parent d46d8bcda2
commit 454927151d
2 changed files with 9 additions and 4 deletions

View File

@ -692,6 +692,8 @@ void
netif_set_down(struct netif *netif)
{
if (netif->flags & NETIF_FLAG_UP) {
netif_invoke_ext_callback(netif, LWIP_NSC_STATUS_CHANGED, 0, NULL);
netif->flags &= ~NETIF_FLAG_UP;
MIB2_COPY_SYSUPTIME_TO(&netif->ts);
@ -706,7 +708,6 @@ netif_set_down(struct netif *netif)
#endif /* LWIP_IPV6 */
NETIF_STATUS_CALLBACK(netif);
netif_invoke_ext_callback(netif, LWIP_NSC_STATUS_CHANGED, 0, NULL);
}
}

View File

@ -512,13 +512,17 @@ struct netif* netif_get_by_index(u8_t idx);
*/
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,
/** netif was removed. num: 0; arg: NULL */
/** netif was removed. num: 0; arg: NULL\n
* Called BEFORE netif is removed. */
LWIP_NSC_NETIF_REMOVED,
/** link changed. num: 1 up, 0 down; arg: NULL */
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,
/** IPv4 address has changed. num: 0; arg is ip_addr_t* old address */
LWIP_NSC_IPV4_ADDRESS_CHANGED,