Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/bind9/dns
File: name.h
/*
[0] Fix | Delete
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
[1] Fix | Delete
*
[2] Fix | Delete
* This Source Code Form is subject to the terms of the Mozilla Public
[3] Fix | Delete
* License, v. 2.0. If a copy of the MPL was not distributed with this
[4] Fix | Delete
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
[5] Fix | Delete
*
[6] Fix | Delete
* See the COPYRIGHT file distributed with this work for additional
[7] Fix | Delete
* information regarding copyright ownership.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
[11] Fix | Delete
#ifndef DNS_NAME_H
[12] Fix | Delete
#define DNS_NAME_H 1
[13] Fix | Delete
[14] Fix | Delete
/*****
[15] Fix | Delete
***** Module Info
[16] Fix | Delete
*****/
[17] Fix | Delete
[18] Fix | Delete
/*! \file dns/name.h
[19] Fix | Delete
* \brief
[20] Fix | Delete
* Provides facilities for manipulating DNS names and labels, including
[21] Fix | Delete
* conversions to and from wire format and text format.
[22] Fix | Delete
*
[23] Fix | Delete
* Given the large number of names possible in a nameserver, and because
[24] Fix | Delete
* names occur in rdata, it was important to come up with a very efficient
[25] Fix | Delete
* way of storing name data, but at the same time allow names to be
[26] Fix | Delete
* manipulated. The decision was to store names in uncompressed wire format,
[27] Fix | Delete
* and not to make them fully abstracted objects; i.e. certain parts of the
[28] Fix | Delete
* server know names are stored that way. This saves a lot of memory, and
[29] Fix | Delete
* makes adding names to messages easy. Having much of the server know
[30] Fix | Delete
* the representation would be perilous, and we certainly don't want each
[31] Fix | Delete
* user of names to be manipulating such a low-level structure. This is
[32] Fix | Delete
* where the Names and Labels module comes in. The module allows name or
[33] Fix | Delete
* label handles to be created and attached to uncompressed wire format
[34] Fix | Delete
* regions. All name operations and conversions are done through these
[35] Fix | Delete
* handles.
[36] Fix | Delete
*
[37] Fix | Delete
* MP:
[38] Fix | Delete
*\li Clients of this module must impose any required synchronization.
[39] Fix | Delete
*
[40] Fix | Delete
* Reliability:
[41] Fix | Delete
*\li This module deals with low-level byte streams. Errors in any of
[42] Fix | Delete
* the functions are likely to crash the server or corrupt memory.
[43] Fix | Delete
*
[44] Fix | Delete
* Resources:
[45] Fix | Delete
*\li None.
[46] Fix | Delete
*
[47] Fix | Delete
* Security:
[48] Fix | Delete
*
[49] Fix | Delete
*\li *** WARNING ***
[50] Fix | Delete
*
[51] Fix | Delete
*\li dns_name_fromwire() deals with raw network data. An error in
[52] Fix | Delete
* this routine could result in the failure or hijacking of the server.
[53] Fix | Delete
*
[54] Fix | Delete
* Standards:
[55] Fix | Delete
*\li RFC1035
[56] Fix | Delete
*\li Draft EDNS0 (0)
[57] Fix | Delete
*\li Draft Binary Labels (2)
[58] Fix | Delete
*
[59] Fix | Delete
*/
[60] Fix | Delete
[61] Fix | Delete
/***
[62] Fix | Delete
*** Imports
[63] Fix | Delete
***/
[64] Fix | Delete
[65] Fix | Delete
#include <stdio.h>
[66] Fix | Delete
#include <inttypes.h>
[67] Fix | Delete
#include <stdbool.h>
[68] Fix | Delete
[69] Fix | Delete
#include <isc/ht.h>
[70] Fix | Delete
#include <isc/lang.h>
[71] Fix | Delete
#include <isc/magic.h>
[72] Fix | Delete
#include <isc/region.h> /* Required for storage size of dns_label_t. */
[73] Fix | Delete
[74] Fix | Delete
#include <dns/types.h>
[75] Fix | Delete
[76] Fix | Delete
ISC_LANG_BEGINDECLS
[77] Fix | Delete
[78] Fix | Delete
/*****
[79] Fix | Delete
***** Labels
[80] Fix | Delete
*****
[81] Fix | Delete
***** A 'label' is basically a region. It contains one DNS wire format
[82] Fix | Delete
***** label of type 00 (ordinary).
[83] Fix | Delete
*****/
[84] Fix | Delete
[85] Fix | Delete
/*****
[86] Fix | Delete
***** Names
[87] Fix | Delete
*****
[88] Fix | Delete
***** A 'name' is a handle to a binary region. It contains a sequence of one
[89] Fix | Delete
***** or more DNS wire format labels of type 00 (ordinary).
[90] Fix | Delete
***** Note that all names are not required to end with the root label,
[91] Fix | Delete
***** as they are in the actual DNS wire protocol.
[92] Fix | Delete
*****/
[93] Fix | Delete
[94] Fix | Delete
/***
[95] Fix | Delete
*** Types
[96] Fix | Delete
***/
[97] Fix | Delete
[98] Fix | Delete
/*%
[99] Fix | Delete
* Clients are strongly discouraged from using this type directly, with
[100] Fix | Delete
* the exception of the 'link' and 'list' fields which may be used directly
[101] Fix | Delete
* for whatever purpose the client desires.
[102] Fix | Delete
*/
[103] Fix | Delete
struct dns_name {
[104] Fix | Delete
unsigned int magic;
[105] Fix | Delete
unsigned char * ndata;
[106] Fix | Delete
unsigned int length;
[107] Fix | Delete
unsigned int labels;
[108] Fix | Delete
unsigned int attributes;
[109] Fix | Delete
unsigned char * offsets;
[110] Fix | Delete
isc_buffer_t * buffer;
[111] Fix | Delete
ISC_LINK(dns_name_t) link;
[112] Fix | Delete
ISC_LIST(dns_rdataset_t) list;
[113] Fix | Delete
isc_ht_t *ht;
[114] Fix | Delete
};
[115] Fix | Delete
[116] Fix | Delete
#define DNS_NAME_MAGIC ISC_MAGIC('D','N','S','n')
[117] Fix | Delete
[118] Fix | Delete
#define DNS_NAMEATTR_ABSOLUTE 0x00000001
[119] Fix | Delete
#define DNS_NAMEATTR_READONLY 0x00000002
[120] Fix | Delete
#define DNS_NAMEATTR_DYNAMIC 0x00000004
[121] Fix | Delete
#define DNS_NAMEATTR_DYNOFFSETS 0x00000008
[122] Fix | Delete
#define DNS_NAMEATTR_NOCOMPRESS 0x00000010
[123] Fix | Delete
/*
[124] Fix | Delete
* Attributes below 0x0100 reserved for name.c usage.
[125] Fix | Delete
*/
[126] Fix | Delete
#define DNS_NAMEATTR_CACHE 0x00000100 /*%< Used by resolver. */
[127] Fix | Delete
#define DNS_NAMEATTR_ANSWER 0x00000200 /*%< Used by resolver. */
[128] Fix | Delete
#define DNS_NAMEATTR_NCACHE 0x00000400 /*%< Used by resolver. */
[129] Fix | Delete
#define DNS_NAMEATTR_CHAINING 0x00000800 /*%< Used by resolver. */
[130] Fix | Delete
#define DNS_NAMEATTR_CHASE 0x00001000 /*%< Used by resolver. */
[131] Fix | Delete
#define DNS_NAMEATTR_WILDCARD 0x00002000 /*%< Used by server. */
[132] Fix | Delete
#define DNS_NAMEATTR_PREREQUISITE 0x00004000 /*%< Used by client. */
[133] Fix | Delete
#define DNS_NAMEATTR_UPDATE 0x00008000 /*%< Used by client. */
[134] Fix | Delete
#define DNS_NAMEATTR_HASUPDATEREC 0x00010000 /*%< Used by client. */
[135] Fix | Delete
[136] Fix | Delete
/*
[137] Fix | Delete
* Various flags.
[138] Fix | Delete
*/
[139] Fix | Delete
#define DNS_NAME_DOWNCASE 0x0001
[140] Fix | Delete
#define DNS_NAME_CHECKNAMES 0x0002 /*%< Used by rdata. */
[141] Fix | Delete
#define DNS_NAME_CHECKNAMESFAIL 0x0004 /*%< Used by rdata. */
[142] Fix | Delete
#define DNS_NAME_CHECKREVERSE 0x0008 /*%< Used by rdata. */
[143] Fix | Delete
#define DNS_NAME_CHECKMX 0x0010 /*%< Used by rdata. */
[144] Fix | Delete
#define DNS_NAME_CHECKMXFAIL 0x0020 /*%< Used by rdata. */
[145] Fix | Delete
[146] Fix | Delete
LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_rootname;
[147] Fix | Delete
LIBDNS_EXTERNAL_DATA extern dns_name_t *dns_wildcardname;
[148] Fix | Delete
[149] Fix | Delete
/*%<
[150] Fix | Delete
* DNS_NAME_INITNONABSOLUTE and DNS_NAME_INITABSOLUTE are macros for
[151] Fix | Delete
* initializing dns_name_t structures.
[152] Fix | Delete
*
[153] Fix | Delete
* Note[1]: 'length' is set to (sizeof(A) - 1) in DNS_NAME_INITNONABSOLUTE
[154] Fix | Delete
* and sizeof(A) in DNS_NAME_INITABSOLUTE to allow C strings to be used
[155] Fix | Delete
* to initialize 'ndata'.
[156] Fix | Delete
*
[157] Fix | Delete
* Note[2]: The final value of offsets for DNS_NAME_INITABSOLUTE should
[158] Fix | Delete
* match (sizeof(A) - 1) which is the offset of the root label.
[159] Fix | Delete
*
[160] Fix | Delete
* Typical usage:
[161] Fix | Delete
* unsigned char data[] = "\005value";
[162] Fix | Delete
* unsigned char offsets[] = { 0 };
[163] Fix | Delete
* dns_name_t value = DNS_NAME_INITNONABSOLUTE(data, offsets);
[164] Fix | Delete
*
[165] Fix | Delete
* unsigned char data[] = "\005value";
[166] Fix | Delete
* unsigned char offsets[] = { 0, 6 };
[167] Fix | Delete
* dns_name_t value = DNS_NAME_INITABSOLUTE(data, offsets);
[168] Fix | Delete
*/
[169] Fix | Delete
#define DNS_NAME_INITNONABSOLUTE(A,B) { \
[170] Fix | Delete
DNS_NAME_MAGIC, \
[171] Fix | Delete
A, (sizeof(A) - 1), sizeof(B), \
[172] Fix | Delete
DNS_NAMEATTR_READONLY, \
[173] Fix | Delete
B, NULL, { (void *)-1, (void *)-1}, \
[174] Fix | Delete
{NULL, NULL}, NULL \
[175] Fix | Delete
}
[176] Fix | Delete
[177] Fix | Delete
#define DNS_NAME_INITABSOLUTE(A,B) { \
[178] Fix | Delete
DNS_NAME_MAGIC, \
[179] Fix | Delete
A, sizeof(A), sizeof(B), \
[180] Fix | Delete
DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, \
[181] Fix | Delete
B, NULL, { (void *)-1, (void *)-1}, \
[182] Fix | Delete
{NULL, NULL}, NULL \
[183] Fix | Delete
}
[184] Fix | Delete
[185] Fix | Delete
#define DNS_NAME_INITEMPTY { \
[186] Fix | Delete
DNS_NAME_MAGIC, NULL, 0, 0, 0, NULL, NULL, \
[187] Fix | Delete
{ (void *)-1, (void *)-1 }, { NULL, NULL }, NULL \
[188] Fix | Delete
}
[189] Fix | Delete
[190] Fix | Delete
/*%
[191] Fix | Delete
* Standard size of a wire format name
[192] Fix | Delete
*/
[193] Fix | Delete
#define DNS_NAME_MAXWIRE 255
[194] Fix | Delete
[195] Fix | Delete
/*
[196] Fix | Delete
* Text output filter procedure.
[197] Fix | Delete
* 'target' is the buffer to be converted. The region to be converted
[198] Fix | Delete
* is from 'buffer'->base + 'used_org' to the end of the used region.
[199] Fix | Delete
*/
[200] Fix | Delete
typedef isc_result_t (*dns_name_totextfilter_t)(isc_buffer_t *target,
[201] Fix | Delete
unsigned int used_org,
[202] Fix | Delete
bool absolute);
[203] Fix | Delete
[204] Fix | Delete
/***
[205] Fix | Delete
*** Initialization
[206] Fix | Delete
***/
[207] Fix | Delete
[208] Fix | Delete
void
[209] Fix | Delete
dns_name_init(dns_name_t *name, unsigned char *offsets);
[210] Fix | Delete
/*%<
[211] Fix | Delete
* Initialize 'name'.
[212] Fix | Delete
*
[213] Fix | Delete
* Notes:
[214] Fix | Delete
* \li 'offsets' is never required to be non-NULL, but specifying a
[215] Fix | Delete
* dns_offsets_t for 'offsets' will improve the performance of most
[216] Fix | Delete
* name operations if the name is used more than once.
[217] Fix | Delete
*
[218] Fix | Delete
* Requires:
[219] Fix | Delete
* \li 'name' is not NULL and points to a struct dns_name.
[220] Fix | Delete
*
[221] Fix | Delete
* \li offsets == NULL or offsets is a dns_offsets_t.
[222] Fix | Delete
*
[223] Fix | Delete
* Ensures:
[224] Fix | Delete
* \li 'name' is a valid name.
[225] Fix | Delete
* \li dns_name_countlabels(name) == 0
[226] Fix | Delete
* \li dns_name_isabsolute(name) == false
[227] Fix | Delete
*/
[228] Fix | Delete
[229] Fix | Delete
void
[230] Fix | Delete
dns_name_reset(dns_name_t *name);
[231] Fix | Delete
/*%<
[232] Fix | Delete
* Reinitialize 'name'.
[233] Fix | Delete
*
[234] Fix | Delete
* Notes:
[235] Fix | Delete
* \li This function distinguishes itself from dns_name_init() in two
[236] Fix | Delete
* key ways:
[237] Fix | Delete
*
[238] Fix | Delete
* \li + If any buffer is associated with 'name' (via dns_name_setbuffer()
[239] Fix | Delete
* or by being part of a dns_fixedname_t) the link to the buffer
[240] Fix | Delete
* is retained but the buffer itself is cleared.
[241] Fix | Delete
*
[242] Fix | Delete
* \li + Of the attributes associated with 'name', all are retained except
[243] Fix | Delete
* DNS_NAMEATTR_ABSOLUTE.
[244] Fix | Delete
*
[245] Fix | Delete
* Requires:
[246] Fix | Delete
* \li 'name' is a valid name.
[247] Fix | Delete
*
[248] Fix | Delete
* Ensures:
[249] Fix | Delete
* \li 'name' is a valid name.
[250] Fix | Delete
* \li dns_name_countlabels(name) == 0
[251] Fix | Delete
* \li dns_name_isabsolute(name) == false
[252] Fix | Delete
*/
[253] Fix | Delete
[254] Fix | Delete
void
[255] Fix | Delete
dns_name_invalidate(dns_name_t *name);
[256] Fix | Delete
/*%<
[257] Fix | Delete
* Make 'name' invalid.
[258] Fix | Delete
*
[259] Fix | Delete
* Requires:
[260] Fix | Delete
* \li 'name' is a valid name.
[261] Fix | Delete
*
[262] Fix | Delete
* Ensures:
[263] Fix | Delete
* \li If assertion checking is enabled, future attempts to use 'name'
[264] Fix | Delete
* without initializing it will cause an assertion failure.
[265] Fix | Delete
*
[266] Fix | Delete
* \li If the name had a dedicated buffer, that association is ended.
[267] Fix | Delete
*/
[268] Fix | Delete
[269] Fix | Delete
bool
[270] Fix | Delete
dns_name_isvalid(const dns_name_t *name);
[271] Fix | Delete
/*%<
[272] Fix | Delete
* Check whether 'name' points to a valid dns_name
[273] Fix | Delete
*/
[274] Fix | Delete
[275] Fix | Delete
/***
[276] Fix | Delete
*** Dedicated Buffers
[277] Fix | Delete
***/
[278] Fix | Delete
[279] Fix | Delete
void
[280] Fix | Delete
dns_name_setbuffer(dns_name_t *name, isc_buffer_t *buffer);
[281] Fix | Delete
/*%<
[282] Fix | Delete
* Dedicate a buffer for use with 'name'.
[283] Fix | Delete
*
[284] Fix | Delete
* Notes:
[285] Fix | Delete
* \li Specification of a target buffer in dns_name_fromwire(),
[286] Fix | Delete
* dns_name_fromtext(), and dns_name_concatenate() is optional if
[287] Fix | Delete
* 'name' has a dedicated buffer.
[288] Fix | Delete
*
[289] Fix | Delete
* \li The caller must not write to buffer until the name has been
[290] Fix | Delete
* invalidated or is otherwise known not to be in use.
[291] Fix | Delete
*
[292] Fix | Delete
* \li If buffer is NULL and the name previously had a dedicated buffer,
[293] Fix | Delete
* than that buffer is no longer dedicated to use with this name.
[294] Fix | Delete
* The caller is responsible for ensuring that the storage used by
[295] Fix | Delete
* the name remains valid.
[296] Fix | Delete
*
[297] Fix | Delete
* Requires:
[298] Fix | Delete
* \li 'name' is a valid name.
[299] Fix | Delete
*
[300] Fix | Delete
* \li 'buffer' is a valid binary buffer and 'name' doesn't have a
[301] Fix | Delete
* dedicated buffer already, or 'buffer' is NULL.
[302] Fix | Delete
*/
[303] Fix | Delete
[304] Fix | Delete
bool
[305] Fix | Delete
dns_name_hasbuffer(const dns_name_t *name);
[306] Fix | Delete
/*%<
[307] Fix | Delete
* Does 'name' have a dedicated buffer?
[308] Fix | Delete
*
[309] Fix | Delete
* Requires:
[310] Fix | Delete
* \li 'name' is a valid name.
[311] Fix | Delete
*
[312] Fix | Delete
* Returns:
[313] Fix | Delete
* \li true 'name' has a dedicated buffer.
[314] Fix | Delete
* \li false 'name' does not have a dedicated buffer.
[315] Fix | Delete
*/
[316] Fix | Delete
[317] Fix | Delete
/***
[318] Fix | Delete
*** Properties
[319] Fix | Delete
***/
[320] Fix | Delete
[321] Fix | Delete
bool
[322] Fix | Delete
dns_name_isabsolute(const dns_name_t *name);
[323] Fix | Delete
/*%<
[324] Fix | Delete
* Does 'name' end in the root label?
[325] Fix | Delete
*
[326] Fix | Delete
* Requires:
[327] Fix | Delete
* \li 'name' is a valid name
[328] Fix | Delete
*
[329] Fix | Delete
* Returns:
[330] Fix | Delete
* \li TRUE The last label in 'name' is the root label.
[331] Fix | Delete
* \li FALSE The last label in 'name' is not the root label.
[332] Fix | Delete
*/
[333] Fix | Delete
[334] Fix | Delete
bool
[335] Fix | Delete
dns_name_iswildcard(const dns_name_t *name);
[336] Fix | Delete
/*%<
[337] Fix | Delete
* Is 'name' a wildcard name?
[338] Fix | Delete
*
[339] Fix | Delete
* Requires:
[340] Fix | Delete
* \li 'name' is a valid name
[341] Fix | Delete
*
[342] Fix | Delete
* \li dns_name_countlabels(name) > 0
[343] Fix | Delete
*
[344] Fix | Delete
* Returns:
[345] Fix | Delete
* \li TRUE The least significant label of 'name' is '*'.
[346] Fix | Delete
* \li FALSE The least significant label of 'name' is not '*'.
[347] Fix | Delete
*/
[348] Fix | Delete
[349] Fix | Delete
unsigned int
[350] Fix | Delete
dns_name_hash(dns_name_t *name, bool case_sensitive);
[351] Fix | Delete
/*%<
[352] Fix | Delete
* Provide a hash value for 'name'.
[353] Fix | Delete
*
[354] Fix | Delete
* Note: if 'case_sensitive' is false, then names which differ only in
[355] Fix | Delete
* case will have the same hash value.
[356] Fix | Delete
*
[357] Fix | Delete
* Requires:
[358] Fix | Delete
* \li 'name' is a valid name
[359] Fix | Delete
*
[360] Fix | Delete
* Returns:
[361] Fix | Delete
* \li A hash value
[362] Fix | Delete
*/
[363] Fix | Delete
[364] Fix | Delete
unsigned int
[365] Fix | Delete
dns_name_fullhash(dns_name_t *name, bool case_sensitive);
[366] Fix | Delete
/*%<
[367] Fix | Delete
* Provide a hash value for 'name'. Unlike dns_name_hash(), this function
[368] Fix | Delete
* always takes into account of the entire name to calculate the hash value.
[369] Fix | Delete
*
[370] Fix | Delete
* Note: if 'case_sensitive' is false, then names which differ only in
[371] Fix | Delete
* case will have the same hash value.
[372] Fix | Delete
*
[373] Fix | Delete
* Requires:
[374] Fix | Delete
*\li 'name' is a valid name
[375] Fix | Delete
*
[376] Fix | Delete
* Returns:
[377] Fix | Delete
*\li A hash value
[378] Fix | Delete
*/
[379] Fix | Delete
[380] Fix | Delete
unsigned int
[381] Fix | Delete
dns_name_hashbylabel(dns_name_t *name, bool case_sensitive);
[382] Fix | Delete
/*%<
[383] Fix | Delete
* Provide a hash value for 'name', where the hash value is the sum
[384] Fix | Delete
* of the hash values of each label. This function should only be used
[385] Fix | Delete
* when incremental hashing is necessary, for example, during RBT
[386] Fix | Delete
* traversal. It is not currently used in BIND. Generally,
[387] Fix | Delete
* dns_name_fullhash() is the correct function to use for name
[388] Fix | Delete
* hashing.
[389] Fix | Delete
*
[390] Fix | Delete
* Note: if 'case_sensitive' is false, then names which differ only in
[391] Fix | Delete
* case will have the same hash value.
[392] Fix | Delete
*
[393] Fix | Delete
* Requires:
[394] Fix | Delete
*\li 'name' is a valid name
[395] Fix | Delete
*
[396] Fix | Delete
* Returns:
[397] Fix | Delete
*\li A hash value
[398] Fix | Delete
*/
[399] Fix | Delete
[400] Fix | Delete
/*
[401] Fix | Delete
*** Comparisons
[402] Fix | Delete
***/
[403] Fix | Delete
[404] Fix | Delete
dns_namereln_t
[405] Fix | Delete
dns_name_fullcompare(const dns_name_t *name1, const dns_name_t *name2,
[406] Fix | Delete
int *orderp, unsigned int *nlabelsp);
[407] Fix | Delete
/*%<
[408] Fix | Delete
* Determine the relative ordering under the DNSSEC order relation of
[409] Fix | Delete
* 'name1' and 'name2', and also determine the hierarchical
[410] Fix | Delete
* relationship of the names.
[411] Fix | Delete
*
[412] Fix | Delete
* Note: It makes no sense for one of the names to be relative and the
[413] Fix | Delete
* other absolute. If both names are relative, then to be meaningfully
[414] Fix | Delete
* compared the caller must ensure that they are both relative to the
[415] Fix | Delete
* same domain.
[416] Fix | Delete
*
[417] Fix | Delete
* Requires:
[418] Fix | Delete
*\li 'name1' is a valid name
[419] Fix | Delete
*
[420] Fix | Delete
*\li dns_name_countlabels(name1) > 0
[421] Fix | Delete
*
[422] Fix | Delete
*\li 'name2' is a valid name
[423] Fix | Delete
*
[424] Fix | Delete
*\li dns_name_countlabels(name2) > 0
[425] Fix | Delete
*
[426] Fix | Delete
*\li orderp and nlabelsp are valid pointers.
[427] Fix | Delete
*
[428] Fix | Delete
*\li Either name1 is absolute and name2 is absolute, or neither is.
[429] Fix | Delete
*
[430] Fix | Delete
* Ensures:
[431] Fix | Delete
*
[432] Fix | Delete
*\li *orderp is < 0 if name1 < name2, 0 if name1 = name2, > 0 if
[433] Fix | Delete
* name1 > name2.
[434] Fix | Delete
*
[435] Fix | Delete
*\li *nlabelsp is the number of common significant labels.
[436] Fix | Delete
*
[437] Fix | Delete
* Returns:
[438] Fix | Delete
*\li dns_namereln_none There's no hierarchical relationship
[439] Fix | Delete
* between name1 and name2.
[440] Fix | Delete
*\li dns_namereln_contains name1 properly contains name2; i.e.
[441] Fix | Delete
* name2 is a proper subdomain of name1.
[442] Fix | Delete
*\li dns_namereln_subdomain name1 is a proper subdomain of name2.
[443] Fix | Delete
*\li dns_namereln_equal name1 and name2 are equal.
[444] Fix | Delete
*\li dns_namereln_commonancestor name1 and name2 share a common
[445] Fix | Delete
* ancestor.
[446] Fix | Delete
*/
[447] Fix | Delete
[448] Fix | Delete
int
[449] Fix | Delete
dns_name_compare(const dns_name_t *name1, const dns_name_t *name2);
[450] Fix | Delete
/*%<
[451] Fix | Delete
* Determine the relative ordering under the DNSSEC order relation of
[452] Fix | Delete
* 'name1' and 'name2'.
[453] Fix | Delete
*
[454] Fix | Delete
* Note: It makes no sense for one of the names to be relative and the
[455] Fix | Delete
* other absolute. If both names are relative, then to be meaningfully
[456] Fix | Delete
* compared the caller must ensure that they are both relative to the
[457] Fix | Delete
* same domain.
[458] Fix | Delete
*
[459] Fix | Delete
* Requires:
[460] Fix | Delete
* \li 'name1' is a valid name
[461] Fix | Delete
*
[462] Fix | Delete
* \li 'name2' is a valid name
[463] Fix | Delete
*
[464] Fix | Delete
* \li Either name1 is absolute and name2 is absolute, or neither is.
[465] Fix | Delete
*
[466] Fix | Delete
* Returns:
[467] Fix | Delete
* \li < 0 'name1' is less than 'name2'
[468] Fix | Delete
* \li 0 'name1' is equal to 'name2'
[469] Fix | Delete
* \li > 0 'name1' is greater than 'name2'
[470] Fix | Delete
*/
[471] Fix | Delete
[472] Fix | Delete
bool
[473] Fix | Delete
dns_name_equal(const dns_name_t *name1, const dns_name_t *name2);
[474] Fix | Delete
/*%<
[475] Fix | Delete
* Are 'name1' and 'name2' equal?
[476] Fix | Delete
*
[477] Fix | Delete
* Notes:
[478] Fix | Delete
* \li Because it only needs to test for equality, dns_name_equal() can be
[479] Fix | Delete
* significantly faster than dns_name_fullcompare() or dns_name_compare().
[480] Fix | Delete
*
[481] Fix | Delete
* \li Offsets tables are not used in the comparison.
[482] Fix | Delete
*
[483] Fix | Delete
* \li It makes no sense for one of the names to be relative and the
[484] Fix | Delete
* other absolute. If both names are relative, then to be meaningfully
[485] Fix | Delete
* compared the caller must ensure that they are both relative to the
[486] Fix | Delete
* same domain.
[487] Fix | Delete
*
[488] Fix | Delete
* Requires:
[489] Fix | Delete
* \li 'name1' is a valid name
[490] Fix | Delete
*
[491] Fix | Delete
* \li 'name2' is a valid name
[492] Fix | Delete
*
[493] Fix | Delete
* \li Either name1 is absolute and name2 is absolute, or neither is.
[494] Fix | Delete
*
[495] Fix | Delete
* Returns:
[496] Fix | Delete
* \li true 'name1' and 'name2' are equal
[497] Fix | Delete
* \li false 'name1' and 'name2' are not equal
[498] Fix | Delete
*/
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function