2 * host2str.h - txt presentation of RRs
4 * a Net::DNS like library for C
6 * (c) NLnet Labs, 2005-2006
8 * See the file LICENSE for the license
14 * Contains functions to translate the main structures to their text
15 * representation, as well as functions to print them.
18 #ifndef LDNS_HOST2STR_H
19 #define LDNS_HOST2STR_H
21 #include <ldns/common.h>
22 #include <ldns/error.h>
24 #include <ldns/rdata.h>
25 #include <ldns/packet.h>
26 #include <ldns/buffer.h>
27 #include <ldns/resolver.h>
28 #include <ldns/zone.h>
31 #include "ldns/util.h"
37 #define LDNS_APL_IP4 1
38 #define LDNS_APL_IP6 2
39 #define LDNS_APL_MASK 0x7f
40 #define LDNS_APL_NEGATION 0x80
43 * Represent a NULL pointer (in stead of a pointer to a ldns_rr as "; (null)"
44 * as opposed to outputting nothing at all in such a case.
46 #define LDNS_COMMENT_NULLS 0x0001
47 /** Show key id with DNSKEY RR's as comment */
48 #define LDNS_COMMENT_KEY_ID 0x0002
49 /** Show if a DNSKEY is a ZSK or KSK as comment */
50 #define LDNS_COMMENT_KEY_TYPE 0x0004
51 /** Show DNSKEY key size as comment */
52 #define LDNS_COMMENT_KEY_SIZE 0x0008
53 /** Show key id, type and size as comment for DNSKEY RR's */
54 #define LDNS_COMMENT_KEY (LDNS_COMMENT_KEY_ID \
55 |LDNS_COMMENT_KEY_TYPE\
56 |LDNS_COMMENT_KEY_SIZE)
57 /** Provide bubblebabble representation for DS RR's as comment */
58 #define LDNS_COMMENT_BUBBLEBABBLE 0x0010
59 /** Show when a NSEC3 RR has the optout flag set as comment */
60 #define LDNS_COMMENT_FLAGS 0x0020
61 /** Show the unhashed owner and next owner names for NSEC3 RR's as comment */
62 #define LDNS_COMMENT_NSEC3_CHAIN 0x0040
64 #define LDNS_COMMENT_LAYOUT 0x0080
65 /** Also comment KEY_ID with RRSIGS **/
66 #define LDNS_COMMENT_RRSIGS 0x0100
69 * Output format specifier
71 * Determines how Packets, Resource Records and Resource record data fiels are
72 * formatted when printing or converting to string.
73 * Currently it is only used to specify what aspects of a Resource Record are
74 * annotated in the comment section of the textual representation the record.
75 * This is speciefed with flags and potential exra data (such as for example
76 * a lookup map of hashes to real names for annotation NSEC3 records).
78 struct ldns_struct_output_format
80 /** Specification of how RR's should be formatted in text */
82 /** Potential extra data to be used with formatting RR's in text */
85 typedef struct ldns_struct_output_format ldns_output_format;
88 * Standard output format record that disables commenting in the textual
89 * representation of Resource Records completely.
91 extern const ldns_output_format *ldns_output_format_nocomments;
93 * Standard output format record that annotated only DNSKEY RR's with commenti
96 extern const ldns_output_format *ldns_output_format_onlykeyids;
98 * The default output format record. Same as ldns_output_format_onlykeyids.
100 extern const ldns_output_format *ldns_output_format_default;
102 * Standard output format record that shows all DNSKEY related information in
103 * the comment text, plus the optout flag when set with NSEC3's, plus the
104 * bubblebabble representation of DS RR's.
106 extern const ldns_output_format *ldns_output_format_bubblebabble;
109 * Converts an ldns packet opcode value to its mnemonic, and adds that
110 * to the output buffer
111 * \param[in] *output the buffer to add the data to
112 * \param[in] opcode to find the string representation of
113 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error
116 ldns_pkt_opcode2buffer_str(ldns_buffer *output, ldns_pkt_opcode opcode);
119 * Converts an ldns packet rcode value to its mnemonic, and adds that
120 * to the output buffer
121 * \param[in] *output the buffer to add the data to
122 * \param[in] rcode to find the string representation of
123 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error
126 ldns_pkt_rcode2buffer_str(ldns_buffer *output, ldns_pkt_rcode rcode);
129 * Converts an ldns algorithm type to its mnemonic, and adds that
130 * to the output buffer
131 * \param[in] *output the buffer to add the data to
132 * \param[in] algorithm to find the string representation of
133 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error
136 ldns_algorithm2buffer_str(ldns_buffer *output,
137 ldns_algorithm algorithm);
140 * Converts an ldns certificate algorithm type to its mnemonic,
141 * and adds that to the output buffer
142 * \param[in] *output the buffer to add the data to
143 * \param[in] cert_algorithm to find the string representation of
144 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error
147 ldns_cert_algorithm2buffer_str(ldns_buffer *output,
148 ldns_cert_algorithm cert_algorithm);
152 * Converts a packet opcode to its mnemonic and returns that as
153 * an allocated null-terminated string.
154 * Remember to free it.
156 * \param[in] opcode the opcode to convert to text
157 * \return null terminated char * data, or NULL on error
159 char *ldns_pkt_opcode2str(ldns_pkt_opcode opcode);
162 * Converts a packet rcode to its mnemonic and returns that as
163 * an allocated null-terminated string.
164 * Remember to free it.
166 * \param[in] rcode the rcode to convert to text
167 * \return null terminated char * data, or NULL on error
169 char *ldns_pkt_rcode2str(ldns_pkt_rcode rcode);
172 * Converts a signing algorithms to its mnemonic and returns that as
173 * an allocated null-terminated string.
174 * Remember to free it.
176 * \param[in] algorithm the algorithm to convert to text
177 * \return null terminated char * data, or NULL on error
179 char *ldns_pkt_algorithm2str(ldns_algorithm algorithm);
182 * Converts a cert algorithm to its mnemonic and returns that as
183 * an allocated null-terminated string.
184 * Remember to free it.
186 * \param[in] cert_algorithm to convert to text
187 * \return null terminated char * data, or NULL on error
189 char *ldns_pkt_cert_algorithm2str(ldns_cert_algorithm cert_algorithm);
192 * Converts an LDNS_RDF_TYPE_A rdata element to string format and adds it to the output buffer
193 * \param[in] *rdf The rdata to convert
194 * \param[in] *output The buffer to add the data to
195 * \return LDNS_STATUS_OK on success, and error status on failure
197 ldns_status ldns_rdf2buffer_str_a(ldns_buffer *output, const ldns_rdf *rdf);
200 * Converts an LDNS_RDF_TYPE_AAAA rdata element to string format and adds it to the output buffer
201 * \param[in] *rdf The rdata to convert
202 * \param[in] *output The buffer to add the data to
203 * \return LDNS_STATUS_OK on success, and error status on failure
205 ldns_status ldns_rdf2buffer_str_aaaa(ldns_buffer *output, const ldns_rdf *rdf);
208 * Converts an LDNS_RDF_TYPE_STR rdata element to string format and adds it to the output buffer
209 * \param[in] *rdf The rdata to convert
210 * \param[in] *output The buffer to add the data to
211 * \return LDNS_STATUS_OK on success, and error status on failure
213 ldns_status ldns_rdf2buffer_str_str(ldns_buffer *output, const ldns_rdf *rdf);
216 * Converts an LDNS_RDF_TYPE_B64 rdata element to string format and adds it to the output buffer
217 * \param[in] *rdf The rdata to convert
218 * \param[in] *output The buffer to add the data to
219 * \return LDNS_STATUS_OK on success, and error status on failure
221 ldns_status ldns_rdf2buffer_str_b64(ldns_buffer *output, const ldns_rdf *rdf);
224 * Converts an LDNS_RDF_TYPE_B32_EXT rdata element to string format and adds it to the output buffer
225 * \param[in] *rdf The rdata to convert
226 * \param[in] *output The buffer to add the data to
227 * \return LDNS_STATUS_OK on success, and error status on failure
229 ldns_status ldns_rdf2buffer_str_b32_ext(ldns_buffer *output, const ldns_rdf *rdf);
232 * Converts an LDNS_RDF_TYPE_HEX rdata element to string format and adds it to the output buffer
233 * \param[in] *rdf The rdata to convert
234 * \param[in] *output The buffer to add the data to
235 * \return LDNS_STATUS_OK on success, and error status on failure
237 ldns_status ldns_rdf2buffer_str_hex(ldns_buffer *output, const ldns_rdf *rdf);
240 * Converts an LDNS_RDF_TYPE_TYPE rdata element to string format and adds it to the output buffer
241 * \param[in] *rdf The rdata to convert
242 * \param[in] *output The buffer to add the data to
243 * \return LDNS_STATUS_OK on success, and error status on failure
245 ldns_status ldns_rdf2buffer_str_type(ldns_buffer *output, const ldns_rdf *rdf);
248 * Converts an LDNS_RDF_TYPE_CLASS rdata element to string format and adds it to the output buffer
249 * \param[in] *rdf The rdata to convert
250 * \param[in] *output The buffer to add the data to
251 * \return LDNS_STATUS_OK on success, and error status on failure
253 ldns_status ldns_rdf2buffer_str_class(ldns_buffer *output, const ldns_rdf *rdf);
256 * Converts an LDNS_RDF_TYPE_ALG rdata element to string format and adds it to the output buffer
257 * \param[in] *rdf The rdata to convert
258 * \param[in] *output The buffer to add the data to
259 * \return LDNS_STATUS_OK on success, and error status on failure
261 ldns_status ldns_rdf2buffer_str_alg(ldns_buffer *output, const ldns_rdf *rdf);
264 * Converts an ldns_rr_type value to its string representation,
265 * and places it in the given buffer
266 * \param[in] *output The buffer to add the data to
267 * \param[in] type the ldns_rr_type to convert
268 * \return LDNS_STATUS_OK on success, and error status on failure
270 ldns_status ldns_rr_type2buffer_str(ldns_buffer *output,
271 const ldns_rr_type type);
274 * Converts an ldns_rr_type value to its string representation,
275 * and returns that string. For unknown types, the string
276 * "TYPE<id>" is returned. This function allocates data that must be
277 * freed by the caller
278 * \param[in] type the ldns_rr_type to convert
279 * \return a newly allocated string
281 char *ldns_rr_type2str(const ldns_rr_type type);
284 * Converts an ldns_rr_class value to its string representation,
285 * and places it in the given buffer
286 * \param[in] *output The buffer to add the data to
287 * \param[in] klass the ldns_rr_class to convert
288 * \return LDNS_STATUS_OK on success, and error status on failure
290 ldns_status ldns_rr_class2buffer_str(ldns_buffer *output,
291 const ldns_rr_class klass);
294 * Converts an ldns_rr_class value to its string representation,
295 * and returns that string. For unknown types, the string
296 * "CLASS<id>" is returned. This function allocates data that must be
297 * freed by the caller
298 * \param[in] klass the ldns_rr_class to convert
299 * \return a newly allocated string
301 char *ldns_rr_class2str(const ldns_rr_class klass);
305 * Converts an LDNS_RDF_TYPE_CERT rdata element to string format and adds it to the output buffer
306 * \param[in] *rdf The rdata to convert
307 * \param[in] *output The buffer to add the data to
308 * \return LDNS_STATUS_OK on success, and error status on failure
310 ldns_status ldns_rdf2buffer_str_cert_alg(ldns_buffer *output, const ldns_rdf *rdf);
313 * Converts an LDNS_RDF_TYPE_LOC rdata element to string format and adds it to the output buffer
314 * \param[in] *rdf The rdata to convert
315 * \param[in] *output The buffer to add the data to
316 * \return LDNS_STATUS_OK on success, and error status on failure
318 ldns_status ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf);
321 * Converts an LDNS_RDF_TYPE_UNKNOWN rdata element to string format and adds it to the output buffer
322 * \param[in] *rdf The rdata to convert
323 * \param[in] *output The buffer to add the data to
324 * \return LDNS_STATUS_OK on success, and error status on failure
326 ldns_status ldns_rdf2buffer_str_unknown(ldns_buffer *output, const ldns_rdf *rdf);
329 * Converts an LDNS_RDF_TYPE_NSAP rdata element to string format and adds it to the output buffer
330 * \param[in] *rdf The rdata to convert
331 * \param[in] *output The buffer to add the data to
332 * \return LDNS_STATUS_OK on success, and error status on failure
334 ldns_status ldns_rdf2buffer_str_nsap(ldns_buffer *output, const ldns_rdf *rdf);
337 * Converts an LDNS_RDF_TYPE_ATMA rdata element to string format and adds it to the output buffer
338 * \param[in] *rdf The rdata to convert
339 * \param[in] *output The buffer to add the data to
340 * \return LDNS_STATUS_OK on success, and error status on failure
342 ldns_status ldns_rdf2buffer_str_atma(ldns_buffer *output, const ldns_rdf *rdf);
345 * Converts an LDNS_RDF_TYPE_WKS rdata element to string format and adds it to the output buffer
346 * \param[in] *rdf The rdata to convert
347 * \param[in] *output The buffer to add the data to
348 * \return LDNS_STATUS_OK on success, and error status on failure
350 ldns_status ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf);
353 * Converts an LDNS_RDF_TYPE_NSEC rdata element to string format and adds it to the output buffer
354 * \param[in] *rdf The rdata to convert
355 * \param[in] *output The buffer to add the data to
356 * \return LDNS_STATUS_OK on success, and error status on failure
358 ldns_status ldns_rdf2buffer_str_nsec(ldns_buffer *output, const ldns_rdf *rdf);
361 * Converts an LDNS_RDF_TYPE_PERIOD rdata element to string format and adds it to the output buffer
362 * \param[in] *rdf The rdata to convert
363 * \param[in] *output The buffer to add the data to
364 * \return LDNS_STATUS_OK on success, and error status on failure
366 ldns_status ldns_rdf2buffer_str_period(ldns_buffer *output, const ldns_rdf *rdf);
369 * Converts an LDNS_RDF_TYPE_TSIGTIME rdata element to string format and adds it to the output buffer
370 * \param[in] *rdf The rdata to convert
371 * \param[in] *output The buffer to add the data to
372 * \return LDNS_STATUS_OK on success, and error status on failure
374 ldns_status ldns_rdf2buffer_str_tsigtime(ldns_buffer *output, const ldns_rdf *rdf);
377 * Converts an LDNS_RDF_TYPE_APL rdata element to string format and adds it to the output buffer
378 * \param[in] *rdf The rdata to convert
379 * \param[in] *output The buffer to add the data to
380 * \return LDNS_STATUS_OK on success, and error status on failure
382 ldns_status ldns_rdf2buffer_str_apl(ldns_buffer *output, const ldns_rdf *rdf);
385 * Converts an LDNS_RDF_TYPE_INT16_DATA rdata element to string format and adds it to the output buffer
386 * \param[in] *rdf The rdata to convert
387 * \param[in] *output The buffer to add the data to
388 * \return LDNS_STATUS_OK on success, and error status on failure
390 ldns_status ldns_rdf2buffer_str_int16_data(ldns_buffer *output, const ldns_rdf *rdf);
393 * Converts an LDNS_RDF_TYPE_IPSECKEY rdata element to string format and adds it to the output buffer
394 * \param[in] *rdf The rdata to convert
395 * \param[in] *output The buffer to add the data to
396 * \return LDNS_STATUS_OK on success, and error status on failure
398 ldns_status ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf);
401 * Converts an LDNS_RDF_TYPE_TSIG rdata element to string format and adds it to the output buffer
402 * \param[in] *rdf The rdata to convert
403 * \param[in] *output The buffer to add the data to
404 * \return LDNS_STATUS_OK on success, and error status on failure
406 ldns_status ldns_rdf2buffer_str_tsig(ldns_buffer *output, const ldns_rdf *rdf);
410 * Converts the data in the rdata field to presentation
411 * format (as char *) and appends it to the given buffer
413 * \param[in] output pointer to the buffer to append the data to
414 * \param[in] rdf the pointer to the rdafa field containing the data
417 ldns_status ldns_rdf2buffer_str(ldns_buffer *output, const ldns_rdf *rdf);
420 * Converts the data in the resource record to presentation
421 * format (as char *) and appends it to the given buffer.
422 * The presentation format of DNSKEY record is annotated with comments giving
423 * the id, type and size of the key.
425 * \param[in] output pointer to the buffer to append the data to
426 * \param[in] rr the pointer to the rr field to convert
429 ldns_status ldns_rr2buffer_str(ldns_buffer *output, const ldns_rr *rr);
432 * Converts the data in the resource record to presentation
433 * format (as char *) and appends it to the given buffer.
434 * The presentation format is annotated with comments giving
435 * additional information on the record.
437 * \param[in] output pointer to the buffer to append the data to
438 * \param[in] fmt how to format the textual representation of the
440 * \param[in] rr the pointer to the rr field to convert
443 ldns_status ldns_rr2buffer_str_fmt(ldns_buffer *output,
444 const ldns_output_format *fmt, const ldns_rr *rr);
447 * Converts the data in the DNS packet to presentation
448 * format (as char *) and appends it to the given buffer
450 * \param[in] output pointer to the buffer to append the data to
451 * \param[in] pkt the pointer to the packet to convert
454 ldns_status ldns_pkt2buffer_str(ldns_buffer *output, const ldns_pkt *pkt);
457 * Converts the data in the DNS packet to presentation
458 * format (as char *) and appends it to the given buffer
460 * \param[in] output pointer to the buffer to append the data to
461 * \param[in] fmt how to format the textual representation of the packet
462 * \param[in] pkt the pointer to the packet to convert
465 ldns_status ldns_pkt2buffer_str_fmt(ldns_buffer *output,
466 const ldns_output_format *fmt, const ldns_pkt *pkt);
469 * Converts an LDNS_RDF_TYPE_NSEC3_SALT rdata element to string format and adds it to the output buffer
470 * \param[in] *rdf The rdata to convert
471 * \param[in] *output The buffer to add the data to
472 * \return LDNS_STATUS_OK on success, and error status on failure
474 ldns_status ldns_rdf2buffer_str_nsec3_salt(ldns_buffer *output, const ldns_rdf *rdf);
478 * Converts the data in the DNS packet to presentation
479 * format (as char *) and appends it to the given buffer
481 * \param[in] output pointer to the buffer to append the data to
482 * \param[in] k the pointer to the private key to convert
485 ldns_status ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k);
488 * Converts an LDNS_RDF_TYPE_INT8 rdata element to string format and adds it to the output buffer
489 * \param[in] *rdf The rdata to convert
490 * \param[in] *output The buffer to add the data to
491 * \return LDNS_STATUS_OK on success, and error status on failure
493 ldns_status ldns_rdf2buffer_str_int8(ldns_buffer *output, const ldns_rdf *rdf);
496 * Converts an LDNS_RDF_TYPE_INT16 rdata element to string format and adds it to the output buffer
497 * \param[in] *rdf The rdata to convert
498 * \param[in] *output The buffer to add the data to
499 * \return LDNS_STATUS_OK on success, and error status on failure
501 ldns_status ldns_rdf2buffer_str_int16(ldns_buffer *output, const ldns_rdf *rdf);
504 * Converts an LDNS_RDF_TYPE_INT32 rdata element to string format and adds it to the output buffer
505 * \param[in] *rdf The rdata to convert
506 * \param[in] *output The buffer to add the data to
507 * \return LDNS_STATUS_OK on success, and error status on failure
509 ldns_status ldns_rdf2buffer_str_int32(ldns_buffer *output, const ldns_rdf *rdf);
512 * Converts an LDNS_RDF_TYPE_TIME rdata element to string format and adds it to the output buffer
513 * \param[in] *rdf The rdata to convert
514 * \param[in] *output The buffer to add the data to
515 * \return LDNS_STATUS_OK on success, and error status on failure
517 ldns_status ldns_rdf2buffer_str_time(ldns_buffer *output, const ldns_rdf *rdf);
520 * Converts the data in the rdata field to presentation format and
521 * returns that as a char *.
522 * Remember to free it.
524 * \param[in] rdf The rdata field to convert
525 * \return null terminated char * data, or NULL on error
527 char *ldns_rdf2str(const ldns_rdf *rdf);
530 * Converts the data in the resource record to presentation format and
531 * returns that as a char *.
532 * Remember to free it.
534 * \param[in] rr The rdata field to convert
535 * \return null terminated char * data, or NULL on error
537 char *ldns_rr2str(const ldns_rr *rr);
540 * Converts the data in the resource record to presentation format and
541 * returns that as a char *.
542 * Remember to free it.
544 * \param[in] fmt how to format the resource record
545 * \param[in] rr The rdata field to convert
546 * \return null terminated char * data, or NULL on error
548 char *ldns_rr2str_fmt(const ldns_output_format *fmt, const ldns_rr *rr);
551 * Converts the data in the DNS packet to presentation format and
552 * returns that as a char *.
553 * Remember to free it.
555 * \param[in] pkt The rdata field to convert
556 * \return null terminated char * data, or NULL on error
558 char *ldns_pkt2str(const ldns_pkt *pkt);
561 * Converts the data in the DNS packet to presentation format and
562 * returns that as a char *.
563 * Remember to free it.
565 * \param[in] fmt how to format the packet
566 * \param[in] pkt The rdata field to convert
567 * \return null terminated char * data, or NULL on error
569 char *ldns_pkt2str_fmt(const ldns_output_format *fmt, const ldns_pkt *pkt);
572 * Converts a private key to the test presentation fmt and
573 * returns that as a char *.
574 * Remember to free it.
576 * \param[in] k the key to convert to text
577 * \return null terminated char * data, or NULL on error
579 char *ldns_key2str(const ldns_key *k);
582 * Converts a list of resource records to presentation format
583 * and returns that as a char *.
584 * Remember to free it.
586 * \param[in] rr_list the rr_list to convert to text
587 * \return null terminated char * data, or NULL on error
589 char *ldns_rr_list2str(const ldns_rr_list *rr_list);
592 * Converts a list of resource records to presentation format
593 * and returns that as a char *.
594 * Remember to free it.
596 * \param[in] fmt how to format the list of resource records
597 * \param[in] rr_list the rr_list to convert to text
598 * \return null terminated char * data, or NULL on error
600 char *ldns_rr_list2str_fmt(
601 const ldns_output_format *fmt, const ldns_rr_list *rr_list);
604 * Returns the data in the buffer as a null terminated char * string
605 * Buffer data must be char * type, and must be freed by the caller
607 * \param[in] buffer buffer containing char * data
608 * \return null terminated char * data, or NULL on error
610 char *ldns_buffer2str(ldns_buffer *buffer);
613 * Prints the data in the rdata field to the given file stream
614 * (in presentation format)
616 * \param[in] output the file stream to print to
617 * \param[in] rdf the rdata field to print
620 void ldns_rdf_print(FILE *output, const ldns_rdf *rdf);
623 * Prints the data in the resource record to the given file stream
624 * (in presentation format)
626 * \param[in] output the file stream to print to
627 * \param[in] rr the resource record to print
630 void ldns_rr_print(FILE *output, const ldns_rr *rr);
633 * Prints the data in the resource record to the given file stream
634 * (in presentation format)
636 * \param[in] output the file stream to print to
637 * \param[in] fmt format of the textual representation
638 * \param[in] rr the resource record to print
641 void ldns_rr_print_fmt(FILE *output,
642 const ldns_output_format *fmt, const ldns_rr *rr);
645 * Prints the data in the DNS packet to the given file stream
646 * (in presentation format)
648 * \param[in] output the file stream to print to
649 * \param[in] pkt the packet to print
652 void ldns_pkt_print(FILE *output, const ldns_pkt *pkt);
655 * Prints the data in the DNS packet to the given file stream
656 * (in presentation format)
658 * \param[in] output the file stream to print to
659 * \param[in] fmt format of the textual representation
660 * \param[in] pkt the packet to print
663 void ldns_pkt_print_fmt(FILE *output,
664 const ldns_output_format *fmt, const ldns_pkt *pkt);
667 * Converts a rr_list to presentation format and appends it to
669 * \param[in] output the buffer to append output to
670 * \param[in] list the ldns_rr_list to print
671 * \return ldns_status
673 ldns_status ldns_rr_list2buffer_str(ldns_buffer *output, const ldns_rr_list *list);
676 * Converts a rr_list to presentation format and appends it to
678 * \param[in] output the buffer to append output to
679 * \param[in] fmt format of the textual representation
680 * \param[in] list the ldns_rr_list to print
681 * \return ldns_status
683 ldns_status ldns_rr_list2buffer_str_fmt(ldns_buffer *output,
684 const ldns_output_format *fmt, const ldns_rr_list *list);
687 * Converts the header of a packet to presentation format and appends it to
689 * \param[in] output the buffer to append output to
690 * \param[in] pkt the packet to convert the header of
691 * \return ldns_status
693 ldns_status ldns_pktheader2buffer_str(ldns_buffer *output, const ldns_pkt *pkt);
696 * print a rr_list to output
697 * \param[in] output the fd to print to
698 * \param[in] list the rr_list to print
700 void ldns_rr_list_print(FILE *output, const ldns_rr_list *list);
703 * print a rr_list to output
704 * \param[in] output the fd to print to
705 * \param[in] fmt format of the textual representation
706 * \param[in] list the rr_list to print
708 void ldns_rr_list_print_fmt(FILE *output,
709 const ldns_output_format *fmt, const ldns_rr_list *list);
712 * Print a resolver (in sofar that is possible) state
714 * \param[in] output the fd to print to
715 * \param[in] r the resolver to print
717 void ldns_resolver_print(FILE *output, const ldns_resolver *r);
720 * Print a resolver (in sofar that is possible) state
722 * \param[in] output the fd to print to
723 * \param[in] fmt format of the textual representation
724 * \param[in] r the resolver to print
726 void ldns_resolver_print_fmt(FILE *output,
727 const ldns_output_format *fmt, const ldns_resolver *r);
730 * Print a zone structure * to output. Note the SOA record
731 * is included in this output
732 * \param[in] output the fd to print to
733 * \param[in] z the zone to print
735 void ldns_zone_print(FILE *output, const ldns_zone *z);
738 * Print a zone structure * to output. Note the SOA record
739 * is included in this output
740 * \param[in] output the fd to print to
741 * \param[in] fmt format of the textual representation
742 * \param[in] z the zone to print
744 void ldns_zone_print_fmt(FILE *output,
745 const ldns_output_format *fmt, const ldns_zone *z);
748 * Print the ldns_rdf containing a dname to the buffer
749 * \param[in] output the buffer to print to
750 * \param[in] dname the dname to print
751 * \return ldns_status message if the printing succeeded
753 ldns_status ldns_rdf2buffer_str_dname(ldns_buffer *output, const ldns_rdf *dname);
759 #endif /* LDNS_HOST2STR_H */