MDNS send probes to verify domain before use

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
Jens Nielsen
2018-01-16 22:47:00 +01:00
committed by Simon Goldschmidt
parent 8223a8c73c
commit 9f1196fb53
3 changed files with 331 additions and 40 deletions

View File

@@ -56,16 +56,27 @@ struct mdns_service;
/** Callback function to add text to a reply, called when generating the reply */
typedef void (*service_get_txt_fn_t)(struct mdns_service *service, void *txt_userdata);
/** Callback function to let application know the result of probing network for name
* uniqueness, called with result 1 if no other node claimed use for the name for the
* netif or a service and is safe to use, or 0 if another node is already using it and
* mdns is disabled on this interface */
typedef void (*mdns_name_result_cb_t)(struct netif* netif, u8_t result);
void mdns_resp_init(void);
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, u32_t dns_ttl);
err_t mdns_resp_remove_netif(struct netif *netif);
err_t mdns_resp_rename_netif(struct netif *netif, const char *hostname);
s8_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata);
err_t mdns_resp_del_service(struct netif *netif, s8_t slot);
err_t mdns_resp_rename_service(struct netif *netif, s8_t slot, const char *name);
err_t mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, u8_t txt_len);
void mdns_resp_restart(struct netif *netif);
void mdns_resp_announce(struct netif *netif);
/**