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
67 #define LDNS_FMT_ZEROIZE_RRSIGS 0x0200
68 #define LDNS_FMT_PAD_SOA_SERIAL 0x0400
71 * Output format specifier
73 * Determines how Packets, Resource Records and Resource record data fiels are
74 * formatted when printing or converting to string.
75 * Currently it is only used to specify what aspects of a Resource Record are
76 * annotated in the comment section of the textual representation the record.
77 * This is speciefed with flags and potential exra data (such as for example
78 * a lookup map of hashes to real names for annotation NSEC3 records).
80 struct ldns_struct_output_format
82 /** Specification of how RR's should be formatted in text */
84 /** Potential extra data to be used with formatting RR's in text */
87 typedef struct ldns_struct_output_format ldns_output_format;
90 * Standard output format record that disables commenting in the textual
91 * representation of Resource Records completely.
93 extern const ldns_output_format *ldns_output_format_nocomments;
95 * Standard output format record that annotated only DNSKEY RR's with commenti
98 extern const ldns_output_format *ldns_output_format_onlykeyids;
100 * The default output format record. Same as ldns_output_format_onlykeyids.
102 extern const ldns_output_format *ldns_output_format_default;
104 * Standard output format record that shows all DNSKEY related information in
105 * the comment text, plus the optout flag when set with NSEC3's, plus the
106 * bubblebabble representation of DS RR's.
108 extern const ldns_output_format *ldns_output_format_bubblebabble;
111 * Converts an ldns packet opcode value to its mnemonic, and adds that
112 * to the output buffer
113 * \param[in] *output the buffer to add the data to
114 * \param[in] opcode to find the string representation of
115 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error
118 ldns_pkt_opcode2buffer_str(ldns_buffer *output, ldns_pkt_opcode opcode);
121 * Converts an ldns packet rcode value to its mnemonic, and adds that
122 * to the output buffer
123 * \param[in] *output the buffer to add the data to
124 * \param[in] rcode to find the string representation of
125 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error
128 ldns_pkt_rcode2buffer_str(ldns_buffer *output, ldns_pkt_rcode rcode);
131 * Converts an ldns algorithm type to its mnemonic, and adds that
132 * to the output buffer
133 * \param[in] *output the buffer to add the data to
134 * \param[in] algorithm to find the string representation of
135 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error
138 ldns_algorithm2buffer_str(ldns_buffer *output,
139 ldns_algorithm algorithm);
142 * Converts an ldns certificate algorithm type to its mnemonic,
143 * and adds that to the output buffer
144 * \param[in] *output the buffer to add the data to
145 * \param[in] cert_algorithm to find the string representation of
146 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error
149 ldns_cert_algorithm2buffer_str(ldns_buffer *output,
150 ldns_cert_algorithm cert_algorithm);
154 * Converts a packet opcode to its mnemonic and returns that as
155 * an allocated null-terminated string.
156 * Remember to free it.
158 * \param[in] opcode the opcode to convert to text
159 * \return null terminated char * data, or NULL on error
161 char *ldns_pkt_opcode2str(ldns_pkt_opcode opcode);
164 * Converts a packet rcode to its mnemonic and returns that as
165 * an allocated null-terminated string.
166 * Remember to free it.
168 * \param[in] rcode the rcode to convert to text
169 * \return null terminated char * data, or NULL on error
171 char *ldns_pkt_rcode2str(ldns_pkt_rcode rcode);
174 * Converts a signing algorithms to its mnemonic and returns that as
175 * an allocated null-terminated string.
176 * Remember to free it.
178 * \param[in] algorithm the algorithm to convert to text
179 * \return null terminated char * data, or NULL on error
181 char *ldns_pkt_algorithm2str(ldns_algorithm algorithm);
184 * Converts a cert algorithm to its mnemonic and returns that as
185 * an allocated null-terminated string.
186 * Remember to free it.
188 * \param[in] cert_algorithm to convert to text
189 * \return null terminated char * data, or NULL on error
191 char *ldns_pkt_cert_algorithm2str(ldns_cert_algorithm cert_algorithm);
194 * Converts an LDNS_RDF_TYPE_A rdata element to string format and adds it to the output buffer
195 * \param[in] *rdf The rdata to convert
196 * \param[in] *output The buffer to add the data to
197 * \return LDNS_STATUS_OK on success, and error status on failure
199 ldns_status ldns_rdf2buffer_str_a(ldns_buffer *output, const ldns_rdf *rdf);
202 * Converts an LDNS_RDF_TYPE_AAAA rdata element to string format and adds it to the output buffer
203 * \param[in] *rdf The rdata to convert
204 * \param[in] *output The buffer to add the data to
205 * \return LDNS_STATUS_OK on success, and error status on failure
207 ldns_status ldns_rdf2buffer_str_aaaa(ldns_buffer *output, const ldns_rdf *rdf);
210 * Converts an LDNS_RDF_TYPE_STR rdata element to string format and adds it to the output buffer
211 * \param[in] *rdf The rdata to convert
212 * \param[in] *output The buffer to add the data to
213 * \return LDNS_STATUS_OK on success, and error status on failure
215 ldns_status ldns_rdf2buffer_str_str(ldns_buffer *output, const ldns_rdf *rdf);
218 * Converts an LDNS_RDF_TYPE_B64 rdata element to string format and adds it to the output buffer
219 * \param[in] *rdf The rdata to convert
220 * \param[in] *output The buffer to add the data to
221 * \return LDNS_STATUS_OK on success, and error status on failure
223 ldns_status ldns_rdf2buffer_str_b64(ldns_buffer *output, const ldns_rdf *rdf);
226 * Converts an LDNS_RDF_TYPE_B32_EXT rdata element to string format and adds it to the output buffer
227 * \param[in] *rdf The rdata to convert
228 * \param[in] *output The buffer to add the data to
229 * \return LDNS_STATUS_OK on success, and error status on failure
231 ldns_status ldns_rdf2buffer_str_b32_ext(ldns_buffer *output, const ldns_rdf *rdf);
234 * Converts an LDNS_RDF_TYPE_HEX rdata element to string format and adds it to the output buffer
235 * \param[in] *rdf The rdata to convert
236 * \param[in] *output The buffer to add the data to
237 * \return LDNS_STATUS_OK on success, and error status on failure
239 ldns_status ldns_rdf2buffer_str_hex(ldns_buffer *output, const ldns_rdf *rdf);
242 * Converts an LDNS_RDF_TYPE_TYPE rdata element to string format and adds it to the output buffer
243 * \param[in] *rdf The rdata to convert
244 * \param[in] *output The buffer to add the data to
245 * \return LDNS_STATUS_OK on success, and error status on failure
247 ldns_status ldns_rdf2buffer_str_type(ldns_buffer *output, const ldns_rdf *rdf);
250 * Converts an LDNS_RDF_TYPE_CLASS rdata element to string format and adds it to the output buffer
251 * \param[in] *rdf The rdata to convert
252 * \param[in] *output The buffer to add the data to
253 * \return LDNS_STATUS_OK on success, and error status on failure
255 ldns_status ldns_rdf2buffer_str_class(ldns_buffer *output, const ldns_rdf *rdf);
258 * Converts an LDNS_RDF_TYPE_ALG rdata element to string format and adds it to the output buffer
259 * \param[in] *rdf The rdata to convert
260 * \param[in] *output The buffer to add the data to
261 * \return LDNS_STATUS_OK on success, and error status on failure
263 ldns_status ldns_rdf2buffer_str_alg(ldns_buffer *output, const ldns_rdf *rdf);
266 * Converts an ldns_rr_type value to its string representation,
267 * and places it in the given buffer
268 * \param[in] *output The buffer to add the data to
269 * \param[in] type the ldns_rr_type to convert
270 * \return LDNS_STATUS_OK on success, and error status on failure
272 ldns_status ldns_rr_type2buffer_str(ldns_buffer *output,
273 const ldns_rr_type type);
276 * Converts an ldns_rr_type value to its string representation,
277 * and returns that string. For unknown types, the string
278 * "TYPE<id>" is returned. This function allocates data that must be
279 * freed by the caller
280 * \param[in] type the ldns_rr_type to convert
281 * \return a newly allocated string
283 char *ldns_rr_type2str(const ldns_rr_type type);
286 * Converts an ldns_rr_class value to its string representation,
287 * and places it in the given buffer
288 * \param[in] *output The buffer to add the data to
289 * \param[in] klass the ldns_rr_class to convert
290 * \return LDNS_STATUS_OK on success, and error status on failure
292 ldns_status ldns_rr_class2buffer_str(ldns_buffer *output,
293 const ldns_rr_class klass);
296 * Converts an ldns_rr_class value to its string representation,
297 * and returns that string. For unknown types, the string
298 * "CLASS<id>" is returned. This function allocates data that must be
299 * freed by the caller
300 * \param[in] klass the ldns_rr_class to convert
301 * \return a newly allocated string
303 char *ldns_rr_class2str(const ldns_rr_class klass);
307 * Converts an LDNS_RDF_TYPE_CERT rdata element to string format and adds it to the output buffer
308 * \param[in] *rdf The rdata to convert
309 * \param[in] *output The buffer to add the data to
310 * \return LDNS_STATUS_OK on success, and error status on failure
312 ldns_status ldns_rdf2buffer_str_cert_alg(ldns_buffer *output, const ldns_rdf *rdf);
315 * Converts an LDNS_RDF_TYPE_LOC rdata element to string format and adds it to the output buffer
316 * \param[in] *rdf The rdata to convert
317 * \param[in] *output The buffer to add the data to
318 * \return LDNS_STATUS_OK on success, and error status on failure
320 ldns_status ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf);
323 * Converts an LDNS_RDF_TYPE_UNKNOWN rdata element to string format and adds it to the output buffer
324 * \param[in] *rdf The rdata to convert
325 * \param[in] *output The buffer to add the data to
326 * \return LDNS_STATUS_OK on success, and error status on failure
328 ldns_status ldns_rdf2buffer_str_unknown(ldns_buffer *output, const ldns_rdf *rdf);
331 * Converts an LDNS_RDF_TYPE_NSAP rdata element to string format and adds it to the output buffer
332 * \param[in] *rdf The rdata to convert
333 * \param[in] *output The buffer to add the data to
334 * \return LDNS_STATUS_OK on success, and error status on failure
336 ldns_status ldns_rdf2buffer_str_nsap(ldns_buffer *output, const ldns_rdf *rdf);
339 * Converts an LDNS_RDF_TYPE_ATMA rdata element to string format and adds it to the output buffer
340 * \param[in] *rdf The rdata to convert
341 * \param[in] *output The buffer to add the data to
342 * \return LDNS_STATUS_OK on success, and error status on failure
344 ldns_status ldns_rdf2buffer_str_atma(ldns_buffer *output, const ldns_rdf *rdf);
347 * Converts an LDNS_RDF_TYPE_WKS rdata element to string format and adds it to the output buffer
348 * \param[in] *rdf The rdata to convert
349 * \param[in] *output The buffer to add the data to
350 * \return LDNS_STATUS_OK on success, and error status on failure
352 ldns_status ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf);
355 * Converts an LDNS_RDF_TYPE_NSEC rdata element to string format and adds it to the output buffer
356 * \param[in] *rdf The rdata to convert
357 * \param[in] *output The buffer to add the data to
358 * \return LDNS_STATUS_OK on success, and error status on failure
360 ldns_status ldns_rdf2buffer_str_nsec(ldns_buffer *output, const ldns_rdf *rdf);
363 * Converts an LDNS_RDF_TYPE_PERIOD rdata element to string format and adds it to the output buffer
364 * \param[in] *rdf The rdata to convert
365 * \param[in] *output The buffer to add the data to
366 * \return LDNS_STATUS_OK on success, and error status on failure
368 ldns_status ldns_rdf2buffer_str_period(ldns_buffer *output, const ldns_rdf *rdf);
371 * Converts an LDNS_RDF_TYPE_TSIGTIME rdata element to string format and adds it to the output buffer
372 * \param[in] *rdf The rdata to convert
373 * \param[in] *output The buffer to add the data to
374 * \return LDNS_STATUS_OK on success, and error status on failure
376 ldns_status ldns_rdf2buffer_str_tsigtime(ldns_buffer *output, const ldns_rdf *rdf);
379 * Converts an LDNS_RDF_TYPE_APL rdata element to string format and adds it to the output buffer
380 * \param[in] *rdf The rdata to convert
381 * \param[in] *output The buffer to add the data to
382 * \return LDNS_STATUS_OK on success, and error status on failure
384 ldns_status ldns_rdf2buffer_str_apl(ldns_buffer *output, const ldns_rdf *rdf);
387 * Converts an LDNS_RDF_TYPE_INT16_DATA rdata element to string format and adds it to the output buffer
388 * \param[in] *rdf The rdata to convert
389 * \param[in] *output The buffer to add the data to
390 * \return LDNS_STATUS_OK on success, and error status on failure
392 ldns_status ldns_rdf2buffer_str_int16_data(ldns_buffer *output, const ldns_rdf *rdf);
395 * Converts an LDNS_RDF_TYPE_IPSECKEY rdata element to string format and adds it to the output buffer
396 * \param[in] *rdf The rdata to convert
397 * \param[in] *output The buffer to add the data to
398 * \return LDNS_STATUS_OK on success, and error status on failure
400 ldns_status ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf);
403 * Converts an LDNS_RDF_TYPE_TSIG rdata element to string format and adds it to the output buffer
404 * \param[in] *rdf The rdata to convert
405 * \param[in] *output The buffer to add the data to
406 * \return LDNS_STATUS_OK on success, and error status on failure
408 ldns_status ldns_rdf2buffer_str_tsig(ldns_buffer *output, const ldns_rdf *rdf);
412 * Converts the data in the rdata field to presentation
413 * format (as char *) and appends it to the given buffer
415 * \param[in] output pointer to the buffer to append the data to
416 * \param[in] rdf the pointer to the rdafa field containing the data
419 ldns_status ldns_rdf2buffer_str(ldns_buffer *output, const ldns_rdf *rdf);
422 * Converts the data in the resource record to presentation
423 * format (as char *) and appends it to the given buffer.
424 * The presentation format of DNSKEY record is annotated with comments giving
425 * the id, type and size of the key.
427 * \param[in] output pointer to the buffer to append the data to
428 * \param[in] rr the pointer to the rr field to convert
431 ldns_status ldns_rr2buffer_str(ldns_buffer *output, const ldns_rr *rr);
434 * Converts the data in the resource record to presentation
435 * format (as char *) and appends it to the given buffer.
436 * The presentation format is annotated with comments giving
437 * additional information on the record.
439 * \param[in] output pointer to the buffer to append the data to
440 * \param[in] fmt how to format the textual representation of the
442 * \param[in] rr the pointer to the rr field to convert
445 ldns_status ldns_rr2buffer_str_fmt(ldns_buffer *output,
446 const ldns_output_format *fmt, const ldns_rr *rr);
449 * Converts the data in the DNS packet to presentation
450 * format (as char *) and appends it to the given buffer
452 * \param[in] output pointer to the buffer to append the data to
453 * \param[in] pkt the pointer to the packet to convert
456 ldns_status ldns_pkt2buffer_str(ldns_buffer *output, const ldns_pkt *pkt);
459 * Converts the data in the DNS packet to presentation
460 * format (as char *) and appends it to the given buffer
462 * \param[in] output pointer to the buffer to append the data to
463 * \param[in] fmt how to format the textual representation of the packet
464 * \param[in] pkt the pointer to the packet to convert
467 ldns_status ldns_pkt2buffer_str_fmt(ldns_buffer *output,
468 const ldns_output_format *fmt, const ldns_pkt *pkt);
471 * Converts an LDNS_RDF_TYPE_NSEC3_SALT rdata element to string format and adds it to the output buffer
472 * \param[in] *rdf The rdata to convert
473 * \param[in] *output The buffer to add the data to
474 * \return LDNS_STATUS_OK on success, and error status on failure
476 ldns_status ldns_rdf2buffer_str_nsec3_salt(ldns_buffer *output, const ldns_rdf *rdf);
480 * Converts the data in the DNS packet to presentation
481 * format (as char *) and appends it to the given buffer
483 * \param[in] output pointer to the buffer to append the data to
484 * \param[in] k the pointer to the private key to convert
487 ldns_status ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k);
490 * Converts an LDNS_RDF_TYPE_INT8 rdata element to string format and adds it to the output buffer
491 * \param[in] *rdf The rdata to convert
492 * \param[in] *output The buffer to add the data to
493 * \return LDNS_STATUS_OK on success, and error status on failure
495 ldns_status ldns_rdf2buffer_str_int8(ldns_buffer *output, const ldns_rdf *rdf);
498 * Converts an LDNS_RDF_TYPE_INT16 rdata element to string format and adds it to the output buffer
499 * \param[in] *rdf The rdata to convert
500 * \param[in] *output The buffer to add the data to
501 * \return LDNS_STATUS_OK on success, and error status on failure
503 ldns_status ldns_rdf2buffer_str_int16(ldns_buffer *output, const ldns_rdf *rdf);
506 * Converts an LDNS_RDF_TYPE_INT32 rdata element to string format and adds it to the output buffer
507 * \param[in] *rdf The rdata to convert
508 * \param[in] *output The buffer to add the data to
509 * \return LDNS_STATUS_OK on success, and error status on failure
511 ldns_status ldns_rdf2buffer_str_int32(ldns_buffer *output, const ldns_rdf *rdf);
514 * Converts an LDNS_RDF_TYPE_TIME rdata element to string format and adds it to the output buffer
515 * \param[in] *rdf The rdata to convert
516 * \param[in] *output The buffer to add the data to
517 * \return LDNS_STATUS_OK on success, and error status on failure
519 ldns_status ldns_rdf2buffer_str_time(ldns_buffer *output, const ldns_rdf *rdf);
522 * Converts the data in the rdata field to presentation format and
523 * returns that as a char *.
524 * Remember to free it.
526 * \param[in] rdf The rdata field to convert
527 * \return null terminated char * data, or NULL on error
529 char *ldns_rdf2str(const ldns_rdf *rdf);
532 * Converts the data in the resource record to presentation format and
533 * returns that as a char *.
534 * Remember to free it.
536 * \param[in] rr The rdata field to convert
537 * \return null terminated char * data, or NULL on error
539 char *ldns_rr2str(const ldns_rr *rr);
542 * Converts the data in the resource record to presentation format and
543 * returns that as a char *.
544 * Remember to free it.
546 * \param[in] fmt how to format the resource record
547 * \param[in] rr The rdata field to convert
548 * \return null terminated char * data, or NULL on error
550 char *ldns_rr2str_fmt(const ldns_output_format *fmt, const ldns_rr *rr);
553 * Converts the data in the DNS packet to presentation format and
554 * returns that as a char *.
555 * Remember to free it.
557 * \param[in] pkt The rdata field to convert
558 * \return null terminated char * data, or NULL on error
560 char *ldns_pkt2str(const ldns_pkt *pkt);
563 * Converts the data in the DNS packet to presentation format and
564 * returns that as a char *.
565 * Remember to free it.
567 * \param[in] fmt how to format the packet
568 * \param[in] pkt The rdata field to convert
569 * \return null terminated char * data, or NULL on error
571 char *ldns_pkt2str_fmt(const ldns_output_format *fmt, const ldns_pkt *pkt);
574 * Converts a private key to the test presentation fmt and
575 * returns that as a char *.
576 * Remember to free it.
578 * \param[in] k the key to convert to text
579 * \return null terminated char * data, or NULL on error
581 char *ldns_key2str(const ldns_key *k);
584 * Converts a list of resource records to presentation format
585 * and returns that as a char *.
586 * Remember to free it.
588 * \param[in] rr_list the rr_list to convert to text
589 * \return null terminated char * data, or NULL on error
591 char *ldns_rr_list2str(const ldns_rr_list *rr_list);
594 * Converts a list of resource records to presentation format
595 * and returns that as a char *.
596 * Remember to free it.
598 * \param[in] fmt how to format the list of resource records
599 * \param[in] rr_list the rr_list to convert to text
600 * \return null terminated char * data, or NULL on error
602 char *ldns_rr_list2str_fmt(
603 const ldns_output_format *fmt, const ldns_rr_list *rr_list);
606 * Returns a copy of the data in the buffer as a null terminated
607 * char * string. The returned string must be freed by the caller.
608 * The buffer must be in write modus and may thus not have been flipped.
610 * \param[in] buffer buffer containing char * data
611 * \return null terminated char * data, or NULL on error
613 char *ldns_buffer2str(ldns_buffer *buffer);
616 * Exports and returns the data in the buffer as a null terminated
617 * char * string. The returned string must be freed by the caller.
618 * The buffer must be in write modus and may thus not have been flipped.
619 * The buffer is fixed after this function returns.
621 * \param[in] buffer buffer containing char * data
622 * \return null terminated char * data, or NULL on error
624 char *ldns_buffer_export2str(ldns_buffer *buffer);
627 * Prints the data in the rdata field to the given file stream
628 * (in presentation format)
630 * \param[in] output the file stream to print to
631 * \param[in] rdf the rdata field to print
634 void ldns_rdf_print(FILE *output, const ldns_rdf *rdf);
637 * Prints the data in the resource record to the given file stream
638 * (in presentation format)
640 * \param[in] output the file stream to print to
641 * \param[in] rr the resource record to print
644 void ldns_rr_print(FILE *output, const ldns_rr *rr);
647 * Prints the data in the resource record to the given file stream
648 * (in presentation format)
650 * \param[in] output the file stream to print to
651 * \param[in] fmt format of the textual representation
652 * \param[in] rr the resource record to print
655 void ldns_rr_print_fmt(FILE *output,
656 const ldns_output_format *fmt, const ldns_rr *rr);
659 * Prints the data in the DNS packet to the given file stream
660 * (in presentation format)
662 * \param[in] output the file stream to print to
663 * \param[in] pkt the packet to print
666 void ldns_pkt_print(FILE *output, const ldns_pkt *pkt);
669 * Prints the data in the DNS packet to the given file stream
670 * (in presentation format)
672 * \param[in] output the file stream to print to
673 * \param[in] fmt format of the textual representation
674 * \param[in] pkt the packet to print
677 void ldns_pkt_print_fmt(FILE *output,
678 const ldns_output_format *fmt, const ldns_pkt *pkt);
681 * Converts a rr_list to presentation format and appends it to
683 * \param[in] output the buffer to append output to
684 * \param[in] list the ldns_rr_list to print
685 * \return ldns_status
687 ldns_status ldns_rr_list2buffer_str(ldns_buffer *output, const ldns_rr_list *list);
690 * Converts a rr_list to presentation format and appends it to
692 * \param[in] output the buffer to append output to
693 * \param[in] fmt format of the textual representation
694 * \param[in] list the ldns_rr_list to print
695 * \return ldns_status
697 ldns_status ldns_rr_list2buffer_str_fmt(ldns_buffer *output,
698 const ldns_output_format *fmt, const ldns_rr_list *list);
701 * Converts the header of a packet to presentation format and appends it to
703 * \param[in] output the buffer to append output to
704 * \param[in] pkt the packet to convert the header of
705 * \return ldns_status
707 ldns_status ldns_pktheader2buffer_str(ldns_buffer *output, const ldns_pkt *pkt);
710 * print a rr_list to output
711 * \param[in] output the fd to print to
712 * \param[in] list the rr_list to print
714 void ldns_rr_list_print(FILE *output, const ldns_rr_list *list);
717 * print a rr_list to output
718 * \param[in] output the fd to print to
719 * \param[in] fmt format of the textual representation
720 * \param[in] list the rr_list to print
722 void ldns_rr_list_print_fmt(FILE *output,
723 const ldns_output_format *fmt, const ldns_rr_list *list);
726 * Print a resolver (in sofar that is possible) state
728 * \param[in] output the fd to print to
729 * \param[in] r the resolver to print
731 void ldns_resolver_print(FILE *output, const ldns_resolver *r);
734 * Print a resolver (in sofar that is possible) state
736 * \param[in] output the fd to print to
737 * \param[in] fmt format of the textual representation
738 * \param[in] r the resolver to print
740 void ldns_resolver_print_fmt(FILE *output,
741 const ldns_output_format *fmt, const ldns_resolver *r);
744 * Print a zone structure * to output. Note the SOA record
745 * is included in this output
746 * \param[in] output the fd to print to
747 * \param[in] z the zone to print
749 void ldns_zone_print(FILE *output, const ldns_zone *z);
752 * Print a zone structure * to output. Note the SOA record
753 * is included in this output
754 * \param[in] output the fd to print to
755 * \param[in] fmt format of the textual representation
756 * \param[in] z the zone to print
758 void ldns_zone_print_fmt(FILE *output,
759 const ldns_output_format *fmt, const ldns_zone *z);
762 * Print the ldns_rdf containing a dname to the buffer
763 * \param[in] output the buffer to print to
764 * \param[in] dname the dname to print
765 * \return ldns_status message if the printing succeeded
767 ldns_status ldns_rdf2buffer_str_dname(ldns_buffer *output, const ldns_rdf *dname);
773 #endif /* LDNS_HOST2STR_H */