diff --git a/src/apps/mdns/mdns.c b/src/apps/mdns/mdns.c index 36238570..5eb79206 100644 --- a/src/apps/mdns/mdns.c +++ b/src/apps/mdns/mdns.c @@ -2483,6 +2483,18 @@ mdns_resp_rename_netif(struct netif *netif, const char *hostname) return ERR_OK; } +/** + * @ingroup mdns + * Checks if an MDNS responder is active for a given network interface. + * @param netif The network interface to test. + * @return nonzero if responder active, zero otherwise. + */ +int +mdns_resp_netif_active(struct netif *netif) +{ + return NETIF_TO_HOST(netif) != NULL; +} + /** * @ingroup mdns * Add a service to the selected network interface. diff --git a/src/include/lwip/apps/mdns.h b/src/include/lwip/apps/mdns.h index e8c1ef9e..33da4a3e 100644 --- a/src/include/lwip/apps/mdns.h +++ b/src/include/lwip/apps/mdns.h @@ -110,6 +110,7 @@ void mdns_resp_register_name_result_cb(mdns_name_result_cb_t cb); err_t mdns_resp_add_netif(struct netif *netif, const char *hostname); err_t mdns_resp_remove_netif(struct netif *netif); err_t mdns_resp_rename_netif(struct netif *netif, const char *hostname); +int mdns_resp_netif_active(struct netif *netif); s8_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, service_get_txt_fn_t txt_fn, void *txt_userdata); err_t mdns_resp_del_service(struct netif *netif, u8_t slot);