Go to the documentation of this file.
31 #ifndef _DNS_SD_RESPONDER_H
32 #define _DNS_SD_RESPONDER_H
40 #ifndef DNS_SD_RESPONDER_SUPPORT
41 #define DNS_SD_RESPONDER_SUPPORT DISABLED
42 #elif (DNS_SD_RESPONDER_SUPPORT != ENABLED && DNS_SD_RESPONDER_SUPPORT != DISABLED)
43 #error DNS_SD_RESPONDER_SUPPORT parameter is not valid
47 #ifndef DNS_SD_RESPONDER_TICK_INTERVAL
48 #define DNS_SD_RESPONDER_TICK_INTERVAL 250
49 #elif (DNS_SD_RESPONDER_TICK_INTERVAL < 10)
50 #error DNS_SD_RESPONDER_TICK_INTERVAL parameter is not valid
54 #ifndef DNS_SD_MAX_SERVICE_NAME_LEN
55 #define DNS_SD_MAX_SERVICE_NAME_LEN 32
56 #elif (DNS_SD_MAX_SERVICE_NAME_LEN < 1)
57 #error DNS_SD_MAX_SERVICE_NAME_LEN parameter is not valid
61 #ifndef DNS_SD_MAX_INSTANCE_NAME_LEN
62 #define DNS_SD_MAX_INSTANCE_NAME_LEN 32
63 #elif (DNS_SD_MAX_INSTANCE_NAME_LEN < 1)
64 #error DNS_SD_MAX_INSTANCE_NAME_LEN parameter is not valid
68 #ifndef DNS_SD_MAX_METADATA_LEN
69 #define DNS_SD_MAX_METADATA_LEN 128
70 #elif (DNS_SD_MAX_METADATA_LEN < 1)
71 #error DNS_SD_MAX_METADATA_LEN parameter is not valid
75 #ifndef DNS_SD_DEFAULT_RR_TTL
76 #define DNS_SD_DEFAULT_RR_TTL 120
77 #elif (DNS_SD_DEFAULT_RR_TTL < 1)
78 #error DNS_SD_DEFAULT_RR_TTL parameter is not valid
83 #define DnsSdResponderContext struct _DnsSdResponderContext
87 #define DnsSdResponderService struct _DnsSdResponderService
uint_t retransmitCount
Retransmission counter.
void(* DnsSdStateChangeCallback)(DnsSdResponderService *service, NetInterface *interface, MdnsState state)
FSM state change callback.
DNS-SD service descriptor.
error_t dnsSdResponderRegisterService(DnsSdResponderContext *context, uint_t index, const char_t *instanceName, const char_t *serviceName, uint16_t priority, uint16_t weight, uint16_t port, const char_t *metadata)
Register a DNS-SD service.
NetInterface * interface
Underlying network interface.
error_t dnsSdResponderUnregisterService(DnsSdResponderContext *context, uint_t index)
Unregister a DNS-SD service.
#define DNS_SD_MAX_METADATA_LEN
DNS-SD responder context.
DnsSdStateChangeCallback stateChangeEvent
FSM state change event.
uint32_t ttl
TTL resource record.
size_t metadataLen
Length of the metadata.
DnsSdResponderContext * context
DNS-SD responder context.
MdnsState state
FSM state.
uint_t numServices
Maximum number of DNS-SD services that can be registered.
error_t dnsSdResponderStop(DnsSdResponderContext *context)
Stop DNS-SD responder.
MdnsState
mDNS responder states
Definitions common to mDNS client and mDNS responder.
bool_t tieBreakLost
Tie-break lost.
uint_t numServices
Maximum number of DNS-SD services that can be registered.
void dnsSdResponderGetDefaultSettings(DnsSdResponderSettings *settings)
Initialize settings with default values.
DnsSdResponderService * services
DNS-SD services.
systime_t timeout
Timeout value.
void dnsSdResponderLinkChangeEvent(DnsSdResponderContext *interface)
Callback function for link change event.
bool_t conflict
Conflict detected.
systime_t dnsSdResponderTickCounter
#define DnsSdResponderContext
error_t dnsSdResponderStartProbing(DnsSdResponderContext *context)
Restart probing process.
systime_t timestamp
Timestamp to manage retransmissions.
uint8_t metadata[DNS_SD_MAX_METADATA_LEN]
Discovery-time metadata (TXT record)
DnsSdStateChangeCallback stateChangeEvent
FSM state change event.
#define DnsSdResponderService
#define DNS_SD_MAX_INSTANCE_NAME_LEN
uint_t numAnnouncements
Number of announcement packets.
DNS-SD responder settings.
uint32_t systime_t
System time.
uint16_t weight
Server selection mechanism.
void dnsSdResponderTick(DnsSdResponderContext *interface)
DNS-SD responder timer handler.
NetInterface * interface
Underlying network interface.
char_t serviceName[DNS_SD_MAX_SERVICE_NAME_LEN+1]
Service name.
uint_t numAnnouncements
Number of announcement packets.
uint16_t priority
Priority of the target host.
bool_t running
DNS-SD responder is currently running.
error_t dnsSdResponderInit(DnsSdResponderContext *context, const DnsSdResponderSettings *settings)
DNS-DS initialization.
uint32_t ttl
TTL resource record.
char_t instanceName[DNS_SD_MAX_INSTANCE_NAME_LEN+1]
Instance name.
#define DNS_SD_MAX_SERVICE_NAME_LEN
DnsSdResponderService * services
DNS-SD services.
uint16_t port
Port on the target host of this service.
error_t dnsSdResponderStart(DnsSdResponderContext *context)
Start DNS-SD responder.