Lines Matching refs:dname
2 * dname.h -- Domain name handling.
31 typedef struct dname dname_type;
32 struct dname
62 * Construct a new domain name based on wire format dname stored at
65 * dname or set to just after the first compression pointer.
103 * Return NULL if DNAME is NULL or a copy of DNAME otherwise.
105 const dname_type *dname_copy(region_type *region, const dname_type *dname);
109 * Copy the most significant LABEL_COUNT labels from dname.
112 const dname_type *dname,
117 * The origin of DNAME.
119 const dname_type *dname_origin(region_type *region, const dname_type *dname);
133 dname_label_offsets(const dname_type *dname)
135 return (const uint8_t *) ((const char *) dname + sizeof(dname_type));
145 dname_name(const dname_type *dname)
147 return (const uint8_t *) ((const char *) dname
149 + dname->label_count * sizeof(uint8_t));
154 * Return the label for DNAME specified by LABEL_INDEX. The first
158 * Pre: dname != NULL && label_index < dname->label_count.
161 dname_label(const dname_type *dname, uint8_t label)
165 assert(dname != NULL);
166 assert(label < dname->label_count);
168 label_index = dname_label_offsets(dname)[label];
169 assert(label_index < dname->name_size);
171 return dname_name(dname) + label_index;
214 * The total size (in bytes) allocated to store DNAME.
216 * Pre: dname != NULL
219 dname_total_size(const dname_type *dname)
222 + ((((size_t)dname->label_count) + ((size_t)dname->name_size))
339 * Convert DNAME to its string representation. The result points to a
343 * If ORIGIN is provided and DNAME is a subdomain of ORIGIN the dname
346 * Pre: dname != NULL
348 const char *dname_to_string(const dname_type *dname,
352 * Convert DNAME to its string representation. The result if written
356 * If ORIGIN is provided and DNAME is a subdomain of ORIGIN the dname
359 * Pre: dname != NULL
361 const char *dname_to_string_buf(const dname_type *dname,
366 * Create a dname containing the single label specified by STR
383 * Perform DNAME substitution on a name, replace src with dest.
392 /** Convert uncompressed wireformat dname to a string */
393 char* wiredname2str(const uint8_t* dname);
407 * Calculate length of dname in uncompressed wireformat in buffer.
408 * @param buf: The buffer with the uncompressed dname.
410 * @return 0 on error, otherwise the uncompressed wireformat dname
415 /* This structure is sufficient in size for a struct dname. It can
416 * be cast to a struct dname*, since it has the same data. */
418 struct dname dname;
423 * dname may have padding. The content is stored after the
424 * sizeof(struct dname), with label_offsets and name. */
429 * Make the dname and label offsets.
430 * @param dname: the buffer with size. The result is in here, at the
433 * @param name: input name, points into the buffer space of dname.
434 * @param normalize: if the dname has to be normalized.
437 int dname_make_buffered(struct dname_buffer* dname, uint8_t *name,
442 * @param dname: the buffer with sufficient size for the dname.
443 * @param packet: packet, at the position of the dname. The position is moved.
448 int dname_make_from_packet_buffered(struct dname_buffer* dname,