Skip to content

Commit ff805ae

Browse files
jukkardkalowsk
authored andcommitted
net: dns-sd: Add internal record validator function
Allow network shell DNS module to verify that the DNS SD record is a valid one. Currently this is not exposed to applications. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
1 parent 0ce57ab commit ff805ae

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

subsys/net/lib/dns/dns_sd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ bool rec_is_valid(const struct dns_sd_rec *inst)
297297
;
298298
}
299299

300+
bool dns_sd_rec_is_valid(const struct dns_sd_rec *rec)
301+
{
302+
return rec_is_valid(rec);
303+
}
304+
300305
int add_a_record(const struct dns_sd_rec *inst, uint32_t ttl,
301306
uint16_t host_offset, uint32_t addr, uint8_t *buf,
302307
uint16_t buf_offset, uint16_t buf_size)

subsys/net/lib/dns/dns_sd.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ int dns_sd_handle_service_type_enum(const struct dns_sd_rec *service,
158158
const struct in_addr *addr4, const struct in6_addr *addr6,
159159
uint8_t *buf, uint16_t buf_size);
160160

161+
/**
162+
* @brief Check if DNS-SD record is a valid one.
163+
*
164+
* @param rec the record to check
165+
*/
166+
bool dns_sd_rec_is_valid(const struct dns_sd_rec *rec);
167+
161168
#ifdef __cplusplus
162169
};
163170
#endif

0 commit comments

Comments
 (0)