#include <stdbool.h>
#include <stdio.h>
+#include <isc/buffer.h>
#include <isc/lang.h>
#include <isc/magic.h>
#include <isc/region.h> /* Required for storage size of dns_label_t. */
ISC_LIST(dns_rdataset_t) list;
};
-#define DNS_NAME_MAGIC ISC_MAGIC('D', 'N', 'S', 'n')
+#define DNS_NAME_MAGIC ISC_MAGIC('D', 'N', 'S', 'n')
+#define DNS_NAME_VALID(n) ISC_MAGIC_VALID(n, DNS_NAME_MAGIC)
+
+/*%
+ * 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 DNS_NAME_BINDABLE(name) \
+ (!name->attributes.readonly && !name->attributes.dynamic)
/*
* Various flags.
* unsigned char offsets[] = { 0, 6 };
* dns_name_t value = DNS_NAME_INITABSOLUTE(data, offsets);
*/
-#define DNS_NAME_INITNONABSOLUTE(A, B) \
- { \
- DNS_NAME_MAGIC, A, (sizeof(A) - 1), sizeof(B), \
- { .readonly = true }, B, NULL, \
- { (void *)-1, (void *)-1 }, { \
- NULL, NULL \
- } \
+#define DNS_NAME_INITNONABSOLUTE(A, B) \
+ { \
+ .magic = DNS_NAME_MAGIC, .ndata = A, \
+ .length = (sizeof(A) - 1), .labels = sizeof(B), \
+ .attributes = { .readonly = true }, .offsets = B, \
+ .link = ISC_LINK_INITIALIZER, .list = ISC_LIST_INITIALIZER, \
}
-#define DNS_NAME_INITABSOLUTE(A, B) \
- { \
- DNS_NAME_MAGIC, A, sizeof(A), sizeof(B), \
- { .readonly = true, .absolute = true }, B, NULL, \
- { (void *)-1, (void *)-1 }, { \
- NULL, NULL \
- } \
+#define DNS_NAME_INITABSOLUTE(A, B) \
+ { \
+ .magic = DNS_NAME_MAGIC, .ndata = A, .length = sizeof(A), \
+ .labels = sizeof(B), \
+ .attributes = { .readonly = true, .absolute = true }, \
+ .offsets = B, .link = ISC_LINK_INITIALIZER, \
+ .list = ISC_LIST_INITIALIZER, \
}
-#define DNS_NAME_INITEMPTY \
- { \
- DNS_NAME_MAGIC, NULL, 0, 0, {}, NULL, NULL, \
- { (void *)-1, (void *)-1 }, { \
- NULL, NULL \
- } \
+#define DNS_NAME_INITEMPTY \
+ { \
+ .magic = DNS_NAME_MAGIC, .link = ISC_LINK_INITIALIZER, \
+ .list = ISC_LIST_INITIALIZER \
}
/*%
*** Initialization
***/
-void
-dns_name_init(dns_name_t *name, unsigned char *offsets);
+static inline void
+dns_name_init(dns_name_t *name, unsigned char *offsets) {
+ *name = (dns_name_t){
+ .magic = DNS_NAME_MAGIC,
+ .offsets = (offsets),
+ .link = ISC_LINK_INITIALIZER,
+ .list = ISC_LIST_INITIALIZER,
+ };
+}
/*%<
* Initialize 'name'.
*
* \li dns_name_isabsolute(name) == false
*/
-void
-dns_name_reset(dns_name_t *name);
+static inline void
+dns_name_reset(dns_name_t *name) {
+ REQUIRE(DNS_NAME_VALID(name));
+ REQUIRE(DNS_NAME_BINDABLE(name));
+
+ name->ndata = NULL;
+ name->length = 0;
+ name->labels = 0;
+ name->attributes.absolute = false;
+ if (name->buffer != NULL) {
+ isc_buffer_clear(name->buffer);
+ }
+}
/*%<
* Reinitialize 'name'.
*
* \li dns_name_isabsolute(name) == false
*/
-void
-dns_name_invalidate(dns_name_t *name);
+static inline void
+dns_name_invalidate(dns_name_t *name) {
+ REQUIRE(DNS_NAME_VALID(name));
+
+ name->magic = 0;
+ name->ndata = NULL;
+ name->length = 0;
+ name->labels = 0;
+ name->attributes = (struct dns_name_attrs){};
+ name->offsets = NULL;
+ name->buffer = NULL;
+ ISC_LINK_INIT(name, link);
+}
/*%<
* Make 'name' invalid.
*
*** Dedicated Buffers
***/
-void
-dns_name_setbuffer(dns_name_t *name, isc_buffer_t *buffer);
+static inline void
+dns_name_setbuffer(dns_name_t *name, isc_buffer_t *buffer) {
+ REQUIRE(DNS_NAME_VALID(name));
+ REQUIRE((buffer != NULL && name->buffer == NULL) || (buffer == NULL));
+
+ name->buffer = buffer;
+}
/*%<
* Dedicate a buffer for use with 'name'.
*
*** Labels
***/
-unsigned int
-dns_name_countlabels(const dns_name_t *name);
+static inline unsigned int
+dns_name_countlabels(const dns_name_t *name) {
+ REQUIRE(DNS_NAME_VALID(name));
+ REQUIRE(name->labels <= DNS_NAME_MAXLABELS);
+
+ return (name->labels);
+}
/*%<
* How many labels does 'name' have?
*
* \li The data in 'r' is a sequence of one or more type 00 labels.
*/
-void
-dns_name_toregion(const dns_name_t *name, isc_region_t *r);
+static inline void
+dns_name_toregion(const dns_name_t *name, isc_region_t *r) {
+ REQUIRE(DNS_NAME_VALID(name));
+ REQUIRE(r != NULL);
+
+ r->base = name->ndata;
+ r->length = name->length;
+}
/*%<
* Make 'r' refer to 'name'.
*
*\li #DNS_R_NAMETOOLONG
*/
-void
+static inline void
dns_name_split(const dns_name_t *name, unsigned int suffixlabels,
- dns_name_t *prefix, dns_name_t *suffix);
+ dns_name_t *prefix, dns_name_t *suffix) {
+ REQUIRE(DNS_NAME_VALID(name));
+ REQUIRE(suffixlabels > 0);
+ REQUIRE(suffixlabels <= name->labels);
+ REQUIRE(prefix != NULL || suffix != NULL);
+ REQUIRE(prefix == NULL ||
+ (DNS_NAME_VALID(prefix) && DNS_NAME_BINDABLE(prefix)));
+ REQUIRE(suffix == NULL ||
+ (DNS_NAME_VALID(suffix) && DNS_NAME_BINDABLE(suffix)));
+
+ if (prefix != NULL) {
+ dns_name_getlabelsequence(name, 0, name->labels - suffixlabels,
+ prefix);
+ }
+ if (suffix != NULL) {
+ dns_name_getlabelsequence(name, name->labels - suffixlabels,
+ suffixlabels, suffix);
+ }
+}
/*%<
*
* Split 'name' into two pieces on a label boundary.
*/
ISC_LANG_ENDDECLS
-
-/*
- *** High Performance Macros
- ***/
-
-/*
- * WARNING: Use of these macros by applications may require recompilation
- * of the application in some situations where calling the function
- * would not.
- *
- * WARNING: No assertion checking is done for these macros.
- */
-
-#define DNS_NAME_INIT(n, o) \
- do { \
- dns_name_t *_n = (n); \
- /* memset(_n, 0, sizeof(*_n)); */ \
- _n->magic = DNS_NAME_MAGIC; \
- _n->ndata = NULL; \
- _n->length = 0; \
- _n->labels = 0; \
- _n->attributes = (struct dns_name_attrs){}; \
- _n->offsets = (o); \
- _n->buffer = NULL; \
- ISC_LINK_INIT(_n, link); \
- ISC_LIST_INIT(_n->list); \
- } while (0)
-
-#define DNS_NAME_RESET(n) \
- do { \
- (n)->ndata = NULL; \
- (n)->length = 0; \
- (n)->labels = 0; \
- (n)->attributes.absolute = false; \
- if ((n)->buffer != NULL) \
- isc_buffer_clear((n)->buffer); \
- } while (0)
-
-#define DNS_NAME_SETBUFFER(n, b) (n)->buffer = (b)
-
-#define DNS_NAME_COUNTLABELS(n) ((n)->labels)
-
-#define DNS_NAME_TOREGION(n, r) \
- do { \
- (r)->base = (n)->ndata; \
- (r)->length = (n)->length; \
- } while (0)
-
-#define DNS_NAME_SPLIT(n, l, p, s) \
- do { \
- dns_name_t *_n = (n); \
- dns_name_t *_p = (p); \
- dns_name_t *_s = (s); \
- unsigned int _l = (l); \
- if (_p != NULL) \
- dns_name_getlabelsequence(_n, 0, _n->labels - _l, _p); \
- if (_s != NULL) \
- dns_name_getlabelsequence(_n, _n->labels - _l, _l, \
- _s); \
- } while (0)
-
-#ifdef DNS_NAME_USEINLINE
-
-#define dns_name_init(n, o) DNS_NAME_INIT(n, o)
-#define dns_name_reset(n) DNS_NAME_RESET(n)
-#define dns_name_setbuffer(n, b) DNS_NAME_SETBUFFER(n, b)
-#define dns_name_countlabels(n) DNS_NAME_COUNTLABELS(n)
-#define dns_name_isabsolute(n) ((n)->attributes.absolute)
-#define dns_name_toregion(n, r) DNS_NAME_TOREGION(n, r)
-#define dns_name_split(n, l, p, s) DNS_NAME_SPLIT(n, l, p, s)
-
-#endif /* DNS_NAME_USEINLINE */
#include <dns/fixedname.h>
#include <dns/name.h>
-#define VALID_NAME(n) ISC_MAGIC_VALID(n, DNS_NAME_MAGIC)
-
typedef enum {
ft_init = 0,
ft_start,
name->attributes.absolute = false; \
} while (0);
-/*%
- * 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 BINDABLE(name) (!name->attributes.readonly && !name->attributes.dynamic)
-
/*%
* Note that the name data must be a char array, not a string
* literal, to avoid compiler warnings about discarding
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'.
- */
- DNS_NAME_INIT(name, offsets);
-}
-
-void
-dns_name_reset(dns_name_t *name) {
- REQUIRE(VALID_NAME(name));
- REQUIRE(BINDABLE(name));
-
- DNS_NAME_RESET(name);
-}
-
-void
-dns_name_invalidate(dns_name_t *name) {
- /*
- * Make 'name' invalid.
- */
-
- REQUIRE(VALID_NAME(name));
-
- name->magic = 0;
- name->ndata = NULL;
- name->length = 0;
- name->labels = 0;
- name->attributes = (struct dns_name_attrs){};
- name->offsets = NULL;
- name->buffer = NULL;
- ISC_LINK_INIT(name, link);
-}
-
bool
dns_name_isvalid(const dns_name_t *name) {
unsigned char *ndata, *offsets;
unsigned int offset, count, length, nlabels;
- if (!VALID_NAME(name)) {
+ if (!DNS_NAME_VALID(name)) {
return (false);
}
return (true);
}
-void
-dns_name_setbuffer(dns_name_t *name, isc_buffer_t *buffer) {
- /*
- * Dedicate a buffer for use with 'name'.
- */
-
- REQUIRE(VALID_NAME(name));
- REQUIRE((buffer != NULL && name->buffer == NULL) || (buffer == NULL));
-
- name->buffer = buffer;
-}
-
bool
dns_name_hasbuffer(const dns_name_t *name) {
/*
* Does 'name' have a dedicated buffer?
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
if (name->buffer != NULL) {
return (true);
* Does 'name' end in the root label?
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
return name->attributes.absolute;
}
unsigned int n;
bool first;
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(name->labels > 0);
REQUIRE(name->attributes.absolute);
unsigned int n;
bool first;
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(name->labels > 0);
REQUIRE(name->attributes.absolute);
* Is 'name' a wildcard name?
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(name->labels > 0);
if (name->length >= 2) {
* Does 'name' contain a internal wildcard?
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(name->labels > 0);
/*
uint32_t
dns_name_hash(const dns_name_t *name) {
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
return (isc_hash32(name->ndata, name->length, false));
}
* same domain.
*/
- REQUIRE(VALID_NAME(name1));
- REQUIRE(VALID_NAME(name2));
+ REQUIRE(DNS_NAME_VALID(name1));
+ REQUIRE(DNS_NAME_VALID(name2));
REQUIRE(orderp != NULL);
REQUIRE(nlabelsp != NULL);
/*
* same domain.
*/
- REQUIRE(VALID_NAME(name1));
- REQUIRE(VALID_NAME(name2));
+ REQUIRE(DNS_NAME_VALID(name1));
+ REQUIRE(DNS_NAME_VALID(name2));
/*
* Either name1 is absolute and name2 is absolute, or neither is.
*/
* same domain.
*/
- REQUIRE(VALID_NAME(name1));
- REQUIRE(VALID_NAME(name2));
+ REQUIRE(DNS_NAME_VALID(name1));
+ REQUIRE(DNS_NAME_VALID(name2));
/*
* Either name1 is absolute and name2 is absolute, or neither is.
*/
* Compare two absolute names as rdata.
*/
- REQUIRE(VALID_NAME(name1));
+ REQUIRE(DNS_NAME_VALID(name1));
REQUIRE(name1->labels > 0);
REQUIRE(name1->attributes.absolute);
- REQUIRE(VALID_NAME(name2));
+ REQUIRE(DNS_NAME_VALID(name2));
REQUIRE(name2->labels > 0);
REQUIRE(name2->attributes.absolute);
unsigned int nlabels, labels;
dns_name_t tname;
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(name->labels > 0);
- REQUIRE(VALID_NAME(wname));
+ REQUIRE(DNS_NAME_VALID(wname));
labels = wname->labels;
REQUIRE(labels > 0);
REQUIRE(dns_name_iswildcard(wname));
- DNS_NAME_INIT(&tname, NULL);
+ dns_name_init(&tname, NULL);
dns_name_getlabelsequence(wname, 1, labels - 1, &tname);
if (dns_name_fullcompare(name, &tname, &order, &nlabels) ==
dns_namereln_subdomain)
return (false);
}
-unsigned int
-dns_name_countlabels(const dns_name_t *name) {
- /*
- * How many labels does 'name' have?
- */
-
- REQUIRE(VALID_NAME(name));
-
- ENSURE(name->labels <= DNS_NAME_MAXLABELS);
-
- return (name->labels);
-}
-
void
dns_name_getlabel(const dns_name_t *name, unsigned int n, dns_label_t *label) {
unsigned char *offsets;
* Make 'label' refer to the 'n'th least significant label of 'name'.
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(name->labels > 0);
REQUIRE(n < name->labels);
REQUIRE(label != NULL);
* 'first' in 'source'.
*/
- REQUIRE(VALID_NAME(source));
- REQUIRE(VALID_NAME(target));
+ REQUIRE(DNS_NAME_VALID(source));
+ REQUIRE(DNS_NAME_VALID(target));
REQUIRE(first <= source->labels);
REQUIRE(n <= source->labels - first); /* note first+n could overflow */
- REQUIRE(BINDABLE(target));
+ REQUIRE(DNS_NAME_BINDABLE(target));
p = source->ndata;
if (first == source->labels) {
* Make 'target' refer to the same name as 'source'.
*/
- REQUIRE(VALID_NAME(source));
- REQUIRE(VALID_NAME(target));
- REQUIRE(BINDABLE(target));
+ REQUIRE(DNS_NAME_VALID(source));
+ REQUIRE(DNS_NAME_VALID(target));
+ REQUIRE(DNS_NAME_BINDABLE(target));
target->ndata = source->ndata;
target->length = source->length;
* Make 'name' refer to region 'r'.
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(r != NULL);
- REQUIRE(BINDABLE(name));
+ REQUIRE(DNS_NAME_BINDABLE(name));
INIT_OFFSETS(name, offsets, odata);
}
}
-void
-dns_name_toregion(const dns_name_t *name, isc_region_t *r) {
- /*
- * Make 'r' refer to 'name'.
- */
-
- REQUIRE(VALID_NAME(name));
- REQUIRE(r != NULL);
-
- DNS_NAME_TOREGION(name, r);
-}
-
isc_result_t
dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
const dns_name_t *origin, unsigned int options,
* will remain relative.
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(ISC_BUFFER_VALID(source));
REQUIRE((target != NULL && ISC_BUFFER_VALID(target)) ||
(target == NULL && ISC_BUFFER_VALID(name->buffer)));
isc_buffer_clear(target);
}
- REQUIRE(BINDABLE(name));
+ REQUIRE(DNS_NAME_BINDABLE(name));
INIT_OFFSETS(name, offsets, odata);
offsets[0] = 0;
* This function assumes the name is in proper uncompressed
* wire format.
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(ISC_BUFFER_VALID(target));
oused = target->used;
* This function assumes the name is in proper uncompressed
* wire format.
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(name->attributes.absolute);
REQUIRE(ISC_BUFFER_VALID(target));
* Downcase 'source'.
*/
- REQUIRE(VALID_NAME(source));
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(source));
+ REQUIRE(DNS_NAME_VALID(name));
if (source == name) {
REQUIRE(!name->attributes.readonly);
isc_buffer_init(&buffer, source->ndata, source->length);
target = &buffer;
ndata = source->ndata;
} else {
- REQUIRE(BINDABLE(name));
+ REQUIRE(DNS_NAME_BINDABLE(name));
REQUIRE((target != NULL && ISC_BUFFER_VALID(target)) ||
(target == NULL && ISC_BUFFER_VALID(name->buffer)));
if (target == NULL) {
* correct way to set our "consumed" variable.
*/
- REQUIRE(VALID_NAME(name));
- REQUIRE(BINDABLE(name));
+ REQUIRE(DNS_NAME_VALID(name));
+ REQUIRE(DNS_NAME_BINDABLE(name));
REQUIRE((target != NULL && ISC_BUFFER_VALID(target)) ||
(target == NULL && ISC_BUFFER_VALID(name->buffer)));
* compression context 'cctx', and storing the result in 'target'.
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(cctx != NULL);
REQUIRE(ISC_BUFFER_VALID(target));
}
if (name->offsets == NULL) {
- DNS_NAME_INIT(&clname, clo);
+ dns_name_init(&clname, clo);
dns_name_clone(name, &clname);
name = &clname;
}
* Concatenate 'prefix' and 'suffix'.
*/
- REQUIRE(prefix == NULL || VALID_NAME(prefix));
- REQUIRE(suffix == NULL || VALID_NAME(suffix));
- REQUIRE(name == NULL || VALID_NAME(name));
+ REQUIRE(prefix == NULL || DNS_NAME_VALID(prefix));
+ REQUIRE(suffix == NULL || DNS_NAME_VALID(suffix));
+ REQUIRE(name == NULL || DNS_NAME_VALID(name));
REQUIRE((target != NULL && ISC_BUFFER_VALID(target)) ||
(target == NULL && name != NULL &&
ISC_BUFFER_VALID(name->buffer)));
REQUIRE(!copy_suffix);
}
if (name == NULL) {
- DNS_NAME_INIT(&tmp_name, odata);
+ dns_name_init(&tmp_name, odata);
name = &tmp_name;
}
if (target == NULL) {
isc_buffer_clear(name->buffer);
}
- REQUIRE(BINDABLE(name));
+ REQUIRE(DNS_NAME_BINDABLE(name));
/*
* Set up.
return (ISC_R_SUCCESS);
}
-void
-dns_name_split(const dns_name_t *name, unsigned int suffixlabels,
- dns_name_t *prefix, dns_name_t *suffix)
-
-{
- unsigned int splitlabel;
-
- REQUIRE(VALID_NAME(name));
- REQUIRE(suffixlabels > 0);
- REQUIRE(suffixlabels <= name->labels);
- REQUIRE(prefix != NULL || suffix != NULL);
- REQUIRE(prefix == NULL || (VALID_NAME(prefix) && BINDABLE(prefix)));
- REQUIRE(suffix == NULL || (VALID_NAME(suffix) && BINDABLE(suffix)));
-
- splitlabel = name->labels - suffixlabels;
-
- if (prefix != NULL) {
- dns_name_getlabelsequence(name, 0, splitlabel, prefix);
- }
-
- if (suffix != NULL) {
- dns_name_getlabelsequence(name, splitlabel, suffixlabels,
- suffix);
- }
-
- return;
-}
-
void
dns_name_dup(const dns_name_t *source, isc_mem_t *mctx, dns_name_t *target) {
/*
* Make 'target' a dynamically allocated copy of 'source'.
*/
- REQUIRE(VALID_NAME(source));
+ REQUIRE(DNS_NAME_VALID(source));
REQUIRE(source->length > 0);
- REQUIRE(VALID_NAME(target));
- REQUIRE(BINDABLE(target));
+ REQUIRE(DNS_NAME_VALID(target));
+ REQUIRE(DNS_NAME_BINDABLE(target));
/*
* Make 'target' empty in case of failure.
* 'target' will also have a dynamically allocated offsets table.
*/
- REQUIRE(VALID_NAME(source));
+ REQUIRE(DNS_NAME_VALID(source));
REQUIRE(source->length > 0);
- REQUIRE(VALID_NAME(target));
- REQUIRE(BINDABLE(target));
+ REQUIRE(DNS_NAME_VALID(target));
+ REQUIRE(DNS_NAME_BINDABLE(target));
REQUIRE(target->offsets == NULL);
/*
* Free 'name'.
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(name->attributes.dynamic);
size = name->length;
* Send 'name' in DNSSEC canonical form to 'digest'.
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(digest != NULL);
- DNS_NAME_INIT(&downname, NULL);
+ dns_name_init(&downname, NULL);
isc_buffer_init(&buffer, data, sizeof(data));
bool
dns_name_dynamic(const dns_name_t *name) {
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
/*
* Returns whether there is dynamic memory associated with this name.
* Print 'name' on 'stream'.
*/
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
isc_buffer_init(&b, t, sizeof(t));
result = dns_name_totext(name, 0, &b);
isc_region_t reg;
char *p, txt[DNS_NAME_FORMATSIZE];
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
REQUIRE(target != NULL && *target == NULL);
isc_buffer_init(&buf, txt, sizeof(txt));
isc_buffer_constinit(&buf, src, strlen(src));
isc_buffer_add(&buf, strlen(src));
- if (BINDABLE(target) && target->buffer != NULL) {
+ if (DNS_NAME_BINDABLE(target) && target->buffer != NULL) {
name = target;
} else {
name = dns_fixedname_initname(&fn);
isc_buffer_t *target = NULL;
unsigned char *ndata = NULL;
- REQUIRE(VALID_NAME(source));
- REQUIRE(VALID_NAME(dest));
- REQUIRE(BINDABLE(dest));
+ REQUIRE(DNS_NAME_VALID(source));
+ REQUIRE(DNS_NAME_VALID(dest));
+ REQUIRE(DNS_NAME_BINDABLE(dest));
target = dest->buffer;
unsigned char len;
const unsigned char *ndata;
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
if (name->labels < 1) {
return (false);
unsigned char len, len1;
const unsigned char *ndata;
- REQUIRE(VALID_NAME(name));
+ REQUIRE(DNS_NAME_VALID(name));
if (name->labels < 1 || name->length < 5) {
return (false);