Go to the documentation of this file.
40 #ifndef DNS_SD_SUPPORT
41 #define DNS_SD_SUPPORT DISABLED
42 #elif (DNS_SD_SUPPORT != ENABLED && DNS_SD_SUPPORT != DISABLED)
43 #error DNS_SD_SUPPORT parameter is not valid
47 #ifndef DNS_SD_TICK_INTERVAL
48 #define DNS_SD_TICK_INTERVAL 250
49 #elif (DNS_SD_TICK_INTERVAL < 10)
50 #error DNS_SD_TICK_INTERVAL parameter is not valid
54 #ifndef DNS_SD_SERVICE_LIST_SIZE
55 #define DNS_SD_SERVICE_LIST_SIZE 2
56 #elif (DNS_SD_SERVICE_LIST_SIZE < 1)
57 #error DNS_SD_SERVICE_LIST_SIZE parameter is not valid
61 #ifndef DNS_SD_MAX_SERVICE_NAME_LEN
62 #define DNS_SD_MAX_SERVICE_NAME_LEN 16
63 #elif (DNS_SD_MAX_SERVICE_NAME_LEN < 1)
64 #error DNS_SD_MAX_SERVICE_NAME_LEN parameter is not valid
68 #ifndef DNS_SD_MAX_INSTANCE_NAME_LEN
69 #define DNS_SD_MAX_INSTANCE_NAME_LEN 32
70 #elif (DNS_SD_MAX_INSTANCE_NAME_LEN < 1)
71 #error DNS_SD_MAX_INSTANCE_NAME_LEN parameter is not valid
75 #ifndef DNS_SD_MAX_METADATA_LEN
76 #define DNS_SD_MAX_METADATA_LEN 128
77 #elif (DNS_SD_MAX_METADATA_LEN < 1)
78 #error DNS_SD_MAX_METADATA_LEN parameter is not valid
82 #ifndef DNS_SD_DEFAULT_RR_TTL
83 #define DNS_SD_DEFAULT_RR_TTL 120
84 #elif (DNS_SD_DEFAULT_RR_TTL < 1)
85 #error DNS_SD_DEFAULT_RR_TTL parameter is not valid
90 #define DnsSdContext struct _DnsSdContext
void(* DnsSdStateChangeCallback)(DnsSdContext *context, NetInterface *interface, MdnsState state)
FSM state change callback.
error_t dnsSdInit(DnsSdContext *context, const DnsSdSettings *settings)
DNS-DS initialization.
void dnsSdTick(DnsSdContext *interface)
DNS-SD responder timer handler.
DNS-SD service descriptor.
uint16_t weight
Server selection mechanism.
systime_t timeout
Timeout value.
void dnsSdGetDefaultSettings(DnsSdSettings *settings)
Initialize settings with default values.
DnsSdSettings settings
DNS-SD settings.
error_t dnsSdUnregisterService(DnsSdContext *context, const char_t *serviceName)
Unregister a DNS-SD service.
error_t dnsSdStop(DnsSdContext *context)
Stop mDNS responder.
MdnsState
mDNS responder states
bool_t tieBreakLost
Tie-break lost.
uint_t numAnnouncements
Number of announcement packets.
bool_t conflict
Conflict detected.
Definitions common to mDNS client and mDNS responder.
#define DNS_SD_MAX_SERVICE_NAME_LEN
uint_t dnsSdGetNumServices(DnsSdContext *context)
Get the number of registered services.
error_t dnsSdSetInstanceName(DnsSdContext *context, const char_t *instanceName)
Set service instance name.
char_t instanceName[DNS_SD_MAX_INSTANCE_NAME_LEN+1]
Service instance name.
#define DNS_SD_MAX_METADATA_LEN
size_t metadataLength
Length of the metadata.
#define DNS_SD_SERVICE_LIST_SIZE
NetInterface * interface
Underlying network interface.
void dnsSdLinkChangeEvent(DnsSdContext *interface)
Callback function for link change event.
uint32_t systime_t
System time.
systime_t timestamp
Timestamp to manage retransmissions.
#define DNS_SD_MAX_INSTANCE_NAME_LEN
DnsSdStateChangeCallback stateChangeEvent
FSM state change event.
bool_t running
DNS-SD is currently running.
error_t dnsSdStartProbing(DnsSdContext *context)
Restart probing process.
systime_t dnsSdTickCounter
uint_t retransmitCount
Retransmission counter.
uint32_t ttl
TTL resource record.
uint16_t port
Port on the target host of this service.
error_t dnsSdStart(DnsSdContext *context)
Start mDNS responder.
MdnsState state
FSM state.
error_t dnsSdRegisterService(DnsSdContext *context, const char_t *serviceName, uint16_t priority, uint16_t weight, uint16_t port, const char_t *metadata)
Register a DNS-SD service.
uint16_t priority
Priority of the target host.
MdnsState dnsSdGetState(DnsSdContext *context)
Retrieve current state.
DnsSdService serviceList[DNS_SD_SERVICE_LIST_SIZE]
List of registered services.