Skip to content
Snippets Groups Projects
Commit ebf82a4c authored by Daniel Salzman's avatar Daniel Salzman
Browse files

libknot: add knot_dname_with_null()

parent 0d3cd480
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,7 @@ libknot.so.15 libknot15 #MINVER#
knot_dname_to_wire@Base 3.4.0
knot_dname_unpack@Base 3.4.0
knot_dname_wire_check@Base 3.4.0
knot_dname_with_null@Base 3.4.3
knot_dnssec_alg_names@Base 3.4.0
knot_edns_add_option@Base 3.4.0
knot_edns_alignment_size@Base 3.4.0
......
......@@ -706,6 +706,17 @@ bool knot_dname_is_case_equal(const knot_dname_t *d1, const knot_dname_t *d2)
return dname_is_equal(d1, d2, true);
}
_public_
bool knot_dname_with_null(const knot_dname_t *name)
{
if (name == NULL) {
return false;
}
size_t size = knot_dname_size(name);
return (size != strnlen((const char *)name, size) + 1);
}
_public_
size_t knot_dname_prefixlen(const uint8_t *name, unsigned nlabels)
{
......
......@@ -290,6 +290,17 @@ bool knot_dname_is_equal(const knot_dname_t *d1, const knot_dname_t *d2);
_pure_
bool knot_dname_is_case_equal(const knot_dname_t *d1, const knot_dname_t *d2);
/*!
* \brief Checks the domain name if it contains '\0' byte within a label.
*
* \param name Domain name.
*
* \retval true if a zero byte is included
* \retval false if a zero byte isn't included
*/
_pure_
bool knot_dname_with_null(const knot_dname_t *name);
/*!
* \brief Count length of the N first labels.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment