From 441357649447e9043af5412c2db4445dfec825a4 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 19 Nov 2018 23:24:05 +0800 Subject: [PATCH] doc/mdns.txt: Update document for mdns API changes Update mdns.txt for below API changes: * mdns_resp_add_netif() no longer has dns_ttl argument * mdns_resp_add_service() no longer has dns_ttl arguemnt * mdns_resp_add_service() uses enum mdns_sd_proto for proto argument * Add missing const qualifier at appropriate places Signed-off-by: Axel Lin --- doc/mdns.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/mdns.txt b/doc/mdns.txt index 0c28970d..5e5005fc 100644 --- a/doc/mdns.txt +++ b/doc/mdns.txt @@ -45,7 +45,7 @@ This opens UDP sockets on port 5353 for IPv4 and IPv6. To start responding on a netif, run - mdns_resp_add_netif(struct netif *netif, char *hostname, u32_t dns_ttl) + mdns_resp_add_netif(struct netif *netif, const char *hostname) The hostname will be copied. If this returns successfully, the netif will join the multicast groups and any MDNS/legacy DNS requests sent unicast or multicast @@ -53,7 +53,6 @@ to port 5353 will be handled: - .local type A, AAAA or ANY returns relevant IP addresses - Reverse lookups (PTR in-addr.arpa, ip6.arpa) of netif addresses returns .local -Answers will use the supplied TTL (in seconds) MDNS allows UTF-8 names, but it is recommended to stay within ASCII, since the default case-insensitive comparison assumes this. @@ -71,8 +70,8 @@ Adding services: ================ The netif first needs to be registered. Then run - mdns_resp_add_service(struct netif *netif, char *name, char *service, - u16_t proto, u16_t port, u32_t dns_ttl, + 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); The name and service pointers will be copied. Name refers to the name of the @@ -100,7 +99,7 @@ If this call returns successfully, the following queries will be answered: If your device runs a webserver on port 80, an example call might be: mdns_resp_add_service(netif, "myweb", "_http" - DNSSD_PROTO_TCP, 80, 3600, srv_txt, NULL); + DNSSD_PROTO_TCP, 80, srv_txt, NULL); which will publish myweb._http._tcp.local for any hosts looking for web servers, and point them to .local:80 @@ -109,4 +108,4 @@ Relevant information will be sent as additional records to reduce number of requests required from a client. To remove a service from a netif, run - mdns_resp_del_service(struct netif *netif, s8_t slot) \ No newline at end of file + mdns_resp_del_service(struct netif *netif, s8_t slot)