Lines Matching full:name

17 /* $Id: name.h,v 1.13 2022/12/26 19:24:11 jmc Exp $ */
26 /*! \file dns/name.h
33 * way of storing name data, but at the same time allow names to be
40 * where the Names and Labels module comes in. The module allows name or
42 * regions. All name operations and conversions are done through these
89 ***** A 'name' is a handle to a binary region. It contains a sequence of one
121 * Attributes below 0x0100 reserved for name.c usage.
146 * Standard size of a wire format name
155 dns_name_init(dns_name_t *name, unsigned char *offsets);
157 * Initialize 'name'.
162 * name operations if the name is used more than once.
165 * \li 'name' is not NULL and points to a struct dns_name.
170 * \li 'name' is a valid name.
171 * \li dns_name_countlabels(name) == 0
172 * \li dns_name_isabsolute(name) == 0
176 dns_name_reset(dns_name_t *name);
178 * Reinitialize 'name'.
184 * \li + If any buffer is associated with 'name' (via dns_name_setbuffer()
188 * \li + Of the attributes associated with 'name', all are retained except
192 * \li 'name' is a valid name.
195 * \li 'name' is a valid name.
196 * \li dns_name_countlabels(name) == 0
197 * \li dns_name_isabsolute(name) == 0
201 dns_name_invalidate(dns_name_t *name);
203 * Make 'name' invalid.
206 * \li 'name' is a valid name.
209 * \li If assertion checking is enabled, future attempts to use 'name'
212 * \li If the name had a dedicated buffer, that association is ended.
220 dns_name_setbuffer(dns_name_t *name, isc_buffer_t *buffer);
222 * Dedicate a buffer for use with 'name'.
227 * 'name' has a dedicated buffer.
229 * \li The caller must not write to buffer until the name has been
232 * \li If buffer is NULL and the name previously had a dedicated buffer,
233 * than that buffer is no longer dedicated to use with this name.
235 * the name remains valid.
238 * \li 'name' is a valid name.
240 * \li 'buffer' is a valid binary buffer and 'name' doesn't have a
249 dns_name_isabsolute(const dns_name_t *name);
251 * Does 'name' end in the root label?
254 * \li 'name' is a valid name
257 * \li TRUE The last label in 'name' is the root label.
258 * \li FALSE The last label in 'name' is not the root label.
262 dns_name_hash(dns_name_t *name, int case_sensitive);
264 * Provide a hash value for 'name'.
270 * \li 'name' is a valid name
294 *\li 'name1' is a valid name
298 *\li 'name2' is a valid name
336 * \li 'name1' is a valid name
338 * \li 'name2' is a valid name
365 * \li 'name1' is a valid name
367 * \li 'name2' is a valid name
397 * \li 'name1' is a valid name
399 * \li 'name2' is a valid name
413 dns_name_countlabels(const dns_name_t *name);
415 * How many labels does 'name' have?
421 * \li 'name' is a valid name
427 * \li The number of labels in 'name'.
431 dns_name_getlabel(const dns_name_t *name, unsigned int n, dns_label_t *label);
433 * Make 'label' refer to the 'n'th least significant label of 'name'.
441 * \li 'label' refers to the same memory as 'name', so 'name' must not
445 * \li n < dns_name_countlabels(name)
467 * \li first < dns_name_countlabels(name)
469 * \li first + n <= dns_name_countlabels(name)
475 * Make 'target' refer to the same name as 'source'.
495 * \li 'source' is a valid name.
497 * \li 'target' is a valid name that is not read-only.
505 dns_name_fromregion(dns_name_t *name, const isc_region_t *r);
507 * Make 'name' refer to region 'r'.
520 dns_name_toregion(dns_name_t *name, isc_region_t *r);
522 * Make 'r' refer to 'name'.
526 * \li 'name' is a valid name.
532 dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
536 * Copy the possibly-compressed name at source (active region) into target,
555 * \li 'name' is a valid name.
558 * region should be the first byte of a DNS wire format domain name.
560 * \li 'target' is a valid buffer or 'target' is NULL and 'name' has
568 * \li If 'target' is not NULL, 'name' is attached to it.
580 * \li Bad Form: Name Length
589 dns_name_towire(const dns_name_t *name, dns_compress_t *cctx,
592 * Convert 'name' into wire format, compressing it as specified by the
600 * \li 'name' is a valid name
602 * \li dns_name_countlabels(name) > 0
604 * \li dns_name_isabsolute(name) == TRUE
623 dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
627 * Convert the textual representation of a DNS name at source
640 * \li 'name' is a valid name.
644 * \li 'target' is a valid buffer or 'target' is NULL and 'name' has
650 * \li If 'target' is not NULL, 'name' is attached to it.
672 dns_name_totext(dns_name_t *name, int omit_final_dot,
676 dns_name_totext2(dns_name_t *name, unsigned int options, isc_buffer_t *target);
678 * Convert 'name' into text format, storing the result in 'target'.
682 * names other than the root name will be omitted.
685 * in absolute names other than the root name will be omitted.
690 *\li If dns_name_countlabels == 0, the name will be "@", representing the
693 *\li The name is not NUL terminated.
697 *\li 'name' is a valid name
716 * name as generated by dns_name_totext(). This does not
723 * A wire-encoded name can be up to 255 bytes and each
725 * Maximizing the label lengths gives us a name of
737 dns_name_downcase(dns_name_t *source, dns_name_t *name,
744 *\li 'source' and 'name' are valid names.
746 *\li If source == name, then
751 * 'name' has a dedicated buffer.
757 * Note: if source == name, then the result will always be ISC_R_SUCCESS.
762 dns_name_t *name, isc_buffer_t *target);
768 *\li 'prefix' is a valid name or NULL.
770 *\li 'suffix' is a valid name or NULL.
772 *\li 'name' is a valid name or NULL.
774 *\li 'target' is a valid buffer or 'target' is NULL and 'name' has
777 *\li If 'prefix' is absolute, 'suffix' must be NULL or the empty name.
782 * If 'target' is not NULL and 'name' is not NULL, then 'name'
800 *\li 'source' is a valid non-empty name.
802 *\li 'target' is a valid name that is not read-only.
816 *\li 'source' is a valid non-empty name.
818 *\li 'target' is a valid name that is not read-only.
826 dns_name_free(dns_name_t *name);
828 * Free 'name'.
832 *\li 'name' is a valid name created previously in 'mctx' by dns_name_dup().
838 *\li All dynamic resources used by 'name' are freed and the name is
843 dns_name_dynamic(dns_name_t *name);
845 * Returns whether there is dynamic memory associated with this name.
849 *\li 'name' is a valid name.
853 *\li '1' if the name is dynamic otherwise '0'.
857 dns_name_format(dns_name_t *name, char *cp, unsigned int size);
859 * Format 'name' as text appropriate for use in log messages.
861 * Store the formatted name at 'cp', writing no more than
865 * The formatted name will have a terminating dot only if it is
873 *\li 'name' is a valid name.
885 * Convert a string to a name and place it in target, allocating memory
889 * If 'target' has a buffer then the name will be copied into it rather than
894 * \li 'target' is a valid name that is not read-only.
915 * Makes 'dest' refer to a copy of the name in 'source'. The data are
919 * \li 'source' is a valid name.
921 * \li 'dest' is an initialized name with a dedicated buffer.