Go to the documentation of this file.
31 #ifndef _MDNS_RESPONDER_H
32 #define _MDNS_RESPONDER_H
41 #ifndef MDNS_RESPONDER_SUPPORT
42 #define MDNS_RESPONDER_SUPPORT DISABLED
43 #elif (MDNS_RESPONDER_SUPPORT != ENABLED && MDNS_RESPONDER_SUPPORT != DISABLED)
44 #error MDNS_RESPONDER_SUPPORT parameter is not valid
48 #ifndef MDNS_RESPONDER_TICK_INTERVAL
49 #define MDNS_RESPONDER_TICK_INTERVAL 250
50 #elif (MDNS_RESPONDER_TICK_INTERVAL < 10)
51 #error MDNS_RESPONDER_TICK_INTERVAL parameter is not valid
55 #ifndef MDNS_RESPONDER_MAX_HOSTNAME_LEN
56 #define MDNS_RESPONDER_MAX_HOSTNAME_LEN 32
57 #elif (MDNS_RESPONDER_MAX_HOSTNAME_LEN < 1)
58 #error MDNS_RESPONDER_MAX_HOSTNAME_LEN parameter is not valid
62 #ifndef MDNS_INIT_DELAY
63 #define MDNS_INIT_DELAY 1000
64 #elif (MDNS_INIT_DELAY < 0)
65 #error MDNS_INIT_DELAY parameter is not valid
69 #ifndef MDNS_RAND_DELAY_MIN
70 #define MDNS_RAND_DELAY_MIN 0
71 #elif (MDNS_RAND_DELAY_MIN < 0)
72 #error MDNS_RAND_DELAY_MIN parameter is not valid
76 #ifndef MDNS_RAND_DELAY_MAX
77 #define MDNS_RAND_DELAY_MAX 250
78 #elif (MDNS_RAND_DELAY_MAX < 0)
79 #error MDNS_RAND_DELAY_MAX parameter is not valid
83 #ifndef MDNS_PROBE_NUM
84 #define MDNS_PROBE_NUM 3
85 #elif (MDNS_PROBE_NUM < 1)
86 #error MDNS_PROBE_NUM parameter is not valid
90 #ifndef MDNS_PROBE_DELAY
91 #define MDNS_PROBE_DELAY 250
92 #elif (MDNS_PROBE_DELAY < 100)
93 #error MDNS_PROBE_DELAY parameter is not valid
97 #ifndef MDNS_PROBE_CONFLICT_DELAY
98 #define MDNS_PROBE_CONFLICT_DELAY 1000
99 #elif (MDNS_PROBE_CONFLICT_DELAY < 100)
100 #error MDNS_PROBE_CONFLICT_DELAY parameter is not valid
104 #ifndef MDNS_PROBE_DEFER_DELAY
105 #define MDNS_PROBE_DEFER_DELAY 1000
106 #elif (MDNS_PROBE_DEFER_DELAY < 100)
107 #error MDNS_PROBE_DEFER_DELAY parameter is not valid
111 #ifndef MDNS_ANNOUNCE_NUM
112 #define MDNS_ANNOUNCE_NUM 2
113 #elif (MDNS_ANNOUNCE_NUM < 1)
114 #error MDNS_ANNOUNCE_NUM parameter is not valid
118 #ifndef MDNS_ANNOUNCE_DELAY
119 #define MDNS_ANNOUNCE_DELAY 1000
120 #elif (MDNS_ANNOUNCE_DELAY < 100)
121 #error MDNS_ANNOUNCE_DELAY parameter is not valid
125 #ifndef DNS_SD_ADDITIONAL_RECORDS_SUPPORT
126 #define DNS_SD_ADDITIONAL_RECORDS_SUPPORT ENABLED
127 #elif (DNS_SD_ADDITIONAL_RECORDS_SUPPORT != ENABLED && DNS_SD_ADDITIONAL_RECORDS_SUPPORT != DISABLED)
128 #error DNS_SD_ADDITIONAL_RECORDS_SUPPORT parameter is not valid
133 #define MdnsResponderContext struct _MdnsResponderContext
217 #if (IPV4_SUPPORT == ENABLED)
221 #if (IPV6_SUPPORT == ENABLED)
#define MdnsResponderContext
MdnsIpv6AddrEntry ipv6AddrList[IPV6_ADDR_LIST_SIZE]
IPv6 address list.
DnsIpv4AddrResourceRecord record
A resource record.
systime_t timeout
Timeout value.
error_t mdnsResponderInit(MdnsResponderContext *context, const MdnsResponderSettings *settings)
mDNS responder initialization
void mdnsResponderGetDefaultSettings(MdnsResponderSettings *settings)
Initialize settings with default values.
MdnsIpv4AddrEntry ipv4AddrList[IPV4_ADDR_LIST_SIZE]
IPv4 address list.
systime_t timestamp
Timestamp to manage retransmissions.
DnsIpv4AddrResourceRecord
MdnsMessage ipv6Response
IPv6 response message.
MdnsState state
FSM state.
MdnsState
mDNS responder states
MdnsState mdnsResponderGetState(MdnsResponderContext *context)
Retrieve current state.
DnsIpv6AddrResourceRecord
Definitions common to mDNS client and mDNS responder.
#define DNS_MAX_IPV4_REVERSE_NAME_LEN
uint32_t ttl
TTL resource record.
error_t mdnsResponderSetHostname(MdnsResponderContext *context, const char_t *hostname)
Set host name.
MdnsMessage ipv4Response
IPv4 response message.
bool_t ipv6AddrCount
Number of valid IPv6 addresses.
MdnsResponderSettings settings
DNS-SD settings.
void mdnsResponderLinkChangeEvent(MdnsResponderContext *context)
Callback function for link change event.
#define IPV4_ADDR_LIST_SIZE
void mdnsResponderTick(MdnsResponderContext *context)
mDNS responder timer handler
bool_t tieBreakLost
Tie-break lost.
uint_t numAnnouncements
Number of announcement packets.
bool_t ipv4AddrCount
Number of valid IPv4 addresses.
NetInterface * interface
Underlying network interface.
systime_t mdnsResponderTickCounter
uint32_t systime_t
System time.
#define MDNS_RESPONDER_MAX_HOSTNAME_LEN
bool_t running
mDNS responder is currently running
error_t mdnsResponderStart(MdnsResponderContext *context)
Start mDNS responder.
#define IPV6_ADDR_LIST_SIZE
MdnsResponderStateChangeCallback stateChangeEvent
FSM state change event.
error_t mdnsResponderStop(MdnsResponderContext *context)
Stop mDNS responder.
UDP (User Datagram Protocol)
bool_t conflict
Conflict detected.
void(* MdnsResponderStateChangeCallback)(MdnsResponderContext *context, NetInterface *interface, MdnsState state)
FSM state change callback.
#define DNS_MAX_IPV6_REVERSE_NAME_LEN
uint_t retransmitCount
Retransmission counter.
error_t mdnsResponderStartProbing(MdnsResponderContext *context)
Restart probing process.
DnsIpv6AddrResourceRecord record
AAAA resource record.
char_t hostname[MDNS_RESPONDER_MAX_HOSTNAME_LEN+1]
Host name.