name.c File Reference

#include <config.h>
#include <ctype.h>
#include <stdlib.h>
#include <isc/buffer.h>
#include <isc/hash.h>
#include <isc/mem.h>
#include <isc/once.h>
#include <isc/print.h>
#include <isc/string.h>
#include <isc/thread.h>
#include <isc/util.h>
#include <dns/compress.h>
#include <dns/fixedname.h>
#include <dns/name.h>
#include <dns/result.h>

Go to the source code of this file.

Defines

#define VALID_NAME(n)   ISC_MAGIC_VALID(n, DNS_NAME_MAGIC)
#define CONVERTTOASCII(c)
#define CONVERTFROMASCII(c)
#define INIT_OFFSETS(name, var, default)
#define SETUP_OFFSETS(name, var, default)
#define MAKE_EMPTY(name)
 Note: If additional attributes are added that should not be set for empty names, MAKE_EMPTY() must be changed so it clears them.
#define BINDABLE(name)
 A name is "bindable" if it can be set to point to a new value, i.e. name->ndata and name->length may be changed.
#define hyphenchar(c)   ((c) == 0x2d)
#define asterchar(c)   ((c) == 0x2a)
#define alphachar(c)
#define digitchar(c)   ((c) >= 0x30 && (c) <= 0x39)
#define borderchar(c)   (alphachar(c) || digitchar(c))
#define middlechar(c)   (borderchar(c) || hyphenchar(c))
#define domainchar(c)   ((c) > 0x20 && (c) < 0x7f)

Enumerations

enum  ft_state {
  ft_init = 0, ft_start, ft_ordinary, ft_initialescape,
  ft_escape, ft_escdecimal, ft_at
}
enum  fw_state { fw_start = 0, fw_ordinary, fw_newcurrent }

Functions

unsigned int dns_fullname_hash (dns_name_t *name, isc_boolean_t case_sensitive)
static void set_offsets (const dns_name_t *name, unsigned char *offsets, dns_name_t *set_name)
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_ismailbox (const dns_name_t *name)
 Return if 'name' is a valid mailbox. RFC 821.
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_iswildcard (const dns_name_t *name)
 Is 'name' a wildcard name?
isc_boolean_t dns_name_internalwildcard (const dns_name_t *name)
 Return if 'name' contains a internal wildcard name.
static unsigned int name_hash (dns_name_t *name, isc_boolean_t case_sensitive)
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_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_totext (const dns_name_t *name, isc_boolean_t omit_final_dot, isc_buffer_t *target)
isc_result_t dns_name_toprincipal (const dns_name_t *name, 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_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_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'.
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().
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 *name, 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_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'.
void dns_name_destroy (void)
 Cleanup dns_name_settotextfilter() / dns_name_totext() state.

Variables

static char digitvalue [256]
static unsigned char maptolower []
static unsigned char root_ndata [] = { '\0' }
 Note that the name data must be a char array, not a string literal, to avoid compiler warnings about discarding the const attribute of a string.
static unsigned char root_offsets [] = { 0 }
static dns_name_t root
LIBDNS_EXTERNAL_DATA dns_name_tdns_rootname = &root
static unsigned char wild_ndata [] = { '\001', '*' }
static unsigned char wild_offsets [] = { 0 }
static dns_name_t wild
LIBDNS_EXTERNAL_DATA dns_name_tdns_wildcardname = &wild
static dns_name_totextfilter_t totext_filter_proc = NULL


Detailed Description

Definition in file name.c.


Define Documentation

#define VALID_NAME (  )     ISC_MAGIC_VALID(n, DNS_NAME_MAGIC)

Definition at line 41 of file name.c.

Referenced by dns_fullname_hash(), dns_name_caseequal(), dns_name_clone(), dns_name_concatenate(), dns_name_copy(), dns_name_countlabels(), dns_name_digest(), dns_name_downcase(), dns_name_dup(), dns_name_dupwithoffsets(), dns_name_dynamic(), dns_name_equal(), dns_name_free(), dns_name_fromregion(), dns_name_fromtext(), dns_name_fromwire(), dns_name_fullcompare(), dns_name_fullhash(), dns_name_getlabel(), dns_name_getlabelsequence(), dns_name_hasbuffer(), dns_name_hash(), dns_name_hashbylabel(), dns_name_internalwildcard(), dns_name_invalidate(), dns_name_isabsolute(), dns_name_ishostname(), dns_name_ismailbox(), dns_name_isvalid(), dns_name_iswildcard(), dns_name_matcheswildcard(), dns_name_print(), dns_name_rdatacompare(), dns_name_reset(), dns_name_setbuffer(), dns_name_split(), dns_name_tofilenametext(), dns_name_toregion(), dns_name_tostring(), dns_name_totext2(), and dns_name_towire().

#define CONVERTTOASCII (  ) 

Definition at line 113 of file name.c.

Referenced by dns_name_fromtext().

#define CONVERTFROMASCII (  ) 

Definition at line 114 of file name.c.

Referenced by dns_name_tofilenametext(), and dns_name_totext2().

#define INIT_OFFSETS ( name,
var,
default   ) 

Value:

if (name->offsets != NULL) \
                var = name->offsets; \
        else \
                var = default;

Definition at line 116 of file name.c.

Referenced by dns_name_concatenate(), dns_name_fromregion(), dns_name_fromtext(), and dns_name_fromwire().

#define SETUP_OFFSETS ( name,
var,
default   ) 

Value:

if (name->offsets != NULL) \
                var = name->offsets; \
        else { \
                var = default; \
                set_offsets(name, var, NULL); \
        }

Definition at line 122 of file name.c.

Referenced by dns_name_fullcompare(), dns_name_getlabel(), dns_name_getlabelsequence(), and dns_name_hashbylabel().

#define MAKE_EMPTY ( name   ) 

Value:

do { \
        name->ndata = NULL; \
        name->length = 0; \
        name->labels = 0; \
        name->attributes &= ~DNS_NAMEATTR_ABSOLUTE; \
} while (0);
Note: If additional attributes are added that should not be set for empty names, MAKE_EMPTY() must be changed so it clears them.

Definition at line 134 of file name.c.

Referenced by dns_name_concatenate(), dns_name_downcase(), dns_name_dup(), dns_name_dupwithoffsets(), dns_name_fromtext(), and dns_name_fromwire().

#define BINDABLE ( name   ) 

Value:

A name is "bindable" if it can be set to point to a new value, i.e. name->ndata and name->length may be changed.

Definition at line 146 of file name.c.

Referenced by dns_name_clone(), dns_name_concatenate(), dns_name_copy(), dns_name_downcase(), dns_name_dup(), dns_name_dupwithoffsets(), dns_name_fromregion(), dns_name_fromstring2(), dns_name_fromtext(), dns_name_fromwire(), dns_name_getlabelsequence(), dns_name_reset(), and dns_name_split().

#define hyphenchar (  )     ((c) == 0x2d)

Definition at line 322 of file name.c.

#define asterchar (  )     ((c) == 0x2a)

Definition at line 323 of file name.c.

#define alphachar (  ) 

Value:

(((c) >= 0x41 && (c) <= 0x5a) \
                      || ((c) >= 0x61 && (c) <= 0x7a))

Definition at line 324 of file name.c.

#define digitchar (  )     ((c) >= 0x30 && (c) <= 0x39)

Definition at line 326 of file name.c.

#define borderchar (  )     (alphachar(c) || digitchar(c))

Definition at line 327 of file name.c.

Referenced by dns_name_ishostname(), and dns_name_ismailbox().

#define middlechar (  )     (borderchar(c) || hyphenchar(c))

Definition at line 328 of file name.c.

Referenced by dns_name_ishostname(), and dns_name_ismailbox().

#define domainchar (  )     ((c) > 0x20 && (c) < 0x7f)

Definition at line 329 of file name.c.

Referenced by dns_name_ismailbox().


Enumeration Type Documentation

enum ft_state

Enumerator:
ft_init 
ft_start 
ft_ordinary 
ft_initialescape 
ft_escape 
ft_escdecimal 
ft_at 

Definition at line 43 of file name.c.

enum fw_state

Enumerator:
fw_start 
fw_ordinary 
fw_newcurrent 

Definition at line 53 of file name.c.


Function Documentation

unsigned int dns_fullname_hash ( dns_name_t name,
isc_boolean_t  case_sensitive 
)

Definition at line 543 of file name.c.

References dns_name_fullhash(), REQUIRE, and VALID_NAME.

static void set_offsets ( const dns_name_t name,
unsigned char *  offsets,
dns_name_t set_name 
) [static]

Definition at line 1748 of file name.c.

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

Referenced by dns_name_clone(), dns_name_concatenate(), dns_name_copy(), dns_name_downcase(), dns_name_dup(), dns_name_dupwithoffsets(), dns_name_fromregion(), and dns_name_getlabelsequence().

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_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_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_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().

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().

static unsigned int name_hash ( dns_name_t name,
isc_boolean_t  case_sensitive 
) [inline, static]

Definition at line 482 of file name.c.

References dns_name::length, maptolower, dns_name::ndata, and s.

Referenced by dns_name_hash(), and dns_name_hashbylabel().

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_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_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_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_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_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_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().

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().

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_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().

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

char digitvalue[256] [static]

Initial value:

 {
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
         0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1, 
        -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
        -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
}

Definition at line 59 of file name.c.

Referenced by dns_name_fromtext().

unsigned char maptolower[] [static]

Definition at line 78 of file name.c.

unsigned char root_ndata[] = { '\0' } [static]

Note that the name data must be a char array, not a string literal, to avoid compiler warnings about discarding the const attribute of a string.

Definition at line 155 of file name.c.

unsigned char root_offsets[] = { 0 } [static]

Definition at line 156 of file name.c.

dns_name_t root [static]

Initial value:

{
        DNS_NAME_MAGIC,
        root_ndata, 1, 1,
        DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE,
        root_offsets, NULL,
        {(void *)-1, (void *)-1},
        {NULL, NULL}
}

Definition at line 158 of file name.c.

Referenced by addonlevel(), check_zoneconf(), dns_rbt_addnode(), and get_upper_node().

LIBDNS_EXTERNAL_DATA dns_name_t* dns_rootname = &root

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().

unsigned char wild_ndata[] = { '\001', '*' } [static]

Definition at line 171 of file name.c.

unsigned char wild_offsets[] = { 0 } [static]

Definition at line 172 of file name.c.

dns_name_t wild [static]

Initial value:

{
        DNS_NAME_MAGIC,
        wild_ndata, 2, 1,
        DNS_NAMEATTR_READONLY,
        wild_offsets, NULL,
        {(void *)-1, (void *)-1},
        {NULL, NULL}
}

Definition at line 174 of file name.c.

Referenced by addnowildcardhash(), authvalidated(), cfg_parse_rawaddr(), checkwildcard(), find_wildcard(), getnodedata(), verify(), and zone_find().

LIBDNS_EXTERNAL_DATA dns_name_t* dns_wildcardname = &wild

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().

dns_name_totextfilter_t totext_filter_proc = NULL [static]

Definition at line 200 of file name.c.

Referenced by dns_name_settotextfilter(), and dns_name_totext2().


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