mikroSDK Reference Manual
mdns_client.h
Go to the documentation of this file.
1
31#ifndef _MDNS_CLIENT_H
32#define _MDNS_CLIENT_H
33
34//Dependencies
35#include "core/net.h"
36#include "core/socket.h"
37#include "core/udp.h"
38#include "dns/dns_cache.h"
39#include "dns/dns_common.h"
40
41//mDNS client support
42#ifndef MDNS_CLIENT_SUPPORT
43 #define MDNS_CLIENT_SUPPORT DISABLED
44#elif (MDNS_CLIENT_SUPPORT != ENABLED && MDNS_CLIENT_SUPPORT != DISABLED)
45 #error MDNS_CLIENT_SUPPORT parameter is not valid
46#endif
47
48//Maximum number of retransmissions of mDNS queries
49#ifndef MDNS_CLIENT_MAX_RETRIES
50 #define MDNS_CLIENT_MAX_RETRIES 3
51#elif (MDNS_CLIENT_MAX_RETRIES < 1)
52 #error MDNS_CLIENT_MAX_RETRIES parameter is not valid
53#endif
54
55//Initial retransmission timeout
56#ifndef MDNS_CLIENT_INIT_TIMEOUT
57 #define MDNS_CLIENT_INIT_TIMEOUT 1000
58#elif (MDNS_CLIENT_INIT_TIMEOUT < 1000)
59 #error MDNS_CLIENT_INIT_TIMEOUT parameter is not valid
60#endif
61
62//Maximum retransmission timeout
63#ifndef MDNS_CLIENT_MAX_TIMEOUT
64 #define MDNS_CLIENT_MAX_TIMEOUT 1000
65#elif (MDNS_CLIENT_MAX_TIMEOUT < 1000)
66 #error MDNS_CLIENT_MAX_TIMEOUT parameter is not valid
67#endif
68
69//Maximum cache lifetime for mDNS entries
70#ifndef MDNS_MAX_LIFETIME
71 #define MDNS_MAX_LIFETIME 60000
72#elif (MDNS_MAX_LIFETIME < 1000)
73 #error MDNS_MAX_LIFETIME parameter is not valid
74#endif
75
76//C++ guard
77#ifdef __cplusplus
78extern "C" {
79#endif
80
81//mDNS related functions
82error_t mdnsClientResolve(NetInterface *interface, const char_t *name,
83 HostType type, IpAddr *ipAddr);
84
85error_t mdnsClientSendQuery(DnsCacheEntry *entry);
86
87void mdnsClientParseAnRecord(NetInterface *interface,
88 const MdnsMessage *message, size_t offset, const DnsResourceRecord *record);
89
90//C++ guard
91#ifdef __cplusplus
92}
93#endif
94
95#endif
DNS cache management.
Common DNS routines.
error_t
Error codes.
Definition error.h:43
TCP/IP stack core.
Socket API.
HostType
Host types.
Definition socket.h:202
DNS cache entry.
Definition dns_cache.h:97
IP network address.
Definition ip.h:72
mDNS message
Definition mdns_common.h:78
UDP (User Datagram Protocol)