name.h File Reference

Provides facilities for manipulating DNS names and labels, including conversions to and from wire format and text format. More...

#include <stdio.h>
#include <isc/boolean.h>
#include <isc/lang.h>
#include <isc/magic.h>
#include <isc/region.h>
#include <dns/types.h>

Go to the source code of this file.

Data Structures

struct  dns_name
 Clients are strongly discouraged from using this type directly, with the exception of the 'link' and 'list' fields which may be used directly for whatever purpose the client desires. More...

Defines

#define DNS_NAME_H   1
#define DNS_NAME_MAGIC   ISC_MAGIC('D','N','S','n')
#define DNS_NAMEATTR_ABSOLUTE   0x00000001
#define DNS_NAMEATTR_READONLY   0x00000002
#define DNS_NAMEATTR_DYNAMIC   0x00000004
#define DNS_NAMEATTR_DYNOFFSETS   0x00000008
#define DNS_NAMEATTR_NOCOMPRESS   0x00000010
#define DNS_NAMEATTR_CACHE   0x00000100
 Used by resolver.
#define DNS_NAMEATTR_ANSWER   0x00000200
 Used by resolver.
#define DNS_NAMEATTR_NCACHE   0x00000400
 Used by resolver.
#define DNS_NAMEATTR_CHAINING   0x00000800
 Used by resolver.
#define DNS_NAMEATTR_CHASE   0x00001000
 Used by resolver.
#define DNS_NAMEATTR_WILDCARD   0x00002000
 Used by server.
#define DNS_NAMEATTR_PREREQUISITE   0x00004000
 Used by client.
#define DNS_NAMEATTR_UPDATE   0x00008000
 Used by client.
#define DNS_NAMEATTR_HASUPDATEREC   0x00010000
 Used by client.
#define DNS_NAME_DOWNCASE   0x0001
#define DNS_NAME_CHECKNAMES   0x0002
 Used by rdata.
#define DNS_NAME_CHECKNAMESFAIL   0x0004
 Used by rdata.
#define DNS_NAME_CHECKREVERSE   0x0008
 Used by rdata.
#define DNS_NAME_CHECKMX   0x0010
 Used by rdata.
#define DNS_NAME_CHECKMXFAIL   0x0020
 Used by rdata.
#define DNS_NAME_MAXWIRE   255
 Standard size of a wire format name.
#define DNS_NAME_OMITFINALDOT   0x01U
#define DNS_NAME_MASTERFILE   0x02U
#define DNS_NAME_MAXTEXT   1023
 The maximum length of the text representation of a domain name as generated by dns_name_totext(). This does not include space for a terminating NULL.
#define DNS_NAME_FORMATSIZE   (DNS_NAME_MAXTEXT + 1)
 Suggested size of buffer passed to dns_name_format(). Includes space for the terminating NULL.
#define DNS_NAME_INIT(n, o)
#define DNS_NAME_RESET(n)
#define DNS_NAME_SETBUFFER(n, b)   (n)->buffer = (b)
#define DNS_NAME_ISABSOLUTE(n)   (((n)->attributes & DNS_NAMEATTR_ABSOLUTE) != 0 ? ISC_TRUE : ISC_FALSE)
#define DNS_NAME_COUNTLABELS(n)   ((n)->labels)
#define DNS_NAME_TOREGION(n, r)
#define DNS_NAME_SPLIT(n, l, p, s)

Typedefs

typedef isc_result_t(* dns_name_totextfilter_t )(isc_buffer_t *target, unsigned int used_org, isc_boolean_t absolute)

Functions

void dns_name_init (dns_name_t *name, unsigned char *offsets)
 Initialize 'name'.
void dns_name_reset (dns_name_t *name)
 Reinitialize 'name'.
void dns_name_invalidate (dns_name_t *name)
 Make 'name' invalid.
isc_boolean_t dns_name_isvalid (const dns_name_t *name)
 Check whether 'name' points to a valid dns_name.
void dns_name_setbuffer (dns_name_t *name, isc_buffer_t *buffer)
 Dedicate a buffer for use with 'name'.
isc_boolean_t dns_name_hasbuffer (const dns_name_t *name)
 Does 'name' have a dedicated buffer?
isc_boolean_t dns_name_isabsolute (const dns_name_t *name)
 Does 'name' end in the root label?
isc_boolean_t dns_name_iswildcard (const dns_name_t *name)
 Is 'name' a wildcard name?
unsigned int dns_name_hash (dns_name_t *name, isc_boolean_t case_sensitive)
 Provide a hash value for 'name'.
unsigned int dns_name_fullhash (dns_name_t *name, isc_boolean_t case_sensitive)
 Provide a hash value for 'name'. Unlike dns_name_hash(), this function always takes into account of the entire name to calculate the hash value.
unsigned int dns_name_hashbylabel (dns_name_t *name, isc_boolean_t case_sensitive)
 Provide a hash value for 'name', where the hash value is the sum of the hash values of each label.
dns_namereln_t dns_name_fullcompare (const dns_name_t *name1, const dns_name_t *name2, int *orderp, unsigned int *nlabelsp)
 Determine the relative ordering under the DNSSEC order relation of 'name1' and 'name2', and also determine the hierarchical relationship of the names.
int dns_name_compare (const dns_name_t *name1, const dns_name_t *name2)
 Determine the relative ordering under the DNSSEC order relation of 'name1' and 'name2'.
isc_boolean_t dns_name_equal (const dns_name_t *name1, const dns_name_t *name2)
 Are 'name1' and 'name2' equal?
isc_boolean_t dns_name_caseequal (const dns_name_t *name1, const dns_name_t *name2)
 Case sensitive version of dns_name_equal().
int dns_name_rdatacompare (const dns_name_t *name1, const dns_name_t *name2)
 Compare two names as if they are part of rdata in DNSSEC canonical form.
isc_boolean_t dns_name_issubdomain (const dns_name_t *name1, const dns_name_t *name2)
 Is 'name1' a subdomain of 'name2'?
isc_boolean_t dns_name_matcheswildcard (const dns_name_t *name, const dns_name_t *wname)
 Does 'name' match the wildcard specified in 'wname'?
unsigned int dns_name_countlabels (const dns_name_t *name)
 How many labels does 'name' have?
void dns_name_getlabel (const dns_name_t *name, unsigned int n, dns_label_t *label)
 Make 'label' refer to the 'n'th least significant label of 'name'.
void dns_name_getlabelsequence (const dns_name_t *source, unsigned int first, unsigned int n, dns_name_t *target)
 Make 'target' refer to the 'n' labels including and following 'first' in 'source'.
void dns_name_clone (const dns_name_t *source, dns_name_t *target)
 Make 'target' refer to the same name as 'source'.
void dns_name_fromregion (dns_name_t *name, const isc_region_t *r)
 Make 'name' refer to region 'r'.
void dns_name_toregion (dns_name_t *name, isc_region_t *r)
 Make 'r' refer to 'name'.
isc_result_t dns_name_fromwire (dns_name_t *name, isc_buffer_t *source, dns_decompress_t *dctx, unsigned int options, isc_buffer_t *target)
 Copy the possibly-compressed name at source (active region) into target, decompressing it.
isc_result_t dns_name_towire (const dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target)
 Convert 'name' into wire format, compressing it as specified by the compression context 'cctx', and storing the result in 'target'.
isc_result_t dns_name_fromtext (dns_name_t *name, isc_buffer_t *source, const dns_name_t *origin, unsigned int options, isc_buffer_t *target)
 Convert the textual representation of a DNS name at source into uncompressed wire form stored in target.
isc_result_t dns_name_toprincipal (const dns_name_t *name, isc_buffer_t *target)
isc_result_t dns_name_totext (const dns_name_t *name, isc_boolean_t omit_final_dot, isc_buffer_t *target)
isc_result_t dns_name_totext2 (const dns_name_t *name, unsigned int options, isc_buffer_t *target)
 Convert 'name' into text format, storing the result in 'target'.
isc_result_t dns_name_tofilenametext (dns_name_t *name, isc_boolean_t omit_final_dot, isc_buffer_t *target)
 Convert 'name' into an alternate text format appropriate for filenames, storing the result in 'target'. The name data is downcased, guaranteeing that the filename does not depend on the case of the converted name.
isc_result_t dns_name_downcase (dns_name_t *source, dns_name_t *name, isc_buffer_t *target)
 Downcase 'source'.
isc_result_t dns_name_concatenate (dns_name_t *prefix, dns_name_t *suffix, dns_name_t *name, isc_buffer_t *target)
 Concatenate 'prefix' and 'suffix'.
void dns_name_split (dns_name_t *name, unsigned int suffixlabels, dns_name_t *prefix, dns_name_t *suffix)
 Split 'name' into two pieces on a label boundary.
isc_result_t dns_name_dup (const dns_name_t *source, isc_mem_t *mctx, dns_name_t *target)
 Make 'target' a dynamically allocated copy of 'source'.
isc_result_t dns_name_dupwithoffsets (dns_name_t *source, isc_mem_t *mctx, dns_name_t *target)
 Make 'target' a read-only dynamically allocated copy of 'source'. 'target' will also have a dynamically allocated offsets table.
void dns_name_free (dns_name_t *name, isc_mem_t *mctx)
 Free 'name'.
isc_result_t dns_name_digest (dns_name_t *name, dns_digestfunc_t digest, void *arg)
 Send 'name' in DNSSEC canonical form to 'digest'.
isc_boolean_t dns_name_dynamic (dns_name_t *name)
 Returns whether there is dynamic memory associated with this name.
isc_result_t dns_name_print (dns_name_t *name, FILE *stream)
 Print 'name' on 'stream'.
void dns_name_format (const dns_name_t *name, char *cp, unsigned int size)
 Format 'name' as text appropriate for use in log messages.
isc_result_t dns_name_tostring (dns_name_t *source, char **target, isc_mem_t *mctx)
 Convert 'name' to string format, allocating sufficient memory to hold it (free with isc_mem_free()).
isc_result_t dns_name_fromstring (dns_name_t *target, const char *src, unsigned int options, isc_mem_t *mctx)
isc_result_t dns_name_fromstring2 (dns_name_t *target, const char *src, const dns_name_t *origin, unsigned int options, isc_mem_t *mctx)
 Convert a string to a name and place it in target, allocating memory as necessary. 'options' has the same semantics as that of dns_name_fromtext().
isc_result_t dns_name_settotextfilter (dns_name_totextfilter_t proc)
 Set / clear a thread specific function 'proc' to be called at the end of dns_name_totext().
isc_result_t dns_name_copy (const dns_name_t *source, dns_name_t *dest, isc_buffer_t *target)
 Makes 'dest' refer to a copy of the name in 'source'. The data are either copied to 'target' or the dedicated buffer in 'dest'.
isc_boolean_t dns_name_ishostname (const dns_name_t *name, isc_boolean_t wildcard)
 Return if 'name' is a valid hostname. RFC 952 / RFC 1123. If 'wildcard' is ISC_TRUE then allow the first label of name to be a wildcard. The root is also accepted.
isc_boolean_t dns_name_ismailbox (const dns_name_t *name)
 Return if 'name' is a valid mailbox. RFC 821.
isc_boolean_t dns_name_internalwildcard (const dns_name_t *name)
 Return if 'name' contains a internal wildcard name.
void dns_name_destroy (void)
 Cleanup dns_name_settotextfilter() / dns_name_totext() state.

Variables

LIBDNS_EXTERNAL_DATA dns_name_tdns_rootname
LIBDNS_EXTERNAL_DATA dns_name_tdns_wildcardname


Detailed Description

Provides facilities for manipulating DNS names and labels, including conversions to and from wire format and text format.

Given the large number of names possible in a nameserver, and because names occur in rdata, it was important to come up with a very efficient way of storing name data, but at the same time allow names to be manipulated. The decision was to store names in uncompressed wire format, and not to make them fully abstracted objects; i.e. certain parts of the server know names are stored that way. This saves a lot of memory, and makes adding names to messages easy. Having much of the server know the representation would be perilous, and we certainly don't want each user of names to be manipulating such a low-level structure. This is where the Names and Labels module comes in. The module allows name or label handles to be created and attached to uncompressed wire format regions. All name operations and conversions are done through these handles.

MP:

Reliability: Resources: Security:

Standards:

Definition in file name.h.


Define Documentation

#define DNS_NAME_H   1

Definition at line 21 of file name.h.

#define DNS_NAME_MAGIC   ISC_MAGIC('D','N','S','n')

Definition at line 122 of file name.h.

#define DNS_NAMEATTR_ABSOLUTE   0x00000001

Definition at line 124 of file name.h.

Referenced by dns_name_caseequal(), dns_name_concatenate(), dns_name_copy(), dns_name_downcase(), dns_name_dup(), dns_name_dupwithoffsets(), dns_name_equal(), dns_name_fromregion(), dns_name_fromtext(), dns_name_fromwire(), dns_name_fullcompare(), dns_name_getlabelsequence(), dns_name_isabsolute(), dns_name_ishostname(), dns_name_ismailbox(), dns_name_rdatacompare(), dns_name_tofilenametext(), dns_rbt_addnode(), dns_rbtnodechain_current(), and set_offsets().

#define DNS_NAMEATTR_READONLY   0x00000002

Definition at line 125 of file name.h.

Referenced by dns_name_clone(), dns_name_downcase(), dns_name_dupwithoffsets(), dns_rbtnode_nodename(), and NODENAME().

#define DNS_NAMEATTR_DYNAMIC   0x00000004

Definition at line 126 of file name.h.

Referenced by dns_name_clone(), dns_name_dup(), dns_name_dupwithoffsets(), dns_name_dynamic(), dns_name_free(), and maybe_free().

#define DNS_NAMEATTR_DYNOFFSETS   0x00000008

Definition at line 127 of file name.h.

Referenced by dns_name_clone(), dns_name_dupwithoffsets(), and dns_name_free().

#define DNS_NAMEATTR_NOCOMPRESS   0x00000010

Definition at line 128 of file name.h.

Referenced by dns_name_towire(), dns_tsig_sign(), getsection(), and send_update().

#define DNS_NAMEATTR_CACHE   0x00000100

Used by resolver.

Definition at line 132 of file name.h.

Referenced by answer_response(), cache_message(), mark_related(), and noanswer_response().

#define DNS_NAMEATTR_ANSWER   0x00000200

Used by resolver.

Definition at line 133 of file name.h.

Referenced by answer_response(), and cache_name().

#define DNS_NAMEATTR_NCACHE   0x00000400

Used by resolver.

Definition at line 134 of file name.h.

Referenced by addoptout(), and noanswer_response().

#define DNS_NAMEATTR_CHAINING   0x00000800

Used by resolver.

Definition at line 135 of file name.h.

Referenced by answer_response(), and cache_name().

#define DNS_NAMEATTR_CHASE   0x00001000

Used by resolver.

Definition at line 136 of file name.h.

Referenced by chase_additional(), and mark_related().

#define DNS_NAMEATTR_WILDCARD   0x00002000

Used by server.

Definition at line 137 of file name.h.

Referenced by make_key(), query_addnxrrsetnsec(), query_find(), and zone_find().

#define DNS_NAMEATTR_PREREQUISITE   0x00004000

Used by client.

Definition at line 138 of file name.h.

Referenced by dns_client_updaterec().

#define DNS_NAMEATTR_UPDATE   0x00008000

Used by client.

Definition at line 139 of file name.h.

Referenced by dns_client_updaterec().

#define DNS_NAMEATTR_HASUPDATEREC   0x00010000

Used by client.

Definition at line 140 of file name.h.

Referenced by dns_client_freeupdate(), and dns_client_updaterec().

#define DNS_NAME_DOWNCASE   0x0001

Definition at line 145 of file name.h.

Referenced by add_initial_keys(), check_zoneconf(), configure_rpz_name(), configure_rpz_name2(), configure_view(), dns_client_setdlv(), dns_name_fromtext(), and dns_name_fromwire().

#define DNS_NAME_CHECKNAMES   0x0002

Used by rdata.

Definition at line 146 of file name.h.

#define DNS_NAME_CHECKNAMESFAIL   0x0004

Used by rdata.

Definition at line 147 of file name.h.

#define DNS_NAME_CHECKREVERSE   0x0008

Used by rdata.

Definition at line 148 of file name.h.

#define DNS_NAME_CHECKMX   0x0010

Used by rdata.

Definition at line 149 of file name.h.

#define DNS_NAME_CHECKMXFAIL   0x0020

Used by rdata.

Definition at line 150 of file name.h.

#define DNS_NAME_MAXWIRE   255

Standard size of a wire format name.

Definition at line 158 of file name.h.

Referenced by add_ns(), buildquery(), copy_name(), create_managers(), dns_name_concatenate(), dns_name_fromregion(), dns_name_fromwire(), dns_test_begin(), emit(), initialize(), load_raw(), main(), parse_name(), and setup_system().

#define DNS_NAME_OMITFINALDOT   0x01U

Definition at line 810 of file name.h.

Referenced by dns_name_toprincipal(), dns_name_totext(), and dns_name_totext2().

#define DNS_NAME_MASTERFILE   0x02U

Definition at line 811 of file name.h.

Referenced by dns_name_totext(), and dns_name_totext2().

#define DNS_NAME_MAXTEXT   1023

The maximum length of the text representation of a domain name as generated by dns_name_totext(). This does not include space for a terminating NULL.

This definition is conservative - the actual maximum is 1004, derived as follows:

A backslash-decimal escaped character takes 4 bytes. A wire-encoded name can be up to 255 bytes and each label is one length byte + at most 63 bytes of data. Maximizing the label lengths gives us a name of three 63-octet labels, one 61-octet label, and the root label:

1 + 63 + 1 + 63 + 1 + 63 + 1 + 61 + 1 = 255

When printed, this is (3 * 63 + 61) * 4 bytes for the escaped label data + 4 bytes for the dot terminating each label = 1004 bytes total.

Definition at line 859 of file name.h.

Referenced by closeversion(), createiterator(), deleterdataset(), dns_sdb_create(), dns_sdb_putsoa(), dns_sdlz_putsoa(), dns_sdlzallowzonexfr(), dns_sdlzfindzone(), dns_xfrin_create3(), dst_gssapi_acquirecred(), dst_gssapi_initctx(), findnodeext(), getnodedata(), modrdataset(), newversion(), recvsoa(), and xfrin_log().

#define DNS_NAME_FORMATSIZE   (DNS_NAME_MAXTEXT + 1)

Suggested size of buffer passed to dns_name_format(). Includes space for the terminating NULL.

Definition at line 1220 of file name.h.

Referenced by add_bad(), add_cidr(), addnowildcardhash(), addnsec3(), badname(), build_final_keylist(), cache_name(), check_keylist(), check_mx(), check_no_nsec(), check_no_rrsig(), check_servers(), check_ttls(), check_wildcard(), check_zoneconf(), checkmx(), checkns(), checkqueryacl(), checksrv(), checkupdateacl(), checkwildcard(), client_request(), commit(), configure_forward(), configure_view(), create_empty_zone(), decrement_reference(), del_name(), del_sigs(), delete_keynames(), detachnode(), detailsection(), diff_apply(), dlvfetched(), dname_target(), dns_adb_createfind2(), dns_badcache_print(), dns_dnssec_findmatchingkeys(), dns_dnssec_findzonekeys2(), dns_dnssec_keylistfromrdataset(), dns_dnssec_verify3(), dns_keytable_totext(), dns_name_tostring(), dns_nsec3_hashname(), dns_nsec3_noexistnodata(), dns_ntatable_covered(), dns_ntatable_totext(), dns_resolver_logfetch(), dns_root_checkhints(), dns_rpz_find_name(), dns_sdlzssumatch(), dns_ssu_external_match(), dns_tsigkey_createfromkey(), dst_gssapi_identitymatchesrealmkrb5(), dst_gssapi_identitymatchesrealmms(), dst_key_format(), dump_key(), expecttofindkey(), expirenode(), fctx_create(), fetch_callback(), finddlvsep(), findname(), findnsec3proofs(), fix_triggers(), followup_lookup(), free_rbtdb(), freezezones(), generate(), hashlist_add_dns_name(), integrity_checks(), is_answeraddress_allowed(), is_answertarget_allowed(), keyfetch_done(), list_keynames(), load_secroots(), load_text(), loadset(), log_edns(), log_fetch(), log_lame(), log_ns_ttl(), log_query(), log_queryerror(), main(), match_nsec3(), maybe_free_rbtdb(), mkey_dumpzone(), mkey_refresh(), mustbesecure(), name2ipkey(), noanswer_response(), ns_client_aclmsg(), ns_client_dumprecursing(), ns_client_logv(), ns_notify_start(), ns_query(), ns_server_freeze(), ns_server_mkeys(), ns_server_sync(), ns_server_zonestatus(), ns_stats_dump(), ns_xfr_start(), opendb(), print_dns_name(), printmessage(), printnodename(), printsection(), printsoa(), proveunsecure(), query_find(), recv_done(), recvsoa(), report(), resquery_response(), rpz_getdb(), rpz_log_fail(), rpz_log_rewrite(), rrset_cleanup(), same_question(), say_message(), send_forward_event(), sig_format(), signname(), signset(), soa_query(), startfinddlvsep(), totext_cdnskey(), totext_dnskey(), totext_key(), totext_keydata(), trim_ns_ttl(), tsig_log(), update_action(), update_addordelete(), update_log(), validatezonekey(), validator_logcreate(), validator_logv(), verifynsec(), verifynsec3(), verifyset(), verifyzone(), view_find(), warn_badname(), warn_rfc1918(), writeset(), xfrout_logv(), zone_check_glue(), zone_check_mx(), zone_check_ns(), zone_check_srv(), zone_from_args(), zone_postload(), zone_rrset_check_dup(), and zone_xfrdone().

#define DNS_NAME_INIT ( n,
 ) 

Value:

do { \
        dns_name_t *_n = (n); \
        /* memset(_n, 0, sizeof(*_n)); */ \
        _n->magic = DNS_NAME_MAGIC; \
        _n->ndata = NULL; \
        _n->length = 0; \
        _n->labels = 0; \
        _n->attributes = 0; \
        _n->offsets = (o); \
        _n->buffer = NULL; \
        ISC_LINK_INIT(_n, link); \
        ISC_LIST_INIT(_n->list); \
} while (0)

Definition at line 1307 of file name.h.

Referenced by dns_name_concatenate(), dns_name_digest(), dns_name_hashbylabel(), dns_name_init(), dns_name_matcheswildcard(), and dns_name_towire().

#define DNS_NAME_RESET (  ) 

Value:

do { \
        (n)->ndata = NULL; \
        (n)->length = 0; \
        (n)->labels = 0; \
        (n)->attributes &= ~DNS_NAMEATTR_ABSOLUTE; \
        if ((n)->buffer != NULL) \
                isc_buffer_clear((n)->buffer); \
} while (0)

Definition at line 1322 of file name.h.

Referenced by dns_name_reset().

#define DNS_NAME_SETBUFFER ( n,
 )     (n)->buffer = (b)

Definition at line 1332 of file name.h.

#define DNS_NAME_ISABSOLUTE (  )     (((n)->attributes & DNS_NAMEATTR_ABSOLUTE) != 0 ? ISC_TRUE : ISC_FALSE)

Definition at line 1335 of file name.h.

#define DNS_NAME_COUNTLABELS (  )     ((n)->labels)

Definition at line 1338 of file name.h.

#define DNS_NAME_TOREGION ( n,
r   ) 

Value:

do { \
        (r)->base = (n)->ndata; \
        (r)->length = (n)->length; \
} while (0)

Definition at line 1341 of file name.h.

Referenced by dns_name_toregion().

#define DNS_NAME_SPLIT ( n,
l,
p,
s   ) 

Value:

do { \
        dns_name_t *_n = (n); \
        dns_name_t *_p = (p); \
        dns_name_t *_s = (s); \
        unsigned int _l = (l); \
        if (_p != NULL) \
                dns_name_getlabelsequence(_n, 0, _n->labels - _l, _p); \
        if (_s != NULL) \
                dns_name_getlabelsequence(_n, _n->labels - _l, _l, _s); \
} while (0)

Definition at line 1347 of file name.h.


Typedef Documentation

typedef isc_result_t(* dns_name_totextfilter_t)(isc_buffer_t *target, unsigned int used_org, isc_boolean_t absolute)

Definition at line 165 of file name.h.


Function Documentation

void dns_name_init ( dns_name_t name,
unsigned char *  offsets 
)

Initialize 'name'.

Notes:

Requires: Ensures:

Definition at line 208 of file name.c.

References DNS_NAME_INIT.

Referenced by activeempty(), activeemtpynode(), add_empty_wildcards(), add_initial_keys(), add_ns(), add_rdata_to_list(), add_wildcard_magic(), addclosest(), additionaldata_afsdb(), additionaldata_in_kx(), additionaldata_in_srv(), additionaldata_lp(), additionaldata_mb(), additionaldata_md(), additionaldata_mf(), additionaldata_mx(), additionaldata_naptr(), additionaldata_ns(), additionaldata_rt(), addnoqname(), addonlevel(), ATF_TC_BODY(), build_event(), buildquery(), casecompare_hip(), casecompare_ipseckey(), casecompare_lp(), casecompare_nsec(), casecompare_rrsig(), cfg_acl_fromconfig2(), chain_name(), checknames_afsdb(), checknames_ch_a(), checknames_in_a6(), checknames_in_srv(), checknames_minfo(), checknames_mx(), checknames_ns(), checknames_ptr(), checknames_rp(), checknames_rt(), checknames_soa(), checkwildcard(), clean_target(), cleanup_ring(), client_create(), client_request(), client_resfind(), cname_target(), compare_afsdb(), compare_any_tsig(), compare_ch_a(), compare_cname(), compare_dname(), compare_in_a6(), compare_in_kx(), compare_in_nsap_ptr(), compare_in_px(), compare_in_srv(), compare_labelsequences(), compare_mb(), compare_md(), compare_mf(), compare_mg(), compare_minfo(), compare_mr(), compare_mx(), compare_naptr(), compare_ns(), compare_nxt(), compare_ptr(), compare_rp(), compare_rt(), compare_sig(), compare_soa(), compare_tkey(), configure_rpz_zone(), configure_session_key(), configure_staticstub(), copy_name(), copy_ptr_targets(), create_query(), delete_keynames(), digest_afsdb(), digest_ch_a(), digest_cname(), digest_dname(), digest_in_a6(), digest_in_kx(), digest_in_nsap_ptr(), digest_in_px(), digest_in_srv(), digest_mb(), digest_md(), digest_mf(), digest_mg(), digest_minfo(), digest_mr(), digest_mx(), digest_naptr(), digest_ns(), digest_nxt(), digest_ptr(), digest_rp(), digest_rt(), digest_soa(), dns_acache_setentry(), dns_acl_merge(), dns_badcache_add(), dns_client_startupdate(), dns_compress_add(), dns_compress_findglobal(), dns_difftuple_create(), dns_dnssec_sign(), dns_dnssec_signmessage(), dns_ecdb_create(), dns_message_gettempname(), dns_message_sectiontotext(), dns_ncache_current(), dns_ncache_getrdataset(), dns_ncache_getsigrdataset(), dns_ncache_towire(), dns_nsec3_addnsec3(), dns_nsec3_delnsec3(), dns_nsec3param_deletechains(), dns_nsec_noexistnodata(), dns_peer_setkeybycharp(), dns_rbt_addnode(), dns_rbt_findnode(), dns_rbt_fullnamefromnode(), dns_rbtdb_create(), dns_rdata_hip_next(), dns_resolver_addalternate(), dns_sdb_create(), dns_sdlz_putnamedrr(), dns_sdlzcreateDBP(), dns_soa_buildrdata(), dns_ssutable_addrule(), dns_tkey_builddeletequery(), dns_tkey_builddhquery(), dns_tkey_buildgssquery(), dns_tkey_processdhresponse(), dns_tkey_processquery(), dns_tsig_sign(), dns_tsigkey_createfromkey(), dns_tsigkeyring_dumpanddetach(), dns_view_adddelegationonly(), dns_view_excludedelegationonly(), dns_zone_create(), dns_zone_setorigin(), fctx_create(), fctx_getaddresses(), find_deepest_zonecut(), find_wildcard(), finddlvsep(), findnode(), findnodeext(), findnodeintree(), findnsec3proofs(), fromtext_afsdb(), fromtext_any_tsig(), fromtext_ch_a(), fromtext_cname(), fromtext_dname(), fromtext_hip(), fromtext_in_a6(), fromtext_in_kx(), fromtext_in_nsap_ptr(), fromtext_in_px(), fromtext_in_srv(), fromtext_ipseckey(), fromtext_lp(), fromtext_mb(), fromtext_md(), fromtext_mf(), fromtext_mg(), fromtext_minfo(), fromtext_mr(), fromtext_mx(), fromtext_naptr(), fromtext_ns(), fromtext_nsec(), fromtext_nxt(), fromtext_ptr(), fromtext_rp(), fromtext_rrsig(), fromtext_rt(), fromtext_sig(), fromtext_soa(), fromtext_tkey(), fromwire_afsdb(), fromwire_any_tsig(), fromwire_cdnskey(), fromwire_ch_a(), fromwire_cname(), fromwire_dname(), fromwire_dnskey(), fromwire_hip(), fromwire_in_a6(), fromwire_in_kx(), fromwire_in_nsap_ptr(), fromwire_in_px(), fromwire_in_srv(), fromwire_ipseckey(), fromwire_key(), fromwire_lp(), fromwire_mb(), fromwire_md(), fromwire_mf(), fromwire_mg(), fromwire_minfo(), fromwire_mr(), fromwire_mx(), fromwire_naptr(), fromwire_ns(), fromwire_nsec(), fromwire_nxt(), fromwire_ptr(), fromwire_rp(), fromwire_rrsig(), fromwire_rt(), fromwire_sig(), fromwire_soa(), fromwire_tkey(), get_key_struct(), getnode(), getnodedata(), getquestions(), getsection(), insert_soa(), is_glue(), isdelegation(), issecuredomain(), journal_open(), list_keynames(), loading_addrdataset(), make_key(), name2data(), name2ipkey(), ncache_summary(), new_adblameinfo(), new_adbname(), noanswer_response(), notify_create(), notify_createmessage(), ns_config_getipandkeylist(), ns_lwsearchlist_append(), ns_tkeyctx_fromconfig(), parse_name(), printnodename(), printsection(), process_dhtkey(), process_soa(), query_addadditional2(), query_addns(), query_addsoa(), query_find(), query_findclosestnsec3(), query_newname(), receive_soa(), recvsoa(), redirect2(), resigned(), resolvesoa_done(), resquery_response(), resquery_send(), resume_dslookup(), rpz_get_p_name(), send_update(), sendstream(), serialize_node(), set_addrkeylist(), setup_lookup(), setup_master(), setup_system(), setup_text_key(), setzone(), short_answer(), start_lookup(), start_update(), sync_keyzone(), tostruct_afsdb(), tostruct_any_tsig(), tostruct_ch_a(), tostruct_cname(), tostruct_dname(), tostruct_in_a6(), tostruct_in_kx(), tostruct_in_nsap_ptr(), tostruct_in_px(), tostruct_in_srv(), tostruct_ipseckey(), tostruct_lp(), tostruct_mb(), tostruct_md(), tostruct_mf(), tostruct_mg(), tostruct_minfo(), tostruct_mr(), tostruct_mx(), tostruct_naptr(), tostruct_ns(), tostruct_nsec(), tostruct_nxt(), tostruct_ptr(), tostruct_rp(), tostruct_rrsig(), tostruct_rt(), tostruct_sig(), tostruct_soa(), tostruct_tkey(), totext_afsdb(), totext_any_tsig(), totext_cdnskey(), totext_ch_a(), totext_cname(), totext_dname(), totext_dnskey(), totext_hip(), totext_in_a6(), totext_in_kx(), totext_in_nsap_ptr(), totext_in_px(), totext_in_srv(), totext_ipseckey(), totext_key(), totext_lp(), totext_mb(), totext_md(), totext_mf(), totext_mg(), totext_minfo(), totext_mr(), totext_mx(), totext_naptr(), totext_ns(), totext_nsec(), totext_nxt(), totext_ptr(), totext_rp(), totext_rrsig(), totext_rt(), totext_sig(), totext_soa(), totext_tkey(), towire_afsdb(), towire_any_tsig(), towire_ch_a(), towire_cname(), towire_dname(), towire_in_a6(), towire_in_kx(), towire_in_nsap_ptr(), towire_in_px(), towire_in_srv(), towire_mb(), towire_md(), towire_mf(), towire_mg(), towire_minfo(), towire_mr(), towire_mx(), towire_naptr(), towire_ns(), towire_nsec(), towire_nxt(), towire_ptr(), towire_rp(), towire_rrsig(), towire_rt(), towire_sig(), towire_soa(), towire_tkey(), treefix(), tuple2msgname(), valid_glue(), verifyemptynodes(), writeset(), xfrin_create(), xfrin_send_request(), and zone_notify().

void dns_name_reset ( dns_name_t name  ) 

Reinitialize 'name'.

Notes:

Requires: Ensures:

Definition at line 216 of file name.c.

References BINDABLE, DNS_NAME_RESET, REQUIRE, and VALID_NAME.

Referenced by chain_name(), dns_compress_findglobal(), dns_rbt_fullnamefromnode(), and getname().

void dns_name_invalidate ( dns_name_t name  ) 

Make 'name' invalid.

Requires:

Ensures:

Definition at line 224 of file name.c.

References dns_name::attributes, dns_name::buffer, ISC_LINK_INIT, dns_name::labels, dns_name::length, dns_name::magic, dns_name::ndata, dns_name::offsets, REQUIRE, and VALID_NAME.

Referenced by dns_difftuple_free(), dns_journal_destroy(), dns_name_free(), and setup_text_key().

isc_boolean_t dns_name_isvalid ( const dns_name_t name  ) 

Check whether 'name' points to a valid dns_name.

Definition at line 242 of file name.c.

References ISC_FALSE, ISC_TRUE, dns_name::labels, dns_name::length, dns_name::ndata, dns_name::offsets, and VALID_NAME.

Referenced by treefix().

void dns_name_setbuffer ( dns_name_t name,
isc_buffer_t buffer 
)

Dedicate a buffer for use with 'name'.

Notes:

Requires:

Definition at line 282 of file name.c.

References dns_name::buffer, REQUIRE, and VALID_NAME.

Referenced by copy_name(), dns_client_updaterec(), dns_message_signer(), parse_name(), query_addadditional2(), query_keepname(), and query_newname().

isc_boolean_t dns_name_hasbuffer ( const dns_name_t name  ) 

Does 'name' have a dedicated buffer?

Requires:

Returns:

Definition at line 295 of file name.c.

References dns_name::buffer, ISC_FALSE, ISC_TRUE, REQUIRE, and VALID_NAME.

Referenced by dns_adb_createfind2(), dns_db_find(), dns_db_findext(), dns_db_findzonecut(), dns_dbiterator_current(), dns_dbiterator_origin(), dns_message_signer(), and query_releasename().

isc_boolean_t dns_name_isabsolute ( const dns_name_t name  ) 

Does 'name' end in the root label?

Requires:

Returns:

Definition at line 309 of file name.c.

References dns_name::attributes, DNS_NAMEATTR_ABSOLUTE, ISC_FALSE, ISC_TRUE, REQUIRE, and VALID_NAME.

Referenced by dns_compress_add(), dns_compress_findglobal(), dns_db_create(), dns_keytable_finddeepestmatch(), dns_keytable_findkeynode(), dns_keytable_issecuredomain(), dns_ntatable_covered(), dns_rbt_addname(), dns_rbt_addnode(), dns_rbt_deletename(), dns_rbt_findnode(), dns_rbt_fullnamefromnode(), dns_rbtnodechain_current(), dns_rdata_fromtext(), dns_ssutable_addrule(), dns_ssutable_checkrules(), dst_key_buildinternal(), dst_key_fromfile(), dst_key_fromlabel(), dst_key_generate2(), dst_key_getfilename(), frombuffer(), loadctx_create(), make_log_buf(), next_origin(), ns_lwsearchctx_current(), ns_lwsearchctx_init(), query_find(), rdata_totext(), setup_lookup(), and treefix().

isc_boolean_t dns_name_iswildcard ( const dns_name_t name  ) 

Is 'name' a wildcard name?

Requires:

Returns:

Definition at line 427 of file name.c.

References ISC_FALSE, ISC_TRUE, dns_name::labels, dns_name::length, dns_name::ndata, REQUIRE, and VALID_NAME.

Referenced by add_empty_wildcards(), check_update_policy(), dns_dnssec_sign(), dns_name_matcheswildcard(), dns_rpz_decode_cname(), dns_ssutable_addrule(), dns_ssutable_checkrules(), findnodeintree(), loading_addrdataset(), match(), name2data(), rpz_add_cname(), update_action(), and xfr_rr().

unsigned int dns_name_hash ( dns_name_t name,
isc_boolean_t  case_sensitive 
)

Provide a hash value for 'name'.

Note: if 'case_sensitive' is ISC_FALSE, then names which differ only in case will have the same hash value.

Requires:

Returns:

Definition at line 516 of file name.c.

References dns_name::labels, name_hash(), REQUIRE, and VALID_NAME.

Referenced by dns_adb_flushname(), dns_badcache_add(), dns_badcache_find(), dns_badcache_flushname(), dns_compress_add(), dns_compress_findglobal(), dns_rbtdb_create(), dns_view_adddelegationonly(), dns_view_excludedelegationonly(), dns_view_isdelegationonly(), findnodeintree(), and loading_addrdataset().

unsigned int dns_name_fullhash ( dns_name_t name,
isc_boolean_t  case_sensitive 
)

Provide a hash value for 'name'. Unlike dns_name_hash(), this function always takes into account of the entire name to calculate the hash value.

Note: if 'case_sensitive' is ISC_FALSE, then names which differ only in case will have the same hash value.

Requires:

Returns:

Definition at line 529 of file name.c.

References isc_hash_calc(), dns_name::labels, dns_name::length, dns_name::ndata, REQUIRE, and VALID_NAME.

Referenced by dns_fullname_hash(), dns_rbt_findnode(), dns_resolver_createfetch3(), find_name_and_lock(), and grow_names().

unsigned int dns_name_hashbylabel ( dns_name_t name,
isc_boolean_t  case_sensitive 
)

Provide a hash value for 'name', where the hash value is the sum of the hash values of each label.

Note: if 'case_sensitive' is ISC_FALSE, then names which differ only in case will have the same hash value.

Requires:

Returns:

Definition at line 555 of file name.c.

References DNS_NAME_INIT, dns_name::labels, dns_name::length, name_hash(), dns_name::ndata, REQUIRE, SETUP_OFFSETS, and VALID_NAME.

Referenced by make_key().

dns_namereln_t dns_name_fullcompare ( const dns_name_t name1,
const dns_name_t name2,
int *  orderp,
unsigned int *  nlabelsp 
)

Determine the relative ordering under the DNSSEC order relation of 'name1' and 'name2', and also determine the hierarchical relationship of the names.

Note: It makes no sense for one of the names to be relative and the other absolute. If both names are relative, then to be meaningfully compared the caller must ensure that they are both relative to the same domain.

Requires:

Ensures:

Returns:

Definition at line 589 of file name.c.

References dns_name::attributes, DNS_NAMEATTR_ABSOLUTE, dns_namereln_commonancestor, dns_namereln_contains, dns_namereln_equal, dns_namereln_none, dns_namereln_subdomain, INSIST, dns_name::labels, maptolower, dns_name::ndata, REQUIRE, SETUP_OFFSETS, and VALID_NAME.

Referenced by ATF_TC_BODY(), client_resfind(), create_empty_zone(), dname_target(), dns_name_compare(), dns_name_issubdomain(), dns_name_matcheswildcard(), dns_nsec_noexistnodata(), dns_rbt_addnode(), dns_rbt_findnode(), followup_lookup(), get_key(), is_lame(), isstrictsubdomain(), lookup_find(), nsec3ify(), query_addwildcardproof(), query_find(), rrsig_fromchildzone(), set_target(), and verifyemptynodes().

int dns_name_compare ( const dns_name_t name1,
const dns_name_t name2 
)

Determine the relative ordering under the DNSSEC order relation of 'name1' and 'name2'.

Note: It makes no sense for one of the names to be relative and the other absolute. If both names are relative, then to be meaningfully compared the caller must ensure that they are both relative to the same domain.

Requires:

Returns:

Definition at line 697 of file name.c.

References dns_name_fullcompare().

Referenced by check_node(), diff_namespace(), dns_dbtable_adddefault(), in_rootns(), is_glue(), load_text(), name_order(), name_prefix(), rpz_rewrite_name(), temp_order(), valid_glue(), view_find(), and zone_notify().

isc_boolean_t dns_name_equal ( const dns_name_t name1,
const dns_name_t name2 
)

Are 'name1' and 'name2' equal?

Notes:

Requires: Returns:

Definition at line 717 of file name.c.

References dns_name::attributes, DNS_NAMEATTR_ABSOLUTE, INSIST, ISC_FALSE, ISC_TRUE, dns_name::labels, dns_name::length, maptolower, dns_name::ndata, REQUIRE, and VALID_NAME.

Referenced by activeemtpynode(), add_nsec3param_records(), add_signing_records(), addkey(), answer_in_glue(), answer_response(), assignwork(), ATF_TC_BODY(), check_deadlock(), check_options(), check_zoneconf(), checkowner_opt(), configure_rpz_zone(), configure_session_key(), configure_zone(), dbiterator_seek(), diff_apply(), dns_aclelement_match2(), dns_adb_flushname(), dns_adb_marklame(), dns_badcache_add(), dns_badcache_find(), dns_badcache_flushname(), dns_cache_flushnode(), dns_compress_findglobal(), dns_diff_load(), dns_dnssec_findzonekeys2(), dns_dnssec_keylistfromrdataset(), dns_dnssec_verify3(), dns_dnssec_verifymessage(), dns_ncache_getrdataset(), dns_ncache_getsigrdataset(), dns_nsec3_noexistnodata(), dns_rbt_findnode(), dns_rpz_decode_cname(), dns_sdlz_putnamedrr(), dns_ssutable_checkrules(), dns_tkey_gssnegotiate(), dns_tkey_processdeleteresponse(), dns_tkey_processdhresponse(), dns_tkey_processgssresponse(), dns_tkey_processquery(), dns_tsig_verify(), dns_tsigkey_create(), dns_tsigkey_createfromkey(), dns_tsigkey_find(), dns_update_signaturesinc(), dns_view_adddelegationonly(), dns_view_excludedelegationonly(), dns_view_find2(), dns_view_findzonecut2(), dns_view_isdelegationonly(), dst_alg_fromname(), dst_key_fromfile(), entry_is_lame(), fctx_match(), find_name_and_lock(), findname(), findnodeext(), fix_mustbedelegationornxdomain(), getnode(), getnodedata(), getsection(), goodsig(), integrity_checks(), is_delegation(), isselfsigned(), iszonekey(), keythatsigned_unlocked(), load_view_keys(), loadexplicitkeys(), loading_addrdataset(), main(), match(), name2ipkey(), next_active(), noanswer_response(), notify_isqueued(), ns_xfr_start(), nsec3ify(), nsecify(), on_disable_list(), process_deletetkey(), process_dhtkey(), process_gsstkey(), proveunsecure(), query_addds(), query_addwildcardproof(), query_find(), recv_done(), remove_orphaned_ds(), resquery_response(), resume_dslookup(), rollback_private(), rpz_rewrite(), rpz_rrset_find(), same_keynames(), same_question(), secure(), sign_a_node(), signset(), start_update(), sync_secure_db(), temp_check(), temp_check_rrset(), tsig_verify_tcp(), uniqify_name_list(), update_action(), update_sigs(), validate_authority(), validate_ncache(), validatezonekey(), verify(), verifynsec(), warn_rfc1918(), zone_check_mx(), zone_check_srv(), zone_nsec3chain(), and zone_sign().

isc_boolean_t dns_name_caseequal ( const dns_name_t name1,
const dns_name_t name2 
)

Case sensitive version of dns_name_equal().

Definition at line 772 of file name.c.

References dns_name::attributes, DNS_NAMEATTR_ABSOLUTE, ISC_FALSE, ISC_TRUE, dns_name::length, dns_name::ndata, REQUIRE, and VALID_NAME.

Referenced by add_rr_prepare_action(), dns_compress_findglobal(), dns_diff_appendminimal(), and name_prefix().

int dns_name_rdatacompare ( const dns_name_t name1,
const dns_name_t name2 
)

Compare two names as if they are part of rdata in DNSSEC canonical form.

Requires:

Returns:

Definition at line 801 of file name.c.

References dns_name::attributes, DNS_NAMEATTR_ABSOLUTE, INSIST, dns_name::labels, maptolower, dns_name::ndata, REQUIRE, and VALID_NAME.

Referenced by casecompare_hip(), casecompare_ipseckey(), casecompare_lp(), casecompare_nsec(), casecompare_rrsig(), compare_afsdb(), compare_any_tsig(), compare_ch_a(), compare_cname(), compare_dname(), compare_in_a6(), compare_in_kx(), compare_in_nsap_ptr(), compare_in_px(), compare_in_srv(), compare_mb(), compare_md(), compare_mf(), compare_mg(), compare_minfo(), compare_mr(), compare_mx(), compare_naptr(), compare_ns(), compare_nxt(), compare_ptr(), compare_rp(), compare_rt(), compare_sig(), compare_soa(), compare_tkey(), and rpz_rewrite_ip().

isc_boolean_t dns_name_issubdomain ( const dns_name_t name1,
const dns_name_t name2 
)

Is 'name1' a subdomain of 'name2'?

Notes:

Requires: Returns:

Definition at line 859 of file name.c.

References dns_name_fullcompare(), dns_namereln_equal, dns_namereln_subdomain, ISC_FALSE, and ISC_TRUE.

Referenced by activeempty(), activeemtpynode(), answer_response(), assignwork(), check_section(), check_zoneconf(), checknames_ptr(), cleartree(), configure_staticstub_servernames(), dns_adb_flushnames(), dns_badcache_flushtree(), dns_dnssec_verify3(), dns_nsec3_noexistnodata(), dns_nsec_noexistnodata(), dns_ntatable_covered(), dns_ssutable_checkrules(), dns_view_findzonecut2(), fctx_create(), finddlvsep(), findext(), findname(), findnsec3proofs(), fix_mustbedelegationornxdomain(), generate(), integrity_checks(), is_answertarget_allowed(), load_text(), name_prefix(), namelist_append_subdomain(), next_active(), noanswer_response(), nsec3ify(), nsecify(), query_addadditional(), query_addadditional2(), query_addbestns(), query_find(), query_findclosestnsec3(), redirect2(), resquery_response(), save_nsrrset(), start_lookup(), startfinddlvsep(), type_from_name(), update_action(), validate(), verifyzone(), view_find(), warn_rfc1918(), zone_check_glue(), zone_check_mx(), zone_check_srv(), zone_count_ns_rr(), zone_nsec3chain(), and zone_sign().

isc_boolean_t dns_name_matcheswildcard ( const dns_name_t name,
const dns_name_t wname 
)

Does 'name' match the wildcard specified in 'wname'?

Notes:

Requires: Returns:

Definition at line 882 of file name.c.

References dns_name_fullcompare(), dns_name_getlabelsequence(), DNS_NAME_INIT, dns_name_iswildcard(), dns_namereln_subdomain, ISC_FALSE, ISC_TRUE, dns_name::labels, REQUIRE, and VALID_NAME.

Referenced by dns_ssutable_checkrules(), and match().

unsigned int dns_name_countlabels ( const dns_name_t name  ) 

How many labels does 'name' have?

Notes:

Requires: Ensures: Returns:

Definition at line 907 of file name.c.

References ENSURE, dns_name::labels, REQUIRE, and VALID_NAME.

Referenced by activeemtpynode(), add_empty_wildcards(), add_wildcard_magic(), authvalidated(), checkmx(), checkns(), checksrv(), checkwildcard(), clean_target(), create_node(), dns_compress_add(), dns_compress_findglobal(), dns_dnssec_sign(), dns_dnssec_verify3(), dns_nsec3_addnsec3(), dns_nsec3_delnsec3(), dns_nsec3_noexistnodata(), dns_nsec_noexistnodata(), dns_rbt_addnode(), dns_rbt_findnode(), dns_rdataset_totext(), dns_rpz_decode_cname(), dns_sdlz_putnamedrr(), dns_tkey_processquery(), dns_view_isdelegationonly(), dns_view_searchdlz(), dump_adb(), fctx_create(), fctx_destroy(), fctx_getaddresses(), fctx_try(), finddlvsep(), findext(), findnodeext(), findnoqname(), findnsec3proofs(), getnode(), getnodedata(), integrity_checks(), issecuredomain(), make_key(), name2data(), name2ipkey(), name_prefix(), next_origin(), noanswer_response(), ns_lwsearchctx_init(), nsec3ify(), nsecvalidate(), proveunsecure(), query_addds(), query_addnxrrsetnsec(), query_addwildcardproof(), query_find(), query_findclosestnsec3(), query_getdb(), receive_soa(), recvsoa(), redirect2(), resolvesoa_done(), resquery_response(), resume_dslookup(), rpz_add_cname(), rpz_get_p_name(), rpz_rewrite(), rpz_rewrite_name(), set_target(), start_update(), startfinddlvsep(), verify(), verifyemptynodes(), and writeset().

void dns_name_getlabel ( const dns_name_t name,
unsigned int  n,
dns_label_t label 
)

Make 'label' refer to the 'n'th least significant label of 'name'.

Notes:

Requires:

Definition at line 920 of file name.c.

References isc_region::base, dns_name::labels, dns_name::length, isc_region::length, dns_name::ndata, REQUIRE, SETUP_OFFSETS, and VALID_NAME.

Referenced by checkowner_nsec3(), dns_nsec3_noexistnodata(), isdelegation(), nsec3clean(), record_found(), and rpz_rewrite_name().

void dns_name_getlabelsequence ( const dns_name_t source,
unsigned int  first,
unsigned int  n,
dns_name_t target 
)

Make 'target' refer to the 'n' labels including and following 'first' in 'source'.

Notes:

Requires:

Definition at line 943 of file name.c.

References dns_name::attributes, BINDABLE, DNS_NAMEATTR_ABSOLUTE, dns_name::labels, dns_name::length, dns_name::ndata, dns_name::offsets, REQUIRE, set_offsets(), SETUP_OFFSETS, and VALID_NAME.

Referenced by activeemtpynode(), add_empty_wildcards(), add_wildcard_magic(), dns_compress_add(), dns_compress_findglobal(), dns_name_matcheswildcard(), dns_name_split(), dns_nsec3_addnsec3(), dns_nsec3_delnsec3(), dns_nsec_noexistnodata(), dns_rbt_addnode(), dns_rbt_findnode(), dns_sdlz_putnamedrr(), dns_tkey_processquery(), fctx_create(), fctx_getaddresses(), finddlvsep(), findext(), findnodeext(), getnode(), getnodedata(), issecuredomain(), make_key(), name2data(), name2ipkey(), name_prefix(), proveunsecure(), query_addds(), query_find(), query_findclosestnsec3(), receive_soa(), recvsoa(), redirect2(), resolvesoa_done(), resquery_response(), resume_dslookup(), rpz_get_p_name(), start_update(), verify(), verifyemptynodes(), and writeset().

void dns_name_clone ( const dns_name_t source,
dns_name_t target 
)

Make 'target' refer to the same name as 'source'.

Notes:

                dns_name_getlabelsequence(source, 0,
                                          dns_name_countlabels(source),
                                          target);

but is more efficient. Also, dns_name_clone() works even if 'source' is empty.

Requires:

Definition at line 996 of file name.c.

References dns_name::attributes, BINDABLE, DNS_NAMEATTR_DYNAMIC, DNS_NAMEATTR_DYNOFFSETS, DNS_NAMEATTR_READONLY, dns_name::labels, dns_name::length, dns_name::ndata, dns_name::offsets, REQUIRE, set_offsets(), and VALID_NAME.

Referenced by activeemtpynode(), add_ns(), checknames_afsdb(), checknames_ch_a(), checknames_in_a6(), checknames_in_srv(), checknames_minfo(), checknames_mx(), checknames_ns(), checknames_ptr(), checknames_rp(), checknames_rt(), checknames_soa(), cname_target(), configure_staticstub(), create_empty_zone(), create_query(), dns_client_startupdate(), dns_difftuple_create(), dns_dnssec_sign(), dns_dnssec_signmessage(), dns_message_signer(), dns_name_towire(), dns_nsec3_addnsec3(), dns_nsec3_delnsec3(), dns_rbt_addnode(), dns_rbt_findnode(), dns_soa_buildrdata(), dns_tkey_builddeletequery(), dns_tkey_builddhquery(), dns_tkey_buildgssquery(), dns_tkey_processdhresponse(), dns_tkey_processquery(), dns_tsig_sign(), insert_soa(), isc__rdatalist_getclosest(), isc__rdatalist_getnoqname(), name_duporclone(), notify_createmessage(), nsecify(), process_dhtkey(), process_soa(), query_addadditional2(), query_addns(), query_addsoa(), query_find(), query_findclosestnsec3(), rdataset_getclosest(), rdataset_getnoqname(), receive_soa(), recvsoa(), request_soa(), resigned(), resolvesoa_done(), resquery_send(), rpz_rewrite(), send_update(), setup_lookup(), setzone(), start_update(), tuple2msgname(), and xfrin_send_request().

void dns_name_fromregion ( dns_name_t name,
const isc_region_t r 
)

Make 'name' refer to region 'r'.

Note:

Requires:

Definition at line 1022 of file name.c.

References dns_name::attributes, isc_region::base, BINDABLE, dns_name::buffer, DNS_NAME_MAXWIRE, DNS_NAMEATTR_ABSOLUTE, INIT_OFFSETS, isc_buffer_add, isc_buffer_availableregion, isc_buffer_clear, dns_name::labels, dns_name::length, isc_region::length, dns_name::ndata, r2, REQUIRE, set_offsets(), and VALID_NAME.

Referenced by additionaldata_afsdb(), additionaldata_in_kx(), additionaldata_in_srv(), additionaldata_lp(), additionaldata_mb(), additionaldata_md(), additionaldata_mf(), additionaldata_mx(), additionaldata_naptr(), additionaldata_ns(), additionaldata_rt(), casecompare_hip(), casecompare_ipseckey(), casecompare_lp(), casecompare_nsec(), casecompare_rrsig(), checknames_afsdb(), checknames_ch_a(), checknames_in_a6(), checknames_in_srv(), checknames_minfo(), checknames_mx(), checknames_ns(), checknames_ptr(), checknames_rp(), checknames_rt(), checknames_soa(), compare_afsdb(), compare_any_tsig(), compare_ch_a(), compare_cname(), compare_dname(), compare_in_a6(), compare_in_kx(), compare_in_nsap_ptr(), compare_in_px(), compare_in_srv(), compare_mb(), compare_md(), compare_mf(), compare_mg(), compare_minfo(), compare_mr(), compare_mx(), compare_naptr(), compare_ns(), compare_nxt(), compare_ptr(), compare_rp(), compare_rt(), compare_sig(), compare_soa(), compare_tkey(), digest_afsdb(), digest_ch_a(), digest_cname(), digest_dname(), digest_in_a6(), digest_in_kx(), digest_in_nsap_ptr(), digest_in_px(), digest_in_srv(), digest_mb(), digest_md(), digest_mf(), digest_mg(), digest_minfo(), digest_mr(), digest_mx(), digest_naptr(), digest_ns(), digest_nxt(), digest_ptr(), digest_rp(), digest_rt(), digest_soa(), dns_compress_add(), dns_ncache_current(), dns_ncache_getrdataset(), dns_ncache_getsigrdataset(), dns_ncache_towire(), dns_rdata_hip_current(), dns_rdata_hip_next(), incctx_create(), is_glue(), loadctx_create(), printnodename(), pushfile(), sendstream(), tostruct_afsdb(), tostruct_any_tsig(), tostruct_ch_a(), tostruct_cname(), tostruct_dname(), tostruct_in_a6(), tostruct_in_kx(), tostruct_in_nsap_ptr(), tostruct_in_px(), tostruct_in_srv(), tostruct_ipseckey(), tostruct_lp(), tostruct_mb(), tostruct_md(), tostruct_mf(), tostruct_mg(), tostruct_minfo(), tostruct_mr(), tostruct_mx(), tostruct_naptr(), tostruct_ns(), tostruct_nsec(), tostruct_nxt(), tostruct_ptr(), tostruct_rp(), tostruct_rrsig(), tostruct_rt(), tostruct_sig(), tostruct_soa(), tostruct_tkey(), totext_afsdb(), totext_any_tsig(), totext_cdnskey(), totext_ch_a(), totext_cname(), totext_dname(), totext_dnskey(), totext_hip(), totext_in_a6(), totext_in_kx(), totext_in_nsap_ptr(), totext_in_px(), totext_in_srv(), totext_ipseckey(), totext_key(), totext_lp(), totext_mb(), totext_md(), totext_mf(), totext_mg(), totext_minfo(), totext_mr(), totext_mx(), totext_naptr(), totext_ns(), totext_nsec(), totext_nxt(), totext_ptr(), totext_rp(), totext_rrsig(), totext_rt(), totext_sig(), totext_soa(), totext_tkey(), towire_afsdb(), towire_any_tsig(), towire_ch_a(), towire_cname(), towire_dname(), towire_in_a6(), towire_in_kx(), towire_in_nsap_ptr(), towire_in_px(), towire_in_srv(), towire_mb(), towire_md(), towire_mf(), towire_mg(), towire_minfo(), towire_mr(), towire_mx(), towire_naptr(), towire_ns(), towire_nsec(), towire_nxt(), towire_ptr(), towire_rp(), towire_rrsig(), towire_rt(), towire_sig(), towire_soa(), towire_tkey(), and valid_glue().

void dns_name_toregion ( dns_name_t name,
isc_region_t r 
)

Make 'r' refer to 'name'.

Requires:

Definition at line 1065 of file name.c.

References DNS_NAME_TOREGION, REQUIRE, and VALID_NAME.

Referenced by addoptout(), configure_staticstub_serveraddrs(), configure_staticstub_servernames(), create_node(), digest_sig(), dns_compress_add(), dns_dnssec_sign(), dns_dnssec_verify3(), dns_ds_buildrdata(), dns_message_setsig0key(), dns_nsec_buildrdata(), dns_tsig_sign(), dns_tsig_verify(), dump_rdataset_raw(), fromstruct_afsdb(), fromstruct_ch_a(), fromstruct_cname(), fromstruct_dname(), fromstruct_in_a6(), fromstruct_in_kx(), fromstruct_in_nsap_ptr(), fromstruct_in_px(), fromstruct_in_srv(), fromstruct_ipseckey(), fromstruct_lp(), fromstruct_mb(), fromstruct_md(), fromstruct_mf(), fromstruct_mg(), fromstruct_minfo(), fromstruct_mr(), fromstruct_mx(), fromstruct_naptr(), fromstruct_ns(), fromstruct_nsec(), fromstruct_nxt(), fromstruct_ptr(), fromstruct_rp(), fromstruct_rt(), fromstruct_soa(), incctx_create(), loadctx_create(), name_length(), name_tobuffer(), pushfile(), query_add_cname(), query_keepname(), and spacefortsig().

isc_result_t dns_name_fromwire ( dns_name_t name,
isc_buffer_t source,
dns_decompress_t dctx,
unsigned int  options,
isc_buffer_t target 
)

Copy the possibly-compressed name at source (active region) into target, decompressing it.

Notes:

Security:

Requires:

Ensures:

If result is success:

Result:

Definition at line 1789 of file name.c.

References dns_decompress::allowed, dns_name::attributes, isc_buffer::base, BINDABLE, dns_name::buffer, isc_buffer::current, DNS_COMPRESS_GLOBAL14, DNS_NAME_DOWNCASE, DNS_NAME_MAXWIRE, DNS_NAMEATTR_ABSOLUTE, DNS_R_BADLABELTYPE, DNS_R_BADPOINTER, DNS_R_DISALLOWED, DNS_R_NAMETOOLONG, FATAL_ERROR, fw_newcurrent, fw_ordinary, fw_start, INIT_OFFSETS, isc_buffer_add, isc_buffer_availablelength, isc_buffer_clear, isc_buffer_current, isc_buffer_forward, isc_buffer_used, ISC_BUFFER_VALID, ISC_FALSE, ISC_R_NOSPACE, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, ISC_TF, ISC_TRUE, dns_name::labels, dns_name::length, MAKE_EMPTY, maptolower, dns_name::ndata, REQUIRE, isc_buffer::used, and VALID_NAME.

Referenced by fromwire_afsdb(), fromwire_any_tsig(), fromwire_cdnskey(), fromwire_ch_a(), fromwire_cname(), fromwire_dname(), fromwire_dnskey(), fromwire_hip(), fromwire_in_a6(), fromwire_in_kx(), fromwire_in_nsap_ptr(), fromwire_in_px(), fromwire_in_srv(), fromwire_ipseckey(), fromwire_key(), fromwire_lp(), fromwire_mb(), fromwire_md(), fromwire_mf(), fromwire_mg(), fromwire_minfo(), fromwire_mr(), fromwire_mx(), fromwire_naptr(), fromwire_ns(), fromwire_nsec(), fromwire_nxt(), fromwire_ptr(), fromwire_rp(), fromwire_rrsig(), fromwire_rt(), fromwire_sig(), fromwire_soa(), fromwire_tkey(), getname(), load_raw(), and read_one_rr().

isc_result_t dns_name_towire ( const dns_name_t name,
dns_compress_t cctx,
isc_buffer_t target 
)

Convert 'name' into wire format, compressing it as specified by the compression context 'cctx', and storing the result in 'target'.

Notes:

Requires: Ensures:

If the result is success:

Returns:

Definition at line 1962 of file name.c.

References dns_name::attributes, isc_buffer::base, dns_compress_add(), dns_compress_findglobal(), dns_compress_getmethods(), DNS_COMPRESS_GLOBAL14, dns_name_clone(), DNS_NAME_INIT, DNS_NAMEATTR_NOCOMPRESS, isc_buffer_add, isc_buffer_putuint16, ISC_BUFFER_VALID, ISC_FALSE, ISC_R_NOSPACE, ISC_R_SUCCESS, isc_buffer::length, dns_name::length, methods, dns_name::ndata, dns_name::offsets, REQUIRE, isc_buffer::used, and VALID_NAME.

Referenced by dns_ncache_towire(), towire_afsdb(), towire_any_tsig(), towire_ch_a(), towire_cname(), towire_dname(), towire_in_a6(), towire_in_kx(), towire_in_nsap_ptr(), towire_in_px(), towire_in_srv(), towire_mb(), towire_md(), towire_mf(), towire_mg(), towire_minfo(), towire_mr(), towire_mx(), towire_naptr(), towire_ns(), towire_nsec(), towire_nxt(), towire_ptr(), towire_rp(), towire_rrsig(), towire_rt(), towire_sig(), towire_soa(), towire_tkey(), and towiresorted().

isc_result_t dns_name_fromtext ( dns_name_t name,
isc_buffer_t source,
const dns_name_t origin,
unsigned int  options,
isc_buffer_t target 
)

Convert the textual representation of a DNS name at source into uncompressed wire form stored in target.

Notes:

Requires:

Ensures:

If result is success:

Result:

Definition at line 1077 of file name.c.

References dns_name::attributes, isc_buffer::base, BINDABLE, dns_name::buffer, CONVERTTOASCII, isc_buffer::current, digits, digitvalue, DNS_NAME_DOWNCASE, DNS_NAMEATTR_ABSOLUTE, DNS_R_BADESCAPE, DNS_R_BADLABELTYPE, DNS_R_EMPTYLABEL, DNS_R_LABELTOOLONG, FATAL_ERROR, ft_at, ft_escape, ft_escdecimal, ft_init, ft_initialescape, ft_ordinary, ft_start, INIT_OFFSETS, INSIST, isc_buffer_add, isc_buffer_availablelength, isc_buffer_clear, isc_buffer_forward, isc_buffer_remaininglength, isc_buffer_used, ISC_BUFFER_VALID, ISC_FALSE, ISC_R_NOSPACE, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, ISC_TF, ISC_TRUE, dns_name::labels, dns_name::length, MAKE_EMPTY, maptolower, dns_name::ndata, POST, REQUIRE, isc_buffer::used, and VALID_NAME.

Referenced by add_initial_keys(), add_test_data(), ATF_TC_BODY(), build_name_from_str(), check_dual_stack(), check_keylist(), check_orderent(), check_servers(), check_test_data(), check_trusted_key(), check_update_policy(), check_zoneconf(), configure_alternates(), configure_order(), configure_session_key(), configure_staticstub_servernames(), configure_view_nametable(), configure_zone(), configure_zone_ssutable(), convert_keyname(), disable_algorithms(), disable_ds_digests(), disabled_algorithms(), disabled_ds_digests(), dns64_reverse(), dns_byaddr_createptrname2(), dns_client_setdlv(), dns_dlz_writeablezone(), dns_name_fromstring2(), dns_nsec3_hashname(), dns_peer_setkeybycharp(), dns_sdlz_putnamedrr(), dns_test_makezone(), dns_tkey_processquery(), dns_view_loadnta(), dst_gssapi_acceptctx(), dst_key_read_public(), dstkey_fromconfig(), evaluate_key(), evaluate_zone(), fromtext_afsdb(), fromtext_any_tsig(), fromtext_ch_a(), fromtext_cname(), fromtext_dname(), fromtext_hip(), fromtext_in_a6(), fromtext_in_kx(), fromtext_in_nsap_ptr(), fromtext_in_px(), fromtext_in_srv(), fromtext_ipseckey(), fromtext_lp(), fromtext_mb(), fromtext_md(), fromtext_mf(), fromtext_mg(), fromtext_minfo(), fromtext_mr(), fromtext_mx(), fromtext_naptr(), fromtext_ns(), fromtext_nsec(), fromtext_nxt(), fromtext_ptr(), fromtext_rp(), fromtext_rrsig(), fromtext_rt(), fromtext_sig(), fromtext_soa(), fromtext_tkey(), generate(), getnode(), initname(), ip2name(), load_text(), load_zone(), loadzone(), main(), make_name(), mustbesecure(), ns_config_getipandkeylist(), ns_lwdclient_processgabn(), ns_lwdclient_processgrbn(), ns_lwdmanager_create(), ns_server_changezone(), ns_server_flushnode(), ns_server_nta(), ns_tkeyctx_fromconfig(), on_disable_list(), parse_name(), restore_key(), reverse_from_address(), setup_keystr(), setup_lookup(), setup_master(), setup_text_key(), and stf_from_address().

isc_result_t dns_name_toprincipal ( const dns_name_t name,
isc_buffer_t target 
)

Definition at line 1382 of file name.c.

References DNS_NAME_OMITFINALDOT, and dns_name_totext2().

Referenced by dst_gssapi_identitymatchesrealmkrb5(), and dst_gssapi_identitymatchesrealmms().

isc_result_t dns_name_totext ( const dns_name_t name,
isc_boolean_t  omit_final_dot,
isc_buffer_t target 
)

Definition at line 1371 of file name.c.

References DNS_NAME_MASTERFILE, DNS_NAME_OMITFINALDOT, and dns_name_totext2().

Referenced by add_alias(), byaddr_done(), configure_view(), createiterator(), dns_name_format(), dns_name_print(), dns_name_tostring(), dns_ntatable_save(), dns_sdb_create(), dns_sdlzallowzonexfr(), dns_sdlzfindzone(), dump_rdatasets_text(), emit(), findnodeext(), getnodedata(), lookup_done(), make_log_buf(), ncache_summary(), question_totext(), rdataset_totext(), recvsoa(), start_lookup(), store_realname(), totext_afsdb(), totext_any_tsig(), totext_ch_a(), totext_cname(), totext_dname(), totext_hip(), totext_in_a6(), totext_in_kx(), totext_in_nsap_ptr(), totext_in_px(), totext_in_srv(), totext_ipseckey(), totext_lp(), totext_mb(), totext_md(), totext_mf(), totext_mg(), totext_minfo(), totext_mr(), totext_mx(), totext_naptr(), totext_ns(), totext_nsec(), totext_nxt(), totext_ptr(), totext_rp(), totext_rrsig(), totext_rt(), totext_sig(), totext_soa(), totext_tkey(), zone_name_tostr(), and zone_namerd_tostr().

isc_result_t dns_name_totext2 ( const dns_name_t name,
unsigned int  options,
isc_buffer_t target 
)

Convert 'name' into text format, storing the result in 'target'.

Notes:

Requires:

Ensures:

Returns:

Definition at line 1387 of file name.c.

References CONVERTFROMASCII, DNS_NAME_MASTERFILE, DNS_NAME_OMITFINALDOT, FATAL_ERROR, INSIST, isc_buffer_add, isc_buffer_availablelength, isc_buffer_used, ISC_BUFFER_VALID, ISC_FALSE, ISC_R_NOSPACE, ISC_R_SUCCESS, ISC_TF, isc_thread_key_getspecific, ISC_TRUE, dns_name::labels, dns_name::length, dns_name::ndata, REQUIRE, totext_filter_proc, isc_buffer::used, and VALID_NAME.

Referenced by dns_name_toprincipal(), and dns_name_totext().

isc_result_t dns_name_tofilenametext ( dns_name_t name,
isc_boolean_t  omit_final_dot,
isc_buffer_t target 
)

Convert 'name' into an alternate text format appropriate for filenames, storing the result in 'target'. The name data is downcased, guaranteeing that the filename does not depend on the case of the converted name.

Notes:

Requires:

Ensures:

Returns:

Definition at line 1565 of file name.c.

References dns_name::attributes, CONVERTFROMASCII, DNS_NAMEATTR_ABSOLUTE, FATAL_ERROR, INSIST, isc_buffer_add, isc_buffer_availablelength, isc_buffer_used, ISC_BUFFER_VALID, ISC_FALSE, ISC_R_NOSPACE, ISC_R_SUCCESS, dns_name::labels, dns_name::length, dns_name::ndata, REQUIRE, and VALID_NAME.

Referenced by buildfilename(), dns_dnssec_findmatchingkeys(), loadkeyset(), opendb(), and writeset().

isc_result_t dns_name_downcase ( dns_name_t source,
dns_name_t name,
isc_buffer_t target 
)

Downcase 'source'.

Requires:

Returns: Note: if source == name, then the result will always be ISC_R_SUCCESS.

Definition at line 1675 of file name.c.

References dns_name::attributes, isc_buffer::base, BINDABLE, dns_name::buffer, buffer, DNS_NAMEATTR_ABSOLUTE, DNS_NAMEATTR_READONLY, FATAL_ERROR, INSIST, isc_buffer_add, isc_buffer_clear, isc_buffer_init, ISC_BUFFER_VALID, ISC_R_NOSPACE, ISC_R_SUCCESS, dns_name::labels, isc_buffer::length, dns_name::length, MAKE_EMPTY, maptolower, dns_name::ndata, dns_name::offsets, REQUIRE, set_offsets(), isc_buffer::used, and VALID_NAME.

Referenced by addnsec3(), digest_sig(), dns_dnssec_sign(), dns_dnssec_verify3(), dns_ds_buildrdata(), dns_name_digest(), dns_nsec3_hashname(), dns_nsec3_noexistnodata(), dns_tsigkey_createfromkey(), isdelegation(), and nsec3ify().

isc_result_t dns_name_concatenate ( dns_name_t prefix,
dns_name_t suffix,
dns_name_t name,
isc_buffer_t target 
)

Concatenate 'prefix' and 'suffix'.

Requires:

Ensures:

Returns:

Definition at line 2044 of file name.c.

References dns_name::attributes, isc_buffer::base, BINDABLE, dns_name::buffer, DNS_NAME_INIT, DNS_NAME_MAXWIRE, DNS_NAMEATTR_ABSOLUTE, DNS_R_NAMETOOLONG, INIT_OFFSETS, INSIST, isc_buffer_add, isc_buffer_clear, ISC_BUFFER_VALID, ISC_FALSE, ISC_R_NOSPACE, ISC_R_SUCCESS, ISC_TRUE, dns_name::labels, dns_name::length, isc_buffer::length, MAKE_EMPTY, dns_name::ndata, dns_name::offsets, REQUIRE, set_offsets(), isc_buffer::used, and VALID_NAME.

Referenced by activeempty(), activeemtpynode(), addnowildcardhash(), chain_name(), client_resfind(), dbiterator_current(), dname_target(), dns_dnssec_verify3(), dns_nsec_noexistnodata(), dns_rbt_fullnamefromnode(), dns_rpz_ready(), dns_ssutable_checkrules(), dns_tkey_processquery(), find_closest_nsec(), find_coveringnsec(), find_deepest_zonecut(), find_wildcard(), finddlvsep(), findnsec3proofs(), getnodedata(), lookup_find(), name2data(), ns_lwsearchctx_current(), previous_closest_nsec(), query_addnxrrsetnsec(), query_addwildcardproof(), query_find(), redirect2(), rpz_add_cname(), rpz_get_p_name(), set_target(), setup_lookup(), treefix(), and writeset().

void dns_name_split ( dns_name_t name,
unsigned int  suffixlabels,
dns_name_t prefix,
dns_name_t suffix 
)

Split 'name' into two pieces on a label boundary.

Notes:

Requires: Ensures:

Returns:

Definition at line 2146 of file name.c.

References BINDABLE, dns_name::buffer, dns_name_getlabelsequence(), dns_name::labels, REQUIRE, and VALID_NAME.

Referenced by client_resfind(), dname_target(), dns_dnssec_verify3(), dns_nsec3_noexistnodata(), dns_rbt_addnode(), dns_rbt_findnode(), dns_view_searchdlz(), lookup_find(), nsec3ify(), proveunsecure(), query_addnxrrsetnsec(), query_addwildcardproof(), query_find(), redirect2(), rpz_add_cname(), rpz_rewrite(), and set_target().

isc_result_t dns_name_dup ( const dns_name_t source,
isc_mem_t mctx,
dns_name_t target 
)

Make 'target' a dynamically allocated copy of 'source'.

Requires:

Definition at line 2178 of file name.c.

References dns_name::attributes, BINDABLE, DNS_NAMEATTR_ABSOLUTE, DNS_NAMEATTR_DYNAMIC, isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, dns_name::labels, dns_name::length, MAKE_EMPTY, dns_name::ndata, dns_name::offsets, REQUIRE, set_offsets(), and VALID_NAME.

Referenced by add_rdata_to_list(), addclosest(), addnoqname(), build_event(), client_resfind(), configure_session_key(), convert_keyname(), copy_ptr_targets(), dns_acache_setentry(), dns_acl_merge(), dns_peer_setkeybycharp(), dns_resolver_addalternate(), dns_sdlz_putnamedrr(), dns_ssutable_addrule(), dns_tsig_sign(), dns_tsigkey_createfromkey(), dns_view_adddelegationonly(), dns_view_excludedelegationonly(), dns_zone_setorigin(), fctx_create(), fctx_getaddresses(), findnode(), get_key_struct(), getnode(), getnodedata(), name_duporclone(), new_adblameinfo(), new_adbname(), noanswer_response(), ns_config_getipandkeylist(), ns_lwsearchlist_append(), ns_tkeyctx_fromconfig(), query_add_cname(), query_find(), recvsoa(), resquery_response(), resume_dslookup(), set_addrkeylist(), set_target(), xfrin_create(), zone_notify(), and zone_refreshkeys().

isc_result_t dns_name_dupwithoffsets ( dns_name_t source,
isc_mem_t mctx,
dns_name_t target 
)

Make 'target' a read-only dynamically allocated copy of 'source'. 'target' will also have a dynamically allocated offsets table.

Requires:

Definition at line 2218 of file name.c.

References dns_name::attributes, BINDABLE, DNS_NAMEATTR_ABSOLUTE, DNS_NAMEATTR_DYNAMIC, DNS_NAMEATTR_DYNOFFSETS, DNS_NAMEATTR_READONLY, isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, dns_name::labels, dns_name::length, MAKE_EMPTY, dns_name::ndata, dns_name::offsets, REQUIRE, set_offsets(), and VALID_NAME.

Referenced by dns_ecdb_create(), dns_name_fromstring2(), dns_rbtdb_create(), dns_sdb_create(), and dns_sdlzcreateDBP().

void dns_name_free ( dns_name_t name,
isc_mem_t mctx 
)

Free 'name'.

Requires:

Ensures:

Definition at line 2259 of file name.c.

References dns_name::attributes, dns_name_invalidate(), DNS_NAMEATTR_DYNAMIC, DNS_NAMEATTR_DYNOFFSETS, isc_mem_put, dns_name::labels, dns_name::length, dns_name::ndata, REQUIRE, and VALID_NAME.

Referenced by bevent_destroy(), build_event(), clean_target(), cleanup_session_key(), clear_addresskeylist(), clear_entry(), client_resfind(), destroy(), destroy_ecdb(), destroynode(), dns_client_freeresanswer(), dns_ecdb_create(), dns_message_puttempname(), dns_peer_setkey(), dns_sdb_create(), dns_sdlzcreateDBP(), dns_ssutable_addrule(), dns_tkeyctx_destroy(), dns_tsigkey_createfromkey(), dns_zone_setorigin(), dst_key_free(), fctx_create(), fctx_destroy(), fctx_getaddresses(), free_adblameinfo(), free_adbname(), free_noqname(), free_rbtdb(), freestruct_afsdb(), freestruct_any_tsig(), freestruct_ch_a(), freestruct_cname(), freestruct_dname(), freestruct_in_a6(), freestruct_in_kx(), freestruct_in_nsap_ptr(), freestruct_in_px(), freestruct_in_srv(), freestruct_ipseckey(), freestruct_lp(), freestruct_mb(), freestruct_md(), freestruct_mf(), freestruct_mg(), freestruct_minfo(), freestruct_mr(), freestruct_mx(), freestruct_naptr(), freestruct_ns(), freestruct_nsec(), freestruct_nxt(), freestruct_ptr(), freestruct_rp(), freestruct_rrsig(), freestruct_rt(), freestruct_sig(), freestruct_soa(), freestruct_tkey(), get_key_struct(), keyfetch_done(), levent_destroy(), maybe_free(), msgresetnames(), msgresetsigs(), noanswer_response(), notify_destroy(), ns_config_getipandkeylist(), ns_config_putipandkeylist(), ns_lwsearchlist_detach(), peer_delete(), resquery_response(), resume_dslookup(), rpz_detach(), set_addrkeylist(), shutdown_server(), tostruct_any_tsig(), tostruct_in_px(), tostruct_ipseckey(), tostruct_minfo(), tostruct_nsec(), tostruct_nxt(), tostruct_rp(), tostruct_rrsig(), tostruct_sig(), tostruct_soa(), tostruct_tkey(), tsigkey_free(), update_completed(), xfrin_create(), zone_free(), zone_notify(), and zone_refreshkeys().

isc_result_t dns_name_digest ( dns_name_t name,
dns_digestfunc_t  digest,
void *  arg 
)

Send 'name' in DNSSEC canonical form to 'digest'.

Requires:

Ensures:

Returns:

Definition at line 2277 of file name.c.

References buffer, dns_name_downcase(), DNS_NAME_INIT, isc_buffer_init, isc_buffer_usedregion, ISC_R_SUCCESS, r, REQUIRE, and VALID_NAME.

Referenced by digest_afsdb(), digest_ch_a(), digest_cname(), digest_dname(), digest_in_a6(), digest_in_kx(), digest_in_nsap_ptr(), digest_in_px(), digest_in_srv(), digest_mb(), digest_md(), digest_mf(), digest_mg(), digest_minfo(), digest_mr(), digest_mx(), digest_naptr(), digest_ns(), digest_nxt(), digest_ptr(), digest_rp(), digest_rt(), and digest_soa().

isc_boolean_t dns_name_dynamic ( dns_name_t name  ) 

Returns whether there is dynamic memory associated with this name.

Requires:

Returns:

Definition at line 2309 of file name.c.

References dns_name::attributes, DNS_NAMEATTR_DYNAMIC, ISC_FALSE, ISC_TRUE, REQUIRE, and VALID_NAME.

Referenced by build_event(), cleanup_session_key(), clear_entry(), destroy_ecdb(), destroy_libs(), detachnode(), dns_ecdb_create(), dns_message_puttempname(), dns_ssutable_addrule(), dns_tkeyctx_destroy(), dns_tsigkey_createfromkey(), dns_zone_setorigin(), free_noqname(), free_rbtdb(), freestruct_in_a6(), isc__rdatalist_getclosest(), isc__rdatalist_getnoqname(), levent_destroy(), maybe_free_rbtdb(), msgresetnames(), msgresetsigs(), notify_destroy(), notify_isqueued(), ns_config_getipandkeylist(), ns_config_putipandkeylist(), rpz_detach(), xfrin_create(), zone_free(), zone_name_tostr(), zone_namerd_tostr(), and zone_notify().

isc_result_t dns_name_print ( dns_name_t name,
FILE *  stream 
)

Print 'name' on 'stream'.

Requires:

Returns:

Definition at line 2321 of file name.c.

References isc_region::base, dns_name_totext(), isc_buffer_init, isc_buffer_usedregion, ISC_FALSE, ISC_R_SUCCESS, isc_region::length, r, REQUIRE, and VALID_NAME.

Referenced by serialize_node(), start_lookup(), treefix(), and write_public_key().

void dns_name_format ( const dns_name_t name,
char *  cp,
unsigned int  size 
)

Format 'name' as text appropriate for use in log messages.

Store the formatted name at 'cp', writing no more than 'size' bytes. The resulting string is guaranteed to be null terminated.

The formatted name will have a terminating dot only if it is the root.

This function cannot fail, instead any errors are indicated in the returned text.

Requires:

Definition at line 2387 of file name.c.

References isc_region::base, dns_name_totext(), isc_buffer_init, isc_buffer_usedregion, ISC_R_SUCCESS, ISC_TRUE, isc_region::length, r, and REQUIRE.

Referenced by add_bad(), add_cidr(), addnowildcardhash(), addnsec3(), badname(), build_final_keylist(), cache_name(), check_keylist(), check_mx(), check_no_nsec(), check_no_rrsig(), check_servers(), check_ttls(), check_wildcard(), check_zoneconf(), checkmx(), checkns(), checkqueryacl(), checksrv(), checkupdateacl(), checkwildcard(), client_request(), closeversion(), commit(), configure_forward(), configure_view(), create_empty_zone(), del_name(), del_sigs(), delete_keynames(), deleterdataset(), detachnode(), detailsection(), diff_apply(), dlvfetched(), dname_target(), dns_adb_createfind2(), dns_badcache_print(), dns_dnssec_findzonekeys2(), dns_dnssec_keylistfromrdataset(), dns_dnssec_verify3(), dns_nsec3_noexistnodata(), dns_ntatable_covered(), dns_ntatable_totext(), dns_rbt_formatnodename(), dns_resolver_logfetch(), dns_root_checkhints(), dns_rpz_find_name(), dns_sdlzssumatch(), dns_ssu_external_match(), dns_tsigkey_createfromkey(), dst_gssapi_identitymatchesrealmkrb5(), dst_gssapi_identitymatchesrealmms(), dst_key_format(), dump_key(), expecttofindkey(), fctx_create(), fetch_callback(), finddlvsep(), findname(), findnsec3proofs(), fix_triggers(), followup_lookup(), free_rbtdb(), freezezones(), generate(), get_reverse(), hashlist_add_dns_name(), integrity_checks(), is_answeraddress_allowed(), is_answertarget_allowed(), keyfetch_done(), list_keynames(), load_secroots(), load_text(), loadset(), log_edns(), log_fetch(), log_lame(), log_ns_ttl(), log_query(), log_queryerror(), main(), match_nsec3(), maybe_free_rbtdb(), mkey_dumpzone(), modrdataset(), mustbesecure(), name2ipkey(), newversion(), noanswer_response(), ns_client_aclmsg(), ns_client_dumprecursing(), ns_client_logv(), ns_notify_start(), ns_query(), ns_server_freeze(), ns_server_sync(), ns_server_zonestatus(), ns_stats_dump(), ns_xfr_start(), opendb(), print_dns_name(), printmessage(), printnodename(), printsection(), printsoa(), proveunsecure(), query_find(), recv_done(), recvsoa(), report(), resquery_response(), rpz_getdb(), rpz_log_fail(), rpz_log_rewrite(), rrset_cleanup(), same_question(), say_message(), send_forward_event(), setup_lookup(), sig_format(), signname(), signset(), soa_query(), startfinddlvsep(), totext_cdnskey(), totext_dnskey(), totext_key(), trim_ns_ttl(), tsig_log(), update_action(), update_addordelete(), update_log(), validatezonekey(), validator_logcreate(), validator_logv(), verifynsec(), verifynsec3(), verifyset(), verifyzone(), view_find(), warn_badname(), warn_rfc1918(), xfrout_logv(), zone_check_glue(), zone_check_mx(), zone_check_ns(), zone_check_srv(), zone_postload(), zone_rrset_check_dup(), and zone_xfrdone().

isc_result_t dns_name_tostring ( dns_name_t source,
char **  target,
isc_mem_t mctx 
)

Convert 'name' to string format, allocating sufficient memory to hold it (free with isc_mem_free()).

Differs from dns_name_format in that it allocates its own memory.

Requires:

Returns:

Definition at line 2415 of file name.c.

References isc_region::base, DNS_NAME_FORMATSIZE, dns_name_totext(), isc_buffer_init, isc_buffer_usedregion, ISC_FALSE, isc_mem_allocate, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_region::length, REQUIRE, and VALID_NAME.

Referenced by compare_labelsequences().

isc_result_t dns_name_fromstring ( dns_name_t target,
const char *  src,
unsigned int  options,
isc_mem_t mctx 
)

Definition at line 2445 of file name.c.

References dns_name_fromstring2(), and dns_rootname.

Referenced by check_name(), check_options(), configure_rpz_name(), configure_view(), create_empty_zone(), dns_test_loaddb(), and zone_from_args().

isc_result_t dns_name_fromstring2 ( dns_name_t target,
const char *  src,
const dns_name_t origin,
unsigned int  options,
isc_mem_t mctx 
)

Convert a string to a name and place it in target, allocating memory as necessary. 'options' has the same semantics as that of dns_name_fromtext().

If 'target' has a buffer then the name will be copied into it rather than memory being allocated.

Requires:

Returns:

Definition at line 2452 of file name.c.

References BINDABLE, dns_name::buffer, dns_fixedname_init, dns_fixedname_name, dns_name_dupwithoffsets(), dns_name_fromtext(), isc_buffer_add, isc_buffer_constinit, ISC_R_SUCCESS, name, and REQUIRE.

Referenced by ATF_TC_BODY(), configure_rpz_name2(), dns_name_fromstring(), and next_origin().

isc_result_t dns_name_settotextfilter ( dns_name_totextfilter_t  proc  ) 

Set / clear a thread specific function 'proc' to be called at the end of dns_name_totext().

Note: Under Windows you need to call "dns_name_settotextfilter(NULL);" prior to exiting the thread otherwise memory will be leaked. For other platforms, which are pthreads based, this is still a good idea but not required.

Returns

Definition at line 2344 of file name.c.

References isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_R_UNEXPECTED, isc_thread_key_getspecific, isc_thread_key_setspecific, and totext_filter_proc.

Referenced by destroy_libs(), and setup_lookup().

isc_result_t dns_name_copy ( const dns_name_t source,
dns_name_t dest,
isc_buffer_t target 
)

Makes 'dest' refer to a copy of the name in 'source'. The data are either copied to 'target' or the dedicated buffer in 'dest'.

Requires:

Ensures:

Returns:

Definition at line 2482 of file name.c.

References dns_name::attributes, isc_buffer::base, BINDABLE, dns_name::buffer, DNS_NAMEATTR_ABSOLUTE, isc_buffer_add, isc_buffer_clear, ISC_R_NOSPACE, ISC_R_SUCCESS, dns_name::labels, dns_name::length, isc_buffer::length, dns_name::ndata, dns_name::offsets, REQUIRE, set_offsets(), isc_buffer::used, and VALID_NAME.

Referenced by answer_response(), assignwork(), buildquery(), cache_name(), chain_name(), chase_cnamechain(), client_resfind(), clone_lookup(), clone_results(), configure_zone_ssutable(), copy_name(), dbiterator_current(), dbiterator_origin(), dns_acache_getentry(), dns_adb_createfind2(), dns_badcache_add(), dns_client_startresolve(), dns_client_startupdate(), dns_client_updaterec(), dns_db_createsoatuple(), dns_lookup_create(), dns_nsec3_noexistnodata(), dns_order_add(), dns_rbtnodechain_current(), dns_tkey_processquery(), dns_view_findzonecut2(), dns_view_searchdlz(), find_deepest_zonecut(), finddlvsep(), findext(), findnsec3proofs(), followup_lookup(), foreach_rr(), integrity_checks(), loadkey(), lookup_find(), make_log_buf(), ncache_message(), nsec3ify(), nsecify(), nta_create(), printmessage(), process_soa(), proveunsecure(), query_addwildcardproof(), query_find(), query_findclosestnsec3(), rdataset_totext(), redirect(), redirect2(), resume_dslookup(), rpz_add_cname(), rpz_rrset_find(), rpz_save_p(), setup_delegation(), setup_lookup(), temp_check(), towiresorted(), verify(), verifyzone(), zone_find(), zone_nsec3chain(), zone_sign(), and zone_zonecut_callback().

isc_boolean_t dns_name_ishostname ( const dns_name_t name,
isc_boolean_t  wildcard 
)

Return if 'name' is a valid hostname. RFC 952 / RFC 1123. If 'wildcard' is ISC_TRUE then allow the first label of name to be a wildcard. The root is also accepted.

Requires: 'name' to be valid.

Definition at line 382 of file name.c.

References dns_name::attributes, borderchar, DNS_NAMEATTR_ABSOLUTE, INSIST, ISC_FALSE, ISC_TRUE, dns_name::labels, dns_name::length, middlechar, dns_name::ndata, REQUIRE, and VALID_NAME.

Referenced by checknames_afsdb(), checknames_ch_a(), checknames_in_a6(), checknames_in_srv(), checknames_mx(), checknames_ns(), checknames_ptr(), checknames_rt(), checknames_soa(), checkowner_ch_a(), checkowner_in_a(), checkowner_in_a6(), checkowner_in_aaaa(), checkowner_in_wks(), checkowner_mx(), fromtext_afsdb(), fromtext_ch_a(), fromtext_in_a6(), fromtext_in_srv(), fromtext_mx(), fromtext_ns(), fromtext_ptr(), fromtext_rt(), and fromtext_soa().

isc_boolean_t dns_name_ismailbox ( const dns_name_t name  ) 

Return if 'name' is a valid mailbox. RFC 821.

Requires:

Definition at line 332 of file name.c.

References dns_name::attributes, borderchar, DNS_NAMEATTR_ABSOLUTE, domainchar, INSIST, ISC_FALSE, ISC_TRUE, dns_name::labels, dns_name::length, middlechar, dns_name::ndata, REQUIRE, and VALID_NAME.

Referenced by checknames_minfo(), checknames_rp(), checknames_soa(), checkowner_mb(), checkowner_mg(), fromtext_minfo(), fromtext_rp(), and fromtext_soa().

isc_boolean_t dns_name_internalwildcard ( const dns_name_t name  ) 

Return if 'name' contains a internal wildcard name.

Requires:

Definition at line 447 of file name.c.

References INSIST, ISC_FALSE, ISC_TRUE, dns_name::labels, dns_name::ndata, REQUIRE, and VALID_NAME.

Referenced by check_wildcard(), and update_action().

void dns_name_destroy ( void   ) 

Cleanup dns_name_settotextfilter() / dns_name_totext() state.

This should be called as part of the final cleanup process.

Note: dns_name_settotextfilter(NULL); should be called for all threads which have called dns_name_settotextfilter() with a non-NULL argument prior to calling dns_name_destroy();

Definition at line 2532 of file name.c.

References isc_mem_detach(), isc_once_do, ISC_R_SUCCESS, isc_thread_key_delete, LOCK, once, RUNTIME_CHECK, and UNLOCK.

Referenced by cleanup(), destroy(), destroy_libs(), and main().


Variable Documentation

LIBDNS_EXTERNAL_DATA dns_name_t* dns_rootname

Definition at line 169 of file name.c.

Referenced by add_initial_keys(), add_keydata_zone(), add_soa(), add_test_data(), addrdataset(), allrdatasets(), answer_response(), ATF_TC_BODY(), build_name_from_str(), cache_create_db(), check_dual_stack(), check_hints(), check_keylist(), check_node(), check_options(), check_orderent(), check_servers(), check_test_data(), check_trusted_key(), check_update_policy(), check_zoneconf(), checkowner_opt(), configure_alternates(), configure_order(), configure_rpz_zone(), configure_session_key(), configure_staticstub_servernames(), configure_view(), configure_view_dnsseckeys(), configure_view_nametable(), configure_zone(), configure_zone_ssutable(), convert_keyname(), create_empty_zone(), createview(), dbiterator_origin(), deleterdataset(), disable_algorithms(), disable_ds_digests(), disabled_algorithms(), disabled_ds_digests(), dns64_reverse(), dns_byaddr_createptrname2(), dns_cache_flushnode(), dns_client_clearservers(), dns_client_setdlv(), dns_client_setservers(), dns_dbtable_adddefault(), dns_dlz_writeablezone(), dns_ecdb_create(), dns_message_getsig0(), dns_message_renderend(), dns_name_fromstring(), dns_peer_setkeybycharp(), dns_rbt_deserialize_tree(), dns_rbtnodechain_current(), dns_resolver_prime(), dns_root_checkhints(), dns_rootns_create(), dns_rpz_decode_cname(), dns_rpz_find_ip(), dns_sdb_putrr(), dns_sdlz_putnamedrr(), dns_sdlz_putrr(), dns_test_makezone(), dns_tkey_gssnegotiate(), dns_tkey_processgssresponse(), dns_tkey_processquery(), dns_view_findzonecut2(), dns_view_loadnta(), dst_gssapi_acceptctx(), dst_key_read_public(), dstkey_fromconfig(), evaluate_key(), evaluate_zone(), find(), findrdataset(), fromtext_afsdb(), fromtext_any_tsig(), fromtext_ch_a(), fromtext_cname(), fromtext_dname(), fromtext_hip(), fromtext_in_a6(), fromtext_in_kx(), fromtext_in_nsap_ptr(), fromtext_in_px(), fromtext_in_srv(), fromtext_ipseckey(), fromtext_lp(), fromtext_mb(), fromtext_md(), fromtext_mf(), fromtext_mg(), fromtext_minfo(), fromtext_mr(), fromtext_mx(), fromtext_naptr(), fromtext_ns(), fromtext_nsec(), fromtext_nxt(), fromtext_ptr(), fromtext_rp(), fromtext_rrsig(), fromtext_rt(), fromtext_sig(), fromtext_soa(), fromtext_tkey(), getnode(), getsection(), initname(), insert_soa(), load_zone(), loadzone(), main(), make_name(), mustbesecure(), name2data(), name_prefix(), ncache_summary(), noanswer_response(), notify_find_address(), ns_config_getipandkeylist(), ns_lwdmanager_create(), ns_lwsearchctx_current(), ns_server_changezone(), ns_server_flushnode(), ns_server_nta(), ns_tkeyctx_fromconfig(), on_disable_list(), opendb(), parse_name(), parse_rdata(), proveunsecure(), query_find(), redirect2(), resigned(), restart_find(), restore_key(), reverse_from_address(), rpz_rewrite(), setup_db(), setup_keystr(), setup_lookup(), setup_master(), setup_text_key(), start_update(), stf_from_address(), subtract(), validatezonekey(), validator_start(), writeset(), zone_check_mx(), and zone_check_srv().

LIBDNS_EXTERNAL_DATA dns_name_t* dns_wildcardname

Definition at line 185 of file name.c.

Referenced by addnowildcardhash(), dns_dnssec_verify3(), dns_nsec_noexistnodata(), dns_ssutable_checkrules(), find_wildcard(), findnsec3proofs(), getnodedata(), query_addnxrrsetnsec(), and query_addwildcardproof().


Generated on Tue Apr 28 17:41:09 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha