mdns: Indicate interface using esp_netif in search results

* Original commit: espressif/esp-idf@f8495f1e86
This commit is contained in:
David Cermak
2021-12-14 16:14:21 +01:00
committed by suren-gabrielyan-espressif
parent fa951bf320
commit ddc58e8220
8 changed files with 156 additions and 101 deletions

View File

@ -83,9 +83,6 @@ static void initialise_mdns(void)
free(hostname);
}
/* these strings match tcpip_adapter_if_t enumeration */
static const char * if_str[] = {"STA", "AP", "ETH", "MAX"};
/* these strings match mdns_ip_protocol_t enumeration */
static const char * ip_protocol_str[] = {"V4", "V6", "MAX"};
@ -95,7 +92,7 @@ static void mdns_print_results(mdns_result_t *results)
mdns_ip_addr_t *a = NULL;
int i = 1, t;
while (r) {
printf("%d: Interface: %s, Type: %s, TTL: %u\n", i++, if_str[r->tcpip_if], ip_protocol_str[r->ip_protocol],
printf("%d: Interface: %s, Type: %s, TTL: %u\n", i++, esp_netif_get_ifkey(r->esp_netif), ip_protocol_str[r->ip_protocol],
r->ttl);
if (r->instance_name) {
printf(" PTR : %s.%s.%s\n", r->instance_name, r->service_type, r->proto);