add API function mdns_resp_netif_active() that can be used to test if an MDNS responder is active for a given network interface.

Signed-off-by: Erik Ekman <erik@kryo.se>
This commit is contained in:
Daniel Pauli 2018-08-15 11:11:11 +02:00 committed by Erik Ekman
parent e80d4ff2cc
commit 0b370fbade
2 changed files with 13 additions and 0 deletions

View File

@ -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.

View File

@ -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);