11#ifndef ZEPHYR_INCLUDE_NET_DNS_SD_H_
12#define ZEPHYR_INCLUDE_NET_DNS_SD_H_
37#define DNS_SD_INSTANCE_MIN_SIZE 1
39#define DNS_SD_INSTANCE_MAX_SIZE 63
41#define DNS_SD_SERVICE_MIN_SIZE 2
43#define DNS_SD_SERVICE_MAX_SIZE 16
45#define DNS_SD_SERVICE_PREFIX '_'
47#define DNS_SD_PROTO_SIZE 4
49#define DNS_SD_DOMAIN_MIN_SIZE 2
51#define DNS_SD_DOMAIN_MAX_SIZE 63
67#define DNS_SD_MIN_LABELS 3
83#define DNS_SD_MAX_LABELS 4
109#define DNS_SD_REGISTER_SERVICE(_id, _instance, _service, _proto, \
110 _domain, _text, _port) \
111 static const STRUCT_SECTION_ITERABLE(dns_sd_rec, _id) = { \
112 .instance = _instance, \
113 .service = _service, \
116 .text = (const char *)_text, \
117 .text_size = sizeof(_text) - 1, \
161#define DNS_SD_REGISTER_TCP_SERVICE(id, instance, service, domain, text, \
163 static const uint16_t id ## _port = sys_cpu_to_be16(port); \
164 DNS_SD_REGISTER_SERVICE(id, instance, service, "_tcp", domain, \
192#define DNS_SD_REGISTER_UDP_SERVICE(id, instance, service, domain, text, \
194 static const uint16_t id ## _port = sys_cpu_to_be16(port); \
195 DNS_SD_REGISTER_SERVICE(id, instance, service, "_udp", domain, \
199#define DNS_SD_EMPTY_TXT dns_sd_empty_txt
241extern const char dns_sd_empty_txt[1];
247extern const uint16_t dns_sd_port_zero;
void dns_sd_create_wildcard_filter(struct dns_sd_rec *filter)
Create a wildcard filter for DNS-SD records.
static size_t dns_sd_txt_size(const struct dns_sd_rec *rec)
Obtain the size of DNS-SD TXT data.
Definition dns_sd.h:257
bool dns_sd_is_service_type_enumeration(const struct dns_sd_rec *rec)
Check if rec is a DNS-SD Service Type Enumeration.
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
DNS Service Discovery record.
Definition dns_sd.h:217
const char * instance
"<Instance>" - e.g.
Definition dns_sd.h:219
const uint16_t * port
A pointer to the port number used by the service.
Definition dns_sd.h:231
size_t text_size
Size (in bytes) of the DNS TXT record
Definition dns_sd.h:229
const char * domain
"<Domain>" such as "local" or "zephyrproject.org"
Definition dns_sd.h:225
const char * proto
Bottom half of the "<Service>" "_tcp" or "_udp".
Definition dns_sd.h:223
const char * text
DNS TXT record.
Definition dns_sd.h:227
const char * service
Top half of the "<Service>" such as "_http".
Definition dns_sd.h:221