diff --git a/src/core/netif.c b/src/core/netif.c index e9627271..b94ef46e 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -218,6 +218,22 @@ netif_input(struct pbuf *p, struct netif *inp) return ip_input(p, inp); } +/** + * @ingroup netif + * Add a network interface to the list of lwIP netifs. + * + * Same as @ref netif_add but without IPv4 addresses + */ +struct netif * +netif_add_noaddr(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input) +{ + return netif_add(netif, +#if LWIP_IPV4 + NULL, NULL, NULL, +#endif /* LWIP_IPV4*/ + state, init, input); +} + /** * @ingroup netif * Add a network interface to the list of lwIP netifs. diff --git a/src/include/lwip/netif.h b/src/include/lwip/netif.h index 6cdb1ecb..c872d62f 100644 --- a/src/include/lwip/netif.h +++ b/src/include/lwip/netif.h @@ -379,14 +379,16 @@ extern struct netif *netif_default; void netif_init(void); +struct netif *netif_add_noaddr(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input); + +#if LWIP_IPV4 struct netif *netif_add(struct netif *netif, -#if LWIP_IPV4 - const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, -#endif /* LWIP_IPV4 */ - void *state, netif_init_fn init, netif_input_fn input); -#if LWIP_IPV4 + const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, + void *state, netif_init_fn init, netif_input_fn input); void netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw); +#else /* LWIP_IPV4 */ +struct netif *netif_add(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input); #endif /* LWIP_IPV4 */ void netif_remove(struct netif * netif);