diff --git a/src/core/netif.c b/src/core/netif.c index 4e1dcfcd..477a12f6 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -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 * diff --git a/src/include/lwip/netif.h b/src/include/lwip/netif.h index 013a69b5..8333c6ba 100644 --- a/src/include/lwip/netif.h +++ b/src/include/lwip/netif.h @@ -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