netif: Add getter for loopif for unit tests

This commit is contained in:
Dirk Ziegelmeier 2018-11-01 21:35:06 +01:00
parent 26a84d9307
commit 0c34597b9e
2 changed files with 13 additions and 0 deletions

View File

@ -143,6 +143,14 @@ static err_t netif_loop_output_ipv6(struct netif *netif, struct pbuf *p, const i
static struct netif loop_netif;
#if LWIP_TESTMODE
struct netif* netif_get_loopif(void)
{
return &loop_netif;
}
#endif
/**
* Initialize a lwip network interface structure for a loopback interface
*

View File

@ -674,6 +674,11 @@ void netif_invoke_ext_callback(struct netif* netif, netif_nsc_reason_t reason, c
#define netif_invoke_ext_callback(netif, reason, args)
#endif
#if LWIP_TESTMODE && LWIP_HAVE_LOOPIF
struct netif* netif_get_loopif(void);
#endif
#ifdef __cplusplus
}
#endif