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>
This commit is contained in:
Jukka Rissanen 2025-06-10 15:24:49 +03:00 committed by Dan Kalowsky
commit ff805ae376
2 changed files with 12 additions and 0 deletions

View file

@ -297,6 +297,11 @@ bool rec_is_valid(const struct dns_sd_rec *inst)
;
}
bool dns_sd_rec_is_valid(const struct dns_sd_rec *rec)
{
return rec_is_valid(rec);
}
int add_a_record(const struct dns_sd_rec *inst, uint32_t ttl,
uint16_t host_offset, uint32_t addr, uint8_t *buf,
uint16_t buf_offset, uint16_t buf_size)

View file

@ -158,6 +158,13 @@ int dns_sd_handle_service_type_enum(const struct dns_sd_rec *service,
const struct in_addr *addr4, const struct in6_addr *addr6,
uint8_t *buf, uint16_t buf_size);
/**
* @brief Check if DNS-SD record is a valid one.
*
* @param rec the record to check
*/
bool dns_sd_rec_is_valid(const struct dns_sd_rec *rec);
#ifdef __cplusplus
};
#endif