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
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
126#define MdnsResponderContext struct _MdnsResponderContext
141 MDNS_STATE_WAITING = 1,
142 MDNS_STATE_PROBING = 2,
143 MDNS_STATE_ANNOUNCING = 3,
164 char_t reverseName[DNS_MAX_IPV4_REVERSE_NAME_LEN + 1];
176 char_t reverseName[DNS_MAX_IPV6_REVERSE_NAME_LEN + 1];
207 char_t
hostname[MDNS_RESPONDER_MAX_HOSTNAME_LEN + 1];
210#if (IPV4_SUPPORT == ENABLED)
214#if (IPV6_SUPPORT == ENABLED)
222extern systime_t mdnsResponderTickCounter;
227error_t mdnsResponderInit(MdnsResponderContext *context,
230error_t mdnsResponderStart(MdnsResponderContext *context);
231error_t mdnsResponderStop(MdnsResponderContext *context);
232MdnsState mdnsResponderGetState(MdnsResponderContext *context);
234error_t mdnsResponderSetHostname(MdnsResponderContext *context,
235 const char_t *hostname);
237error_t mdnsResponderStartProbing(MdnsResponderContext *context);
239void mdnsResponderTick(MdnsResponderContext *context);
240void mdnsResponderLinkChangeEvent(MdnsResponderContext *context);
error_t
Error codes.
Definition error.h:43
Definitions common to mDNS client and mDNS responder.
void(* MdnsResponderStateChangeCallback)(MdnsResponderContext *context, NetInterface *interface, MdnsState state)
FSM state change callback.
Definition mdns_responder.h:152
MdnsState
mDNS responder states
Definition mdns_responder.h:139
uint32_t systime_t
System time.
Definition os_port_none.h:90
IPv4 address entry.
Definition mdns_responder.h:161
bool_t valid
Valid entry.
Definition mdns_responder.h:162
DnsIpv4AddrResourceRecord record
A resource record.
Definition mdns_responder.h:163
IPv6 address entry.
Definition mdns_responder.h:173
DnsIpv6AddrResourceRecord record
AAAA resource record.
Definition mdns_responder.h:175
bool_t valid
Valid entry.
Definition mdns_responder.h:174
mDNS message
Definition mdns_common.h:78
mDNS responder settings
Definition mdns_responder.h:185
uint_t numAnnouncements
Number of announcement packets.
Definition mdns_responder.h:187
MdnsResponderStateChangeCallback stateChangeEvent
FSM state change event.
Definition mdns_responder.h:189
NetInterface * interface
Underlying network interface.
Definition mdns_responder.h:186
uint32_t ttl
TTL resource record.
Definition mdns_responder.h:188
mDNS responder context
Definition mdns_responder.h:198
systime_t timestamp
Timestamp to manage retransmissions.
Definition mdns_responder.h:204
MdnsIpv6AddrEntry ipv6AddrList[IPV6_ADDR_LIST_SIZE]
IPv6 address list.
Definition mdns_responder.h:215
bool_t conflict
Conflict detected.
Definition mdns_responder.h:202
bool_t running
mDNS responder is currently running
Definition mdns_responder.h:200
MdnsIpv4AddrEntry ipv4AddrList[IPV4_ADDR_LIST_SIZE]
IPv4 address list.
Definition mdns_responder.h:211
MdnsResponderSettings settings
DNS-SD settings.
Definition mdns_responder.h:199
bool_t ipv4AddrCount
Number of valid IPv4 addresses.
Definition mdns_responder.h:208
systime_t timeout
Timeout value.
Definition mdns_responder.h:205
char_t hostname[MDNS_RESPONDER_MAX_HOSTNAME_LEN+1]
Host name.
Definition mdns_responder.h:207
MdnsMessage ipv4Response
IPv4 response message.
Definition mdns_responder.h:212
uint_t retransmitCount
Retransmission counter.
Definition mdns_responder.h:206
bool_t tieBreakLost
Tie-break lost.
Definition mdns_responder.h:203
bool_t ipv6AddrCount
Number of valid IPv6 addresses.
Definition mdns_responder.h:209
MdnsState state
FSM state.
Definition mdns_responder.h:201
MdnsMessage ipv6Response
IPv6 response message.
Definition mdns_responder.h:216
UDP (User Datagram Protocol)