ldns(3) Library Functions Manual ldns(3)

# [NAME](#NAME)

ldns\_dname\_compare, ldns\_dname\_interval - compare two dnames

# [SYNOPSIS](#SYNOPSIS)

#include &lt;stdint.h&gt;  
#include &lt;stdbool.h&gt;

#include &lt;ldns/ldns.h&gt;

int ldns\_dname\_compare(const ldns\_rdf \*dname1, const ldns\_rdf \*dname2);

int ldns\_dname\_interval(const ldns\_rdf \*prev, const ldns\_rdf \*middle, const ldns\_rdf \*next);

# [DESCRIPTION](#DESCRIPTION)

*ldns\_dname\_compare*() Compares the two dname rdf's according to the algorithm for ordering in RFC4034 Section 6.  
**dname1**: First dname rdf to compare  
**dname2**: Second dname rdf to compare  
Returns -1 if dname1 comes before dname2, 1 if dname1 comes after dname2, and 0 if they are equal.

*ldns\_dname\_interval*() check if middle lays in the interval defined by prev and next prev &lt;= middle &lt; next. This is useful for nsec checking  
**prev**: the previous dname  
**middle**: the dname to check  
**next**: the next dname return 0 on error or unknown, -1 when middle is in the interval, +1 when not

# [AUTHOR](#AUTHOR)

The ldns team at NLnet Labs.

# [REPORTING BUGS](#REPORTING_BUGS)

Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues

# [COPYRIGHT](#COPYRIGHT)

Copyright (c) 2004 - 2006 NLnet Labs.

Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# [SEE ALSO](#SEE_ALSO)

*ldns\_dname\_is\_subdomain*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034** and **RFC4035**.

# [REMARKS](#REMARKS)

This manpage was automatically generated from the ldns source code.

30 May 2006

---

Document: ldns_dname_interval(3) from ldns 1.9.2-r3 (Chainguard OS)
Source: https://github.com/NLnetLabs/ldns.git
