@@ -50,6 +50,38 @@ extern "C" {
50
50
/** RFC 1034 Section 3.1, RFC 6763 Section 7.2 */
51
51
#define DNS_SD_DOMAIN_MAX_SIZE 63
52
52
53
+ /**
54
+ * Minimum number of segments in a fully-qualified name
55
+ *
56
+ * This reqpresents FQN's of the form below
57
+ * ```
58
+ * <sn>._tcp.<domain>.
59
+ * ```
60
+ * Currently sub-types and service domains are unsupported and only the
61
+ * "local" domain is supported. Specifically, that excludes the following:
62
+ * ```
63
+ * <sub>._sub.<sn>._tcp.<servicedomain>.<parentdomain>.
64
+ * ```
65
+ * @see <a href="https://datatracker.ietf.org/doc/html/rfc6763">RFC 6763</a>, Section 7.2.
66
+ */
67
+ #define DNS_SD_MIN_LABELS 3
68
+ /**
69
+ * Maximum number of segments in a fully-qualified name
70
+ *
71
+ * This reqpresents FQN's of the form below
72
+ * ```
73
+ * <instance>.<sn>._tcp.<domain>.
74
+ * ```
75
+ *
76
+ * Currently sub-types and service domains are unsupported and only the
77
+ * "local" domain is supported. Specifically, that excludes the following:
78
+ * ```
79
+ * <sub>._sub.<sn>._tcp.<servicedomain>.<parentdomain>.
80
+ * ```
81
+ * @see <a href="https://datatracker.ietf.org/doc/html/rfc6763">RFC 6763</a>, Section 7.2.
82
+ */
83
+ #define DNS_SD_MAX_LABELS 4
84
+
53
85
/**
54
86
* @brief Register a service for DNS Service Discovery
55
87
*
@@ -209,6 +241,12 @@ struct dns_sd_rec {
209
241
* @internal
210
242
*/
211
243
extern const char dns_sd_empty_txt [1 ];
244
+ /**
245
+ * @brief Wildcard Port specifier for DNS-SD
246
+ *
247
+ * @internal
248
+ */
249
+ extern const uint16_t dns_sd_port_zero ;
212
250
213
251
/** @endcond */
214
252
@@ -223,6 +261,32 @@ static inline size_t dns_sd_txt_size(const struct dns_sd_rec *rec)
223
261
return rec -> text_size ;
224
262
}
225
263
264
+ /**
265
+ * @brief Check if @a rec is a DNS-SD Service Type Enumeration
266
+ *
267
+ * DNS-SD Service Type Enumeration is used by network tooling to
268
+ * acquire a list of all mDNS-advertised services belonging to a
269
+ * particular host on a particular domain.
270
+ *
271
+ * For example, for the domain '.local', the equivalent query
272
+ * would be '_services._dns-sd._udp.local'.
273
+ *
274
+ * Currently, only the '.local' domain is supported.
275
+ *
276
+ * @see <a href="https://datatracker.ietf.org/doc/html/rfc6763#section-9">Service Type Enumeration, RFC 6763</a>.
277
+ *
278
+ * @param rec the record to in question
279
+ * @return true if @a rec is a DNS-SD Service Type Enumeration
280
+ */
281
+ bool dns_sd_is_service_type_enumeration (const struct dns_sd_rec * rec );
282
+
283
+ /**
284
+ * @brief Create a wildcard filter for DNS-SD records
285
+ *
286
+ * @param filter a pointer to the filter to use
287
+ */
288
+ void dns_sd_create_wildcard_filter (struct dns_sd_rec * filter );
289
+
226
290
/**
227
291
* @}
228
292
*/
0 commit comments