mdns: update probe conflict function to provide service in conflict

- Send service slot index to the mdns result function. In case of conflict, the user
  will have to remove the service or rename it.
- Break after hostname conflict in order to managed it first, and managed service name
  conflict after.
- Provide a function to get the TXT userdata for a service (allowing app to match with
  its own data).

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
David Girault
2019-10-15 13:01:46 +02:00
committed by Simon Goldschmidt
parent a2498898b0
commit aa79b90d3c
3 changed files with 28 additions and 14 deletions

View File

@@ -99,7 +99,9 @@ typedef void (*service_get_txt_fn_t)(struct mdns_service *service, void *txt_use
* uniqueness, called with result MDNS_PROBING_SUCCESSFUL if no other node claimed
* use for the name for the netif or a service and is safe to use, or MDNS_PROBING_CONFLICT
* 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);
typedef void (*mdns_name_result_cb_t)(struct netif* netif, u8_t result, s8_t slot);
void *mdns_get_service_txt_userdata(struct netif *netif, s8_t slot);
void mdns_resp_init(void);