mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-18 06:06:57 +08:00
dns: added one-shot multicast DNS queries
This commit is contained in:
@@ -84,6 +84,13 @@ struct local_hostlist_entry {
|
||||
#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
|
||||
#endif /* DNS_LOCAL_HOSTLIST */
|
||||
|
||||
#if LWIP_IPV4
|
||||
extern const ip_addr_t dns_mquery_v4group;
|
||||
#endif /* LWIP_IPV4 */
|
||||
#if LWIP_IPV6
|
||||
extern const ip_addr_t dns_mquery_v6group;
|
||||
#endif /* LWIP_IPV6 */
|
||||
|
||||
/** Callback which is invoked when a hostname is found.
|
||||
* A function of this type must be implemented by the application using the DNS resolver.
|
||||
* @param name pointer to the name that was looked up.
|
||||
|
||||
@@ -1057,6 +1057,12 @@
|
||||
#if !defined DNS_LOCAL_HOSTLIST_IS_DYNAMIC || defined __DOXYGEN__
|
||||
#define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0
|
||||
#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
|
||||
|
||||
/** Set this to 1 to enable querying ".local" names via mDNS
|
||||
* using a One-Shot Multicast DNS Query */
|
||||
#if !defined LWIP_DNS_SUPPORT_MDNS_QUERIES || defined __DOXYGEN__
|
||||
#define LWIP_DNS_SUPPORT_MDNS_QUERIES 0
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -115,6 +115,24 @@ PACK_STRUCT_END
|
||||
#endif
|
||||
#define SIZEOF_DNS_HDR 12
|
||||
|
||||
|
||||
/* Multicast DNS definitions */
|
||||
|
||||
/** UDP port for multicast DNS queries */
|
||||
#ifndef DNS_MQUERY_PORT
|
||||
#define DNS_MQUERY_PORT 5353
|
||||
#endif
|
||||
|
||||
/* IPv4 group for multicast DNS queries: 224.0.0.251 */
|
||||
#ifndef DNS_MQUERY_IPV4_GROUP_INIT
|
||||
#define DNS_MQUERY_IPV4_GROUP_INIT IPADDR4_INIT_BYTES(224,0,0,251)
|
||||
#endif
|
||||
|
||||
/* IPv6 group for multicast DNS queries: FF02::FB */
|
||||
#ifndef DNS_MQUERY_IPV6_GROUP_INIT
|
||||
#define DNS_MQUERY_IPV6_GROUP_INIT IPADDR6_INIT_HOST(0xFF020000,0,0,0xFB)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user