Fix mdnsresponder compilation issues (#481)
This commit is contained in:
parent
f67495f4f0
commit
6faf7c569d
2 changed files with 72 additions and 69 deletions
|
@ -25,6 +25,7 @@
|
|||
#include <lwip/sys.h>
|
||||
#include <lwip/netdb.h>
|
||||
#include <lwip/dns.h>
|
||||
#include <lwip/prot/dns.h>
|
||||
#include <lwip/udp.h>
|
||||
#include <lwip/igmp.h>
|
||||
#include <lwip/netif.h>
|
||||
|
@ -39,6 +40,7 @@
|
|||
|
||||
#define DNS_MULTICAST_ADDRESS "224.0.0.251" // RFC 6762
|
||||
#define DNS_MDNS_PORT 5353 // RFC 6762
|
||||
#define DNS_MSG_SIZE 512
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
@ -480,13 +482,13 @@ void mdns_add_TXT(const char* rKey, u32_t ttl, const char* txStr)
|
|||
}
|
||||
}
|
||||
|
||||
void mdns_add_A(const char* rKey, u32_t ttl, struct ip_addr addr)
|
||||
void mdns_add_A(const char* rKey, u32_t ttl, ip_addr_t addr)
|
||||
{
|
||||
mdns_add_response(rKey, DNS_RRTYPE_A, ttl, &addr, sizeof(addr));
|
||||
}
|
||||
|
||||
void mdns_add_facility( const char* instanceName, // Friendly name, need not be unique
|
||||
const char* serviceName, // Must be _name
|
||||
const char* serviceName, // Must be "name", e.g. "hap" or "http"
|
||||
const char* addText, // Must be <key>=<value>
|
||||
mdns_flags flags, // TCP or UDP
|
||||
u16_t onPort, // port number
|
||||
|
@ -519,7 +521,6 @@ void mdns_add_facility( const char* instanceName, // Friendly name, need not b
|
|||
// Optional, makes us browsable
|
||||
if (flags & mdns_Browsable)
|
||||
mdns_add_PTR("_services._dns-sd._udp.local.",ttl,key);
|
||||
|
||||
}
|
||||
|
||||
static void mdns_update_ipaddr(struct ip_info* ipInfo)
|
||||
|
@ -666,7 +667,7 @@ static void mdns_reply(struct mdns_hdr* hdrP)
|
|||
free(mdns_response);
|
||||
}
|
||||
|
||||
static void mdns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port)
|
||||
static void mdns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
|
||||
// Callback from udp_recv
|
||||
{
|
||||
UNUSED_ARG(pcb);
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef __MDNSRESPONDER_H__
|
||||
#define __MDNSRESPONDER_H__
|
||||
|
||||
#include <lwip/ip_addr.h>
|
||||
|
||||
/*
|
||||
* Basic multicast DNS responder
|
||||
*
|
||||
|
@ -40,7 +42,7 @@ void mdns_add_facility( const char* instanceName, // Short user-friendly insta
|
|||
void mdns_add_PTR(const char* rKey, u32_t ttl, const char* nameStr);
|
||||
void mdns_add_SRV(const char* rKey, u32_t ttl, u16_t rPort, const char* targname);
|
||||
void mdns_add_TXT(const char* rKey, u32_t ttl, const char* txtStr);
|
||||
void mdns_add_A (const char* rKey, u32_t ttl, struct ip_addr addr);
|
||||
void mdns_add_A (const char* rKey, u32_t ttl, ip_addr_t addr);
|
||||
|
||||
/* Sample usage, advertising a secure web service
|
||||
|
||||
|
|
Loading…
Reference in a new issue