host2str.h File Reference

host2str.h - txt presentation of RRs More...

Go to the source code of this file.

Data Structures

struct  ldns_struct_output_format
 Output format specifier. More...
 
struct  ldns_struct_output_format_storage
 Output format struct with additional data for flags that use them. More...
 

Macros

#define LDNS_APL_IP4   1
 
#define LDNS_APL_IP6   2
 
#define LDNS_APL_MASK   0x7f
 
#define LDNS_APL_NEGATION   0x80
 
#define LDNS_COMMENT_NULLS   (1 << 0)
 Represent a NULL pointer (instead of a pointer to a ldns_rr as "; (null)" as opposed to outputting nothing at all in such a case. More...
 
#define LDNS_COMMENT_KEY_ID   (1 << 1)
 Show key id with DNSKEY RR's as comment. More...
 
#define LDNS_COMMENT_KEY_TYPE   (1 << 2)
 Show if a DNSKEY is a ZSK or KSK as comment. More...
 
#define LDNS_COMMENT_KEY_SIZE   (1 << 3)
 Show DNSKEY key size as comment. More...
 
#define LDNS_COMMENT_BUBBLEBABBLE   (1 << 4)
 Provide bubblebabble representation for DS RR's as comment. More...
 
#define LDNS_COMMENT_FLAGS   (1 << 5)
 Show when a NSEC3 RR has the optout flag set as comment. More...
 
#define LDNS_COMMENT_NSEC3_CHAIN   (1 << 6) /* yes */
 Show the unhashed owner and next owner names for NSEC3 RR's as comment. More...
 
#define LDNS_COMMENT_LAYOUT   (1 << 7)
 Print mark up. More...
 
#define LDNS_COMMENT_RRSIGS   (1 << 8)
 Also comment KEY_ID with RRSIGS. More...
 
#define LDNS_FMT_ZEROIZE_RRSIGS   (1 << 9)
 
#define LDNS_FMT_PAD_SOA_SERIAL   (1 << 10)
 
#define LDNS_FMT_RFC3597   (1 << 11) /* yes */
 
#define LDNS_FMT_SHORT   (1 << 12)
 Prints only answer section of packets and only rdata of RRs. More...
 
#define LDNS_FMT_FLAGS_WITH_DATA   2
 
#define LDNS_COMMENT_KEY
 Show key id, type and size as comment for DNSKEY RR's. More...
 

Typedefs

typedef struct ldns_struct_output_format ldns_output_format
 
typedef struct ldns_struct_output_format_storage ldns_output_format_storage
 

Functions

ldns_status ldns_output_format_set_type (ldns_output_format *fmt, ldns_rr_type type)
 Makes sure the LDNS_FMT_RFC3597 is set in the output format. More...
 
ldns_status ldns_output_format_clear_type (ldns_output_format *fmt, ldns_rr_type type)
 Makes sure the LDNS_FMT_RFC3597 is set in the output format. More...
 
ldns_status ldns_pkt_opcode2buffer_str (ldns_buffer *output, ldns_pkt_opcode opcode)
 Converts an ldns packet opcode value to its mnemonic, and adds that to the output buffer. More...
 
ldns_status ldns_pkt_rcode2buffer_str (ldns_buffer *output, ldns_pkt_rcode rcode)
 Converts an ldns packet rcode value to its mnemonic, and adds that to the output buffer. More...
 
ldns_status ldns_algorithm2buffer_str (ldns_buffer *output, ldns_algorithm algorithm)
 Converts an ldns algorithm type to its mnemonic, and adds that to the output buffer. More...
 
ldns_status ldns_cert_algorithm2buffer_str (ldns_buffer *output, ldns_cert_algorithm cert_algorithm)
 Converts an ldns certificate algorithm type to its mnemonic, and adds that to the output buffer. More...
 
char * ldns_pkt_opcode2str (ldns_pkt_opcode opcode)
 Converts a packet opcode to its mnemonic and returns that as an allocated null-terminated string. More...
 
char * ldns_pkt_rcode2str (ldns_pkt_rcode rcode)
 Converts a packet rcode to its mnemonic and returns that as an allocated null-terminated string. More...
 
char * ldns_pkt_algorithm2str (ldns_algorithm algorithm)
 Converts a signing algorithms to its mnemonic and returns that as an allocated null-terminated string. More...
 
char * ldns_pkt_cert_algorithm2str (ldns_cert_algorithm cert_algorithm)
 Converts a cert algorithm to its mnemonic and returns that as an allocated null-terminated string. More...
 
ldns_status ldns_rdf2buffer_str_a (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_A rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_aaaa (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_AAAA rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_str (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_STR rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_b64 (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_B64 rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_b32_ext (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_B32_EXT rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_hex (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_HEX rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_type (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_TYPE rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_class (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_CLASS rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_alg (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_ALG rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rr_type2buffer_str (ldns_buffer *output, const ldns_rr_type type)
 Converts an ldns_rr_type value to its string representation, and places it in the given buffer. More...
 
char * ldns_rr_type2str (const ldns_rr_type type)
 Converts an ldns_rr_type value to its string representation, and returns that string. More...
 
ldns_status ldns_rr_class2buffer_str (ldns_buffer *output, const ldns_rr_class klass)
 Converts an ldns_rr_class value to its string representation, and places it in the given buffer. More...
 
char * ldns_rr_class2str (const ldns_rr_class klass)
 Converts an ldns_rr_class value to its string representation, and returns that string. More...
 
ldns_status ldns_rdf2buffer_str_cert_alg (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_CERT rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_loc (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_LOC rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_unknown (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_UNKNOWN rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_nsap (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_NSAP rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_atma (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_ATMA rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_wks (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_WKS rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_nsec (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_NSEC rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_period (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_PERIOD rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_tsigtime (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_TSIGTIME rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_apl (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_APL rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_int16_data (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_INT16_DATA rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_ipseckey (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_IPSECKEY rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str (ldns_buffer *output, const ldns_rdf *rdf)
 Converts the data in the rdata field to presentation format (as char *) and appends it to the given buffer. More...
 
ldns_status ldns_rr2buffer_str (ldns_buffer *output, const ldns_rr *rr)
 Converts the data in the resource record to presentation format (as char *) and appends it to the given buffer. More...
 
ldns_status ldns_rr2buffer_str_fmt (ldns_buffer *output, const ldns_output_format *fmt, const ldns_rr *rr)
 Converts the data in the resource record to presentation format (as char *) and appends it to the given buffer. More...
 
ldns_status ldns_pkt2buffer_str (ldns_buffer *output, const ldns_pkt *pkt)
 Converts the data in the DNS packet to presentation format (as char *) and appends it to the given buffer. More...
 
ldns_status ldns_edns_option_list2buffer_str (ldns_buffer *output, ldns_edns_option_list *edns_list)
 Converts the list of EDNS options to presentation format (as char *) and appends it to the given buffer. More...
 
ldns_status ldns_pkt2buffer_str_fmt (ldns_buffer *output, const ldns_output_format *fmt, const ldns_pkt *pkt)
 Converts the data in the DNS packet to presentation format (as char *) and appends it to the given buffer. More...
 
ldns_status ldns_rdf2buffer_str_nsec3_salt (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_NSEC3_SALT rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_key2buffer_str (ldns_buffer *output, const ldns_key *k)
 Converts the data in the DNS packet to presentation format (as char *) and appends it to the given buffer. More...
 
ldns_status ldns_rdf2buffer_str_int8 (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_INT8 rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_int16 (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_INT16 rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_int32 (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_INT32 rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_time (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_TIME rdata element to string format and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_ilnp64 (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_ILNP64 rdata element to 4 hexadecimal numbers separated by colons and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_eui48 (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_EUI48 rdata element to 6 hexadecimal numbers separated by dashes and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_eui64 (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_EUI64 rdata element to 8 hexadecimal numbers separated by dashes and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_tag (ldns_buffer *output, const ldns_rdf *rdf)
 Adds the LDNS_RDF_TYPE_TAG rdata to the output buffer, provided it contains only alphanumeric characters. More...
 
ldns_status ldns_rdf2buffer_str_long_str (ldns_buffer *output, const ldns_rdf *rdf)
 Adds the LDNS_RDF_TYPE_LONG_STR rdata to the output buffer, in-between double quotes and all non printable characters properly escaped. More...
 
ldns_status ldns_rdf2buffer_str_hip (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_HIP rdata element to presentation format for the algorithm, HIT and Public Key and adds it the output buffer . More...
 
ldns_status ldns_rdf2buffer_str_amtrelay (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_AMTRELAY rdata element to presentation format for the precedence, D-bit, type and relay and adds it to the output buffer. More...
 
ldns_status ldns_rdf2buffer_str_svcparams (ldns_buffer *output, const ldns_rdf *rdf)
 Converts an LDNS_RDF_TYPE_SVCPARAMS rdata element to presentation format. More...
 
char * ldns_rdf2str (const ldns_rdf *rdf)
 Converts the data in the rdata field to presentation format and returns that as a char *. More...
 
char * ldns_rr2str (const ldns_rr *rr)
 Converts the data in the resource record to presentation format and returns that as a char *. More...
 
char * ldns_rr2str_fmt (const ldns_output_format *fmt, const ldns_rr *rr)
 Converts the data in the resource record to presentation format and returns that as a char *. More...
 
char * ldns_pkt2str (const ldns_pkt *pkt)
 Converts the data in the DNS packet to presentation format and returns that as a char *. More...
 
char * ldns_pkt2str_fmt (const ldns_output_format *fmt, const ldns_pkt *pkt)
 Converts the data in the DNS packet to presentation format and returns that as a char *. More...
 
char * ldns_key2str (const ldns_key *k)
 Converts a private key to the test presentation fmt and returns that as a char *. More...
 
char * ldns_rr_list2str (const ldns_rr_list *rr_list)
 Converts a list of resource records to presentation format and returns that as a char *. More...
 
char * ldns_rr_list2str_fmt (const ldns_output_format *fmt, const ldns_rr_list *rr_list)
 Converts a list of resource records to presentation format and returns that as a char *. More...
 
char * ldns_buffer2str (ldns_buffer *buffer)
 Returns a copy of the data in the buffer as a null terminated char * string. More...
 
char * ldns_buffer_export2str (ldns_buffer *buffer)
 Exports and returns the data in the buffer as a null terminated char * string. More...
 
void ldns_rdf_print (FILE *output, const ldns_rdf *rdf)
 Prints the data in the rdata field to the given file stream (in presentation format) More...
 
void ldns_rr_print (FILE *output, const ldns_rr *rr)
 Prints the data in the resource record to the given file stream (in presentation format) More...
 
void ldns_rr_print_fmt (FILE *output, const ldns_output_format *fmt, const ldns_rr *rr)
 Prints the data in the resource record to the given file stream (in presentation format) More...
 
void ldns_pkt_print (FILE *output, const ldns_pkt *pkt)
 Prints the data in the DNS packet to the given file stream (in presentation format) More...
 
void ldns_pkt_print_fmt (FILE *output, const ldns_output_format *fmt, const ldns_pkt *pkt)
 Prints the data in the DNS packet to the given file stream (in presentation format) More...
 
ldns_status ldns_rr_list2buffer_str (ldns_buffer *output, const ldns_rr_list *list)
 Converts a rr_list to presentation format and appends it to the output buffer. More...
 
ldns_status ldns_rr_list2buffer_str_fmt (ldns_buffer *output, const ldns_output_format *fmt, const ldns_rr_list *list)
 Converts a rr_list to presentation format and appends it to the output buffer. More...
 
ldns_status ldns_pktheader2buffer_str (ldns_buffer *output, const ldns_pkt *pkt)
 Converts the header of a packet to presentation format and appends it to the output buffer. More...
 
void ldns_rr_list_print (FILE *output, const ldns_rr_list *list)
 print a rr_list to output More...
 
void ldns_rr_list_print_fmt (FILE *output, const ldns_output_format *fmt, const ldns_rr_list *list)
 print a rr_list to output More...
 
void ldns_resolver_print (FILE *output, const ldns_resolver *r)
 Print a resolver (in sofar that is possible) state to output. More...
 
void ldns_resolver_print_fmt (FILE *output, const ldns_output_format *fmt, const ldns_resolver *r)
 Print a resolver (in sofar that is possible) state to output. More...
 
void ldns_zone_print (FILE *output, const ldns_zone *z)
 Print a zone structure * to output. More...
 
void ldns_zone_print_fmt (FILE *output, const ldns_output_format *fmt, const ldns_zone *z)
 Print a zone structure * to output. More...
 
ldns_status ldns_rdf2buffer_str_dname (ldns_buffer *output, const ldns_rdf *dname)
 Print the ldns_rdf containing a dname to the buffer. More...
 

Variables

const ldns_output_formatldns_output_format_nocomments
 Standard output format record that disables commenting in the textual representation of Resource Records completely. More...
 
const ldns_output_formatldns_output_format_onlykeyids
 Standard output format record that annotated only DNSKEY RR's with comment text. More...
 
const ldns_output_formatldns_output_format_default
 The default output format record. More...
 
const ldns_output_formatldns_output_format_bubblebabble
 Standard output format record that shows all DNSKEY related information in the comment text, plus the optout flag when set with NSEC3's, plus the bubblebabble representation of DS RR's. More...
 

Detailed Description

host2str.h - txt presentation of RRs

a Net::DNS like library for C

(c) NLnet Labs, 2005-2006

See the file LICENSE for the license

Contains functions to translate the main structures to their text representation, as well as functions to print them.

Definition in file host2str.h.

Macro Definition Documentation

◆ LDNS_APL_IP4

#define LDNS_APL_IP4   1

Definition at line 37 of file host2str.h.

◆ LDNS_APL_IP6

#define LDNS_APL_IP6   2

Definition at line 38 of file host2str.h.

◆ LDNS_APL_MASK

#define LDNS_APL_MASK   0x7f

Definition at line 39 of file host2str.h.

◆ LDNS_APL_NEGATION

#define LDNS_APL_NEGATION   0x80

Definition at line 40 of file host2str.h.

◆ LDNS_COMMENT_NULLS

#define LDNS_COMMENT_NULLS   (1 << 0)

Represent a NULL pointer (instead of a pointer to a ldns_rr as "; (null)" as opposed to outputting nothing at all in such a case.

Definition at line 48 of file host2str.h.

◆ LDNS_COMMENT_KEY_ID

#define LDNS_COMMENT_KEY_ID   (1 << 1)

Show key id with DNSKEY RR's as comment.

Definition at line 50 of file host2str.h.

◆ LDNS_COMMENT_KEY_TYPE

#define LDNS_COMMENT_KEY_TYPE   (1 << 2)

Show if a DNSKEY is a ZSK or KSK as comment.

Definition at line 52 of file host2str.h.

◆ LDNS_COMMENT_KEY_SIZE

#define LDNS_COMMENT_KEY_SIZE   (1 << 3)

Show DNSKEY key size as comment.

Definition at line 54 of file host2str.h.

◆ LDNS_COMMENT_BUBBLEBABBLE

#define LDNS_COMMENT_BUBBLEBABBLE   (1 << 4)

Provide bubblebabble representation for DS RR's as comment.

Definition at line 56 of file host2str.h.

◆ LDNS_COMMENT_FLAGS

#define LDNS_COMMENT_FLAGS   (1 << 5)

Show when a NSEC3 RR has the optout flag set as comment.

Definition at line 58 of file host2str.h.

◆ LDNS_COMMENT_NSEC3_CHAIN

#define LDNS_COMMENT_NSEC3_CHAIN   (1 << 6) /* yes */

Show the unhashed owner and next owner names for NSEC3 RR's as comment.

Definition at line 60 of file host2str.h.

◆ LDNS_COMMENT_LAYOUT

#define LDNS_COMMENT_LAYOUT   (1 << 7)

Print mark up.

Definition at line 62 of file host2str.h.

◆ LDNS_COMMENT_RRSIGS

#define LDNS_COMMENT_RRSIGS   (1 << 8)

Also comment KEY_ID with RRSIGS.

Definition at line 64 of file host2str.h.

◆ LDNS_FMT_ZEROIZE_RRSIGS

#define LDNS_FMT_ZEROIZE_RRSIGS   (1 << 9)

Definition at line 65 of file host2str.h.

◆ LDNS_FMT_PAD_SOA_SERIAL

#define LDNS_FMT_PAD_SOA_SERIAL   (1 << 10)

Definition at line 66 of file host2str.h.

◆ LDNS_FMT_RFC3597

#define LDNS_FMT_RFC3597   (1 << 11) /* yes */

Definition at line 67 of file host2str.h.

◆ LDNS_FMT_SHORT

#define LDNS_FMT_SHORT   (1 << 12)

Prints only answer section of packets and only rdata of RRs.

Definition at line 69 of file host2str.h.

◆ LDNS_FMT_FLAGS_WITH_DATA

#define LDNS_FMT_FLAGS_WITH_DATA   2

Definition at line 71 of file host2str.h.

◆ LDNS_COMMENT_KEY

#define LDNS_COMMENT_KEY
Value:
#define LDNS_COMMENT_KEY_SIZE
Show DNSKEY key size as comment.
Definition: host2str.h:54
#define LDNS_COMMENT_KEY_ID
Show key id with DNSKEY RR's as comment.
Definition: host2str.h:50
#define LDNS_COMMENT_KEY_TYPE
Show if a DNSKEY is a ZSK or KSK as comment.
Definition: host2str.h:52

Show key id, type and size as comment for DNSKEY RR's.

Definition at line 74 of file host2str.h.

Typedef Documentation

◆ ldns_output_format

Definition at line 1 of file host2str.h.

◆ ldns_output_format_storage

Definition at line 1 of file host2str.h.

Function Documentation

◆ ldns_output_format_set_type()

ldns_status ldns_output_format_set_type ( ldns_output_format fmt,
ldns_rr_type  type 
)

Makes sure the LDNS_FMT_RFC3597 is set in the output format.

Marks the type to be printed in RFC3597 format. /param[in] fmt the output format to update /param[in] the type to be printed in RFC3597 format /return LDNS_STATUS_OK on success

Definition at line 160 of file host2str.c.

References ldns_struct_output_format_storage::flags, and LDNS_FMT_RFC3597.

◆ ldns_output_format_clear_type()

ldns_status ldns_output_format_clear_type ( ldns_output_format fmt,
ldns_rr_type  type 
)

Makes sure the LDNS_FMT_RFC3597 is set in the output format.

Marks the type to not be printed in RFC3597 format. When no other types have been marked before, all known types (except the given one) will be marked for printing in RFC3597 format. /param[in] fmt the output format to update /param[in] the type not to be printed in RFC3597 format /return LDNS_STATUS_OK on success

Definition at line 180 of file host2str.c.

References ldns_struct_output_format_storage::flags, and LDNS_FMT_RFC3597.

◆ ldns_pkt_opcode2buffer_str()

ldns_status ldns_pkt_opcode2buffer_str ( ldns_buffer output,
ldns_pkt_opcode  opcode 
)

Converts an ldns packet opcode value to its mnemonic, and adds that to the output buffer.

Parameters
[in]*outputthe buffer to add the data to
[in]opcodeto find the string representation of
Returns
LDNS_STATUS_OK on success, or a buffer failure mode on error

Definition at line 200 of file host2str.c.

References ldns_buffer_printf(), ldns_lookup_by_id(), ldns_opcodes, and ldns_struct_lookup_table::name.

◆ ldns_pkt_rcode2buffer_str()

ldns_status ldns_pkt_rcode2buffer_str ( ldns_buffer output,
ldns_pkt_rcode  rcode 
)

Converts an ldns packet rcode value to its mnemonic, and adds that to the output buffer.

Parameters
[in]*outputthe buffer to add the data to
[in]rcodeto find the string representation of
Returns
LDNS_STATUS_OK on success, or a buffer failure mode on error

Definition at line 212 of file host2str.c.

References ldns_buffer_printf(), ldns_lookup_by_id(), ldns_rcodes, and ldns_struct_lookup_table::name.

◆ ldns_algorithm2buffer_str()

ldns_status ldns_algorithm2buffer_str ( ldns_buffer output,
ldns_algorithm  algorithm 
)

Converts an ldns algorithm type to its mnemonic, and adds that to the output buffer.

Parameters
[in]*outputthe buffer to add the data to
[in]algorithmto find the string representation of
Returns
LDNS_STATUS_OK on success, or a buffer failure mode on error

Definition at line 224 of file host2str.c.

References ldns_algorithms, ldns_buffer_printf(), ldns_lookup_by_id(), and ldns_struct_lookup_table::name.

◆ ldns_cert_algorithm2buffer_str()

ldns_status ldns_cert_algorithm2buffer_str ( ldns_buffer output,
ldns_cert_algorithm  cert_algorithm 
)

Converts an ldns certificate algorithm type to its mnemonic, and adds that to the output buffer.

Parameters
[in]*outputthe buffer to add the data to
[in]cert_algorithmto find the string representation of
Returns
LDNS_STATUS_OK on success, or a buffer failure mode on error

Definition at line 238 of file host2str.c.

References ldns_buffer_printf(), ldns_cert_algorithms, ldns_lookup_by_id(), and ldns_struct_lookup_table::name.

◆ ldns_pkt_opcode2str()

char* ldns_pkt_opcode2str ( ldns_pkt_opcode  opcode)

Converts a packet opcode to its mnemonic and returns that as an allocated null-terminated string.

Remember to free it.

Parameters
[in]opcodethe opcode to convert to text
Returns
null terminated char * data, or NULL on error

Definition at line 253 of file host2str.c.

References ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), ldns_pkt_opcode2buffer_str(), and LDNS_STATUS_OK.

◆ ldns_pkt_rcode2str()

char* ldns_pkt_rcode2str ( ldns_pkt_rcode  rcode)

Converts a packet rcode to its mnemonic and returns that as an allocated null-terminated string.

Remember to free it.

Parameters
[in]rcodethe rcode to convert to text
Returns
null terminated char * data, or NULL on error

Definition at line 273 of file host2str.c.

References ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), ldns_pkt_rcode2buffer_str(), and LDNS_STATUS_OK.

◆ ldns_pkt_algorithm2str()

char* ldns_pkt_algorithm2str ( ldns_algorithm  algorithm)

Converts a signing algorithms to its mnemonic and returns that as an allocated null-terminated string.

Remember to free it.

Parameters
[in]algorithmthe algorithm to convert to text
Returns
null terminated char * data, or NULL on error

Definition at line 293 of file host2str.c.

References ldns_algorithm2buffer_str(), ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), and LDNS_STATUS_OK.

◆ ldns_pkt_cert_algorithm2str()

char* ldns_pkt_cert_algorithm2str ( ldns_cert_algorithm  cert_algorithm)

Converts a cert algorithm to its mnemonic and returns that as an allocated null-terminated string.

Remember to free it.

Parameters
[in]cert_algorithmto convert to text
Returns
null terminated char * data, or NULL on error

Definition at line 314 of file host2str.c.

References ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), ldns_cert_algorithm2buffer_str(), and LDNS_STATUS_OK.

◆ ldns_rdf2buffer_str_a()

ldns_status ldns_rdf2buffer_str_a ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_A rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 428 of file host2str.c.

References INET_ADDRSTRLEN, ldns_buffer_printf(), and ldns_rdf_data().

◆ ldns_rdf2buffer_str_aaaa()

ldns_status ldns_rdf2buffer_str_aaaa ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_AAAA rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 439 of file host2str.c.

References INET6_ADDRSTRLEN, ldns_buffer_printf(), and ldns_rdf_data().

◆ ldns_rdf2buffer_str_str()

ldns_status ldns_rdf2buffer_str_str ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_STR rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 471 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf_data(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_b64()

ldns_status ldns_rdf2buffer_str_b64 ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_B64 rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 487 of file host2str.c.

References ldns_buffer_printf(), and ldns_rdf_size().

◆ ldns_rdf2buffer_str_b32_ext()

ldns_status ldns_rdf2buffer_str_b32_ext ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_B32_EXT rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 509 of file host2str.c.

References ldns_rdf_size(), and LDNS_STATUS_OK.

◆ ldns_rdf2buffer_str_hex()

ldns_status ldns_rdf2buffer_str_hex ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_HEX rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 530 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf_data(), and ldns_rdf_size().

◆ ldns_rdf2buffer_str_type()

ldns_status ldns_rdf2buffer_str_type ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_TYPE rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 558 of file host2str.c.

◆ ldns_rdf2buffer_str_class()

ldns_status ldns_rdf2buffer_str_class ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_CLASS rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 565 of file host2str.c.

◆ ldns_rdf2buffer_str_alg()

ldns_status ldns_rdf2buffer_str_alg ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_ALG rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 594 of file host2str.c.

References ldns_rdf2buffer_str_int8().

◆ ldns_rr_type2buffer_str()

ldns_status ldns_rr_type2buffer_str ( ldns_buffer output,
const ldns_rr_type  type 
)

Converts an ldns_rr_type value to its string representation, and places it in the given buffer.

Parameters
[in]*outputThe buffer to add the data to
[in]typethe ldns_rr_type to convert
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 617 of file host2str.c.

References ldns_struct_rr_descriptor::_name, ldns_buffer_printf(), ldns_rr_descript(), LDNS_RR_TYPE_ANY, LDNS_RR_TYPE_AXFR, LDNS_RR_TYPE_IXFR, LDNS_RR_TYPE_MAILA, and LDNS_RR_TYPE_MAILB.

◆ ldns_rr_type2str()

char* ldns_rr_type2str ( const ldns_rr_type  type)

Converts an ldns_rr_type value to its string representation, and returns that string.

For unknown types, the string "TYPE<id>" is returned. This function allocates data that must be freed by the caller

Parameters
[in]typethe ldns_rr_type to convert
Returns
a newly allocated string

Definition at line 650 of file host2str.c.

References ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), ldns_rr_type2buffer_str(), and LDNS_STATUS_OK.

◆ ldns_rr_class2buffer_str()

ldns_status ldns_rr_class2buffer_str ( ldns_buffer output,
const ldns_rr_class  klass 
)

Converts an ldns_rr_class value to its string representation, and places it in the given buffer.

Parameters
[in]*outputThe buffer to add the data to
[in]klassthe ldns_rr_class to convert
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 671 of file host2str.c.

References ldns_buffer_printf(), ldns_lookup_by_id(), ldns_rr_classes, and ldns_struct_lookup_table::name.

◆ ldns_rr_class2str()

char* ldns_rr_class2str ( const ldns_rr_class  klass)

Converts an ldns_rr_class value to its string representation, and returns that string.

For unknown types, the string "CLASS<id>" is returned. This function allocates data that must be freed by the caller

Parameters
[in]klassthe ldns_rr_class to convert
Returns
a newly allocated string

Definition at line 686 of file host2str.c.

References ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), ldns_rr_class2buffer_str(), and LDNS_STATUS_OK.

◆ ldns_rdf2buffer_str_cert_alg()

ldns_status ldns_rdf2buffer_str_cert_alg ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_CERT rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 580 of file host2str.c.

◆ ldns_rdf2buffer_str_loc()

ldns_status ldns_rdf2buffer_str_loc ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_LOC rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 705 of file host2str.c.

◆ ldns_rdf2buffer_str_unknown()

ldns_status ldns_rdf2buffer_str_unknown ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_UNKNOWN rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 797 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf2buffer_str_hex(), and ldns_rdf_size().

◆ ldns_rdf2buffer_str_nsap()

ldns_status ldns_rdf2buffer_str_nsap ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_NSAP rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 804 of file host2str.c.

References ldns_buffer_printf(), and ldns_rdf2buffer_str_hex().

◆ ldns_rdf2buffer_str_atma()

ldns_status ldns_rdf2buffer_str_atma ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_ATMA rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 811 of file host2str.c.

References ldns_rdf2buffer_str_hex().

◆ ldns_rdf2buffer_str_wks()

ldns_status ldns_rdf2buffer_str_wks ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_WKS rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 817 of file host2str.c.

References ldns_buffer_printf(), ldns_get_bit(), ldns_rdf_data(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_nsec()

ldns_status ldns_rdf2buffer_str_nsec ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_NSEC rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 905 of file host2str.c.

◆ ldns_rdf2buffer_str_period()

ldns_status ldns_rdf2buffer_str_period ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_PERIOD rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 937 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_tsigtime()

ldns_status ldns_rdf2buffer_str_tsigtime ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_TSIGTIME rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 948 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf_data(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_apl()

ldns_status ldns_rdf2buffer_str_apl ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_APL rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 972 of file host2str.c.

References ldns_rdf_data(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_int16_data()

ldns_status ldns_rdf2buffer_str_int16_data ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_INT16_DATA rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 1049 of file host2str.c.

References ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_ipseckey()

ldns_status ldns_rdf2buffer_str_ipseckey ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_IPSECKEY rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 1076 of file host2str.c.

References ldns_buffer_printf(), LDNS_FREE, LDNS_IP4ADDRLEN, LDNS_IP6ADDRLEN, ldns_rdf2buffer_str(), ldns_rdf_data(), ldns_rdf_deep_free(), ldns_rdf_new(), ldns_rdf_size(), LDNS_RDF_TYPE_A, LDNS_RDF_TYPE_AAAA, LDNS_RDF_TYPE_B64, LDNS_STATUS_ERR, LDNS_STATUS_MEM_ERR, LDNS_STATUS_OK, LDNS_STATUS_WIRE_RDATA_ERR, ldns_wire2dname(), and LDNS_XMALLOC.

◆ ldns_rdf2buffer_str()

ldns_status ldns_rdf2buffer_str ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts the data in the rdata field to presentation format (as char *) and appends it to the given buffer.

Parameters
[in]outputpointer to the buffer to append the data to
[in]rdfthe pointer to the rdafa field containing the data
Returns
status

Definition at line 1750 of file host2str.c.

◆ ldns_rr2buffer_str()

ldns_status ldns_rr2buffer_str ( ldns_buffer output,
const ldns_rr rr 
)

Converts the data in the resource record to presentation format (as char *) and appends it to the given buffer.

The presentation format of DNSKEY record is annotated with comments giving the id, type and size of the key.

Parameters
[in]outputpointer to the buffer to append the data to
[in]rrthe pointer to the rr field to convert
Returns
status

Definition at line 2032 of file host2str.c.

References ldns_output_format_default, and ldns_rr2buffer_str_fmt().

◆ ldns_rr2buffer_str_fmt()

ldns_status ldns_rr2buffer_str_fmt ( ldns_buffer output,
const ldns_output_format fmt,
const ldns_rr rr 
)

Converts the data in the resource record to presentation format (as char *) and appends it to the given buffer.

The presentation format is annotated with comments giving additional information on the record.

Parameters
[in]outputpointer to the buffer to append the data to
[in]fmthow to format the textual representation of the resource record.
[in]rrthe pointer to the rr field to convert
Returns
status

Definition at line 1808 of file host2str.c.

References ldns_struct_output_format_storage::flags, ldns_buffer_printf(), LDNS_COMMENT_NULLS, LDNS_FMT_SHORT, ldns_output_format_default, and LDNS_STATUS_OK.

◆ ldns_pkt2buffer_str()

ldns_status ldns_pkt2buffer_str ( ldns_buffer output,
const ldns_pkt pkt 
)

Converts the data in the DNS packet to presentation format (as char *) and appends it to the given buffer.

Parameters
[in]outputpointer to the buffer to append the data to
[in]pktthe pointer to the packet to convert
Returns
status

Definition at line 2817 of file host2str.c.

References ldns_output_format_default, and ldns_pkt2buffer_str_fmt().

◆ ldns_edns_option_list2buffer_str()

ldns_status ldns_edns_option_list2buffer_str ( ldns_buffer output,
ldns_edns_option_list edns_list 
)

Converts the list of EDNS options to presentation format (as char *) and appends it to the given buffer.

Parameters
[in]outputpointer to the buffer to append the data to
[in]edns_listthe list of EDNS options
Returns
status

Definition at line 2603 of file host2str.c.

References ldns_edns_get_code(), ldns_edns_get_data(), ldns_edns_get_size(), LDNS_EDNS_LLQ, ldns_edns_option_list_get_count(), and ldns_edns_option_list_get_option().

◆ ldns_pkt2buffer_str_fmt()

ldns_status ldns_pkt2buffer_str_fmt ( ldns_buffer output,
const ldns_output_format fmt,
const ldns_pkt pkt 
)

Converts the data in the DNS packet to presentation format (as char *) and appends it to the given buffer.

Parameters
[in]outputpointer to the buffer to append the data to
[in]fmthow to format the textual representation of the packet
[in]pktthe pointer to the packet to convert
Returns
status

Definition at line 2683 of file host2str.c.

References ldns_struct_output_format::flags, ldns_buffer_printf(), LDNS_FMT_SHORT, and LDNS_STATUS_OK.

◆ ldns_rdf2buffer_str_nsec3_salt()

ldns_status ldns_rdf2buffer_str_nsec3_salt ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_NSEC3_SALT rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 912 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf_data(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_key2buffer_str()

ldns_status ldns_key2buffer_str ( ldns_buffer output,
const ldns_key k 
)

Converts the data in the DNS packet to presentation format (as char *) and appends it to the given buffer.

Parameters
[in]outputpointer to the buffer to append the data to
[in]kthe pointer to the private key to convert
Returns
status

Definition at line 2953 of file host2str.c.

References LDNS_MAX_KEYLEN, LDNS_STATUS_ERR, LDNS_STATUS_OK, and LDNS_XMALLOC.

◆ ldns_rdf2buffer_str_int8()

ldns_status ldns_rdf2buffer_str_int8 ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_INT8 rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 389 of file host2str.c.

References ldns_buffer_printf(), and ldns_rdf_data().

◆ ldns_rdf2buffer_str_int16()

ldns_status ldns_rdf2buffer_str_int16 ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_INT16 rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 397 of file host2str.c.

◆ ldns_rdf2buffer_str_int32()

ldns_status ldns_rdf2buffer_str_int32 ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_INT32 rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 405 of file host2str.c.

◆ ldns_rdf2buffer_str_time()

ldns_status ldns_rdf2buffer_str_time ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_TIME rdata element to string format and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 413 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf2native_int32(), and ldns_serial_arithmetics_gmtime_r().

◆ ldns_rdf2buffer_str_ilnp64()

ldns_status ldns_rdf2buffer_str_ilnp64 ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_ILNP64 rdata element to 4 hexadecimal numbers separated by colons and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 1186 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_eui48()

ldns_status ldns_rdf2buffer_str_eui48 ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_EUI48 rdata element to 6 hexadecimal numbers separated by dashes and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 1200 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf_data(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_eui64()

ldns_status ldns_rdf2buffer_str_eui64 ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_EUI64 rdata element to 8 hexadecimal numbers separated by dashes and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 1213 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf_data(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_tag()

ldns_status ldns_rdf2buffer_str_tag ( ldns_buffer output,
const ldns_rdf rdf 
)

Adds the LDNS_RDF_TYPE_TAG rdata to the output buffer, provided it contains only alphanumeric characters.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 1227 of file host2str.c.

References ldns_buffer_printf(), ldns_rdf_data(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_long_str()

ldns_status ldns_rdf2buffer_str_long_str ( ldns_buffer output,
const ldns_rdf rdf 
)

Adds the LDNS_RDF_TYPE_LONG_STR rdata to the output buffer, in-between double quotes and all non printable characters properly escaped.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 1253 of file host2str.c.

References ldns_buffer_printf().

◆ ldns_rdf2buffer_str_hip()

ldns_status ldns_rdf2buffer_str_hip ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_HIP rdata element to presentation format for the algorithm, HIT and Public Key and adds it the output buffer .

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 1264 of file host2str.c.

References ldns_rdf_data(), ldns_rdf_size(), and LDNS_STATUS_WIRE_RDATA_ERR.

◆ ldns_rdf2buffer_str_amtrelay()

ldns_status ldns_rdf2buffer_str_amtrelay ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_AMTRELAY rdata element to presentation format for the precedence, D-bit, type and relay and adds it to the output buffer.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 1308 of file host2str.c.

References ldns_buffer_printf(), LDNS_FREE, LDNS_IP4ADDRLEN, LDNS_IP6ADDRLEN, ldns_rdf2buffer_str(), ldns_rdf_data(), ldns_rdf_deep_free(), ldns_rdf_new(), ldns_rdf_size(), LDNS_RDF_TYPE_A, LDNS_RDF_TYPE_AAAA, LDNS_STATUS_ERR, LDNS_STATUS_MEM_ERR, LDNS_STATUS_OK, LDNS_STATUS_WIRE_RDATA_ERR, ldns_wire2dname(), and LDNS_XMALLOC.

◆ ldns_rdf2buffer_str_svcparams()

ldns_status ldns_rdf2buffer_str_svcparams ( ldns_buffer output,
const ldns_rdf rdf 
)

Converts an LDNS_RDF_TYPE_SVCPARAMS rdata element to presentation format.

Parameters
[in]*rdfThe rdata to convert
[in]*outputThe buffer to add the data to
Returns
LDNS_STATUS_OK on success, and error status on failure

Definition at line 1550 of file host2str.c.

References ldns_rdf_data(), ldns_rdf_size(), LDNS_STATUS_NULL, and LDNS_STATUS_OK.

◆ ldns_rdf2str()

char* ldns_rdf2str ( const ldns_rdf rdf)

Converts the data in the rdata field to presentation format and returns that as a char *.

Remember to free it.

Parameters
[in]rdfThe rdata field to convert
Returns
null terminated char * data, or NULL on error

Definition at line 3268 of file host2str.c.

References ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), LDNS_MAX_PACKETLEN, ldns_rdf2buffer_str(), and LDNS_STATUS_OK.

◆ ldns_rr2str()

char* ldns_rr2str ( const ldns_rr rr)

Converts the data in the resource record to presentation format and returns that as a char *.

Remember to free it.

Parameters
[in]rrThe rdata field to convert
Returns
null terminated char * data, or NULL on error

Definition at line 3303 of file host2str.c.

References ldns_output_format_default, and ldns_rr2str_fmt().

◆ ldns_rr2str_fmt()

char* ldns_rr2str_fmt ( const ldns_output_format fmt,
const ldns_rr rr 
)

Converts the data in the resource record to presentation format and returns that as a char *.

Remember to free it.

Parameters
[in]fmthow to format the resource record
[in]rrThe rdata field to convert
Returns
null terminated char * data, or NULL on error

Definition at line 3285 of file host2str.c.

References ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), LDNS_MAX_PACKETLEN, ldns_rr2buffer_str_fmt(), and LDNS_STATUS_OK.

◆ ldns_pkt2str()

char* ldns_pkt2str ( const ldns_pkt pkt)

Converts the data in the DNS packet to presentation format and returns that as a char *.

Remember to free it.

Parameters
[in]pktThe rdata field to convert
Returns
null terminated char * data, or NULL on error

Definition at line 3328 of file host2str.c.

References ldns_output_format_default, and ldns_pkt2str_fmt().

◆ ldns_pkt2str_fmt()

char* ldns_pkt2str_fmt ( const ldns_output_format fmt,
const ldns_pkt pkt 
)

Converts the data in the DNS packet to presentation format and returns that as a char *.

Remember to free it.

Parameters
[in]fmthow to format the packet
[in]pktThe rdata field to convert
Returns
null terminated char * data, or NULL on error

Definition at line 3309 of file host2str.c.

References ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), LDNS_MAX_PACKETLEN, ldns_pkt2buffer_str_fmt(), and LDNS_STATUS_OK.

◆ ldns_key2str()

char* ldns_key2str ( const ldns_key k)

Converts a private key to the test presentation fmt and returns that as a char *.

Remember to free it.

Parameters
[in]kthe key to convert to text
Returns
null terminated char * data, or NULL on error

Definition at line 3334 of file host2str.c.

References ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), ldns_key2buffer_str(), LDNS_MAX_PACKETLEN, and LDNS_STATUS_OK.

◆ ldns_rr_list2str()

char* ldns_rr_list2str ( const ldns_rr_list rr_list)

Converts a list of resource records to presentation format and returns that as a char *.

Remember to free it.

Parameters
[in]rr_listthe rr_list to convert to text
Returns
null terminated char * data, or NULL on error

Definition at line 3380 of file host2str.c.

References ldns_output_format_default, and ldns_rr_list2str_fmt().

◆ ldns_rr_list2str_fmt()

char* ldns_rr_list2str_fmt ( const ldns_output_format fmt,
const ldns_rr_list rr_list 
)

Converts a list of resource records to presentation format and returns that as a char *.

Remember to free it.

Parameters
[in]fmthow to format the list of resource records
[in]rr_listthe rr_list to convert to text
Returns
null terminated char * data, or NULL on error

Definition at line 3351 of file host2str.c.

References ldns_struct_output_format::flags, ldns_buffer_export2str(), ldns_buffer_free(), ldns_buffer_new(), ldns_buffer_printf(), LDNS_COMMENT_NULLS, LDNS_MAX_PACKETLEN, ldns_output_format_default, ldns_rr_list2buffer_str_fmt(), and LDNS_STATUS_OK.

◆ ldns_buffer2str()

char* ldns_buffer2str ( ldns_buffer buffer)

Returns a copy of the data in the buffer as a null terminated char * string.

The returned string must be freed by the caller. The buffer must be in write modus and may thus not have been flipped.

Parameters
[in]bufferbuffer containing char * data
Returns
null terminated char * data, or NULL on error

Definition at line 3227 of file host2str.c.

◆ ldns_buffer_export2str()

char* ldns_buffer_export2str ( ldns_buffer buffer)

Exports and returns the data in the buffer as a null terminated char * string.

The returned string must be freed by the caller. The buffer must be in write modus and may thus not have been flipped. The buffer is fixed after this function returns.

Parameters
[in]bufferbuffer containing char * data
Returns
null terminated char * data, or NULL on error

Definition at line 3254 of file host2str.c.

References ldns_buffer_reserve().

◆ ldns_rdf_print()

void ldns_rdf_print ( FILE *  output,
const ldns_rdf rdf 
)

Prints the data in the rdata field to the given file stream (in presentation format)

Parameters
[in]outputthe file stream to print to
[in]rdfthe rdata field to print
Returns
void

Definition at line 3386 of file host2str.c.

References LDNS_FREE, and ldns_rdf2str().

◆ ldns_rr_print()

void ldns_rr_print ( FILE *  output,
const ldns_rr rr 
)

Prints the data in the resource record to the given file stream (in presentation format)

Parameters
[in]outputthe file stream to print to
[in]rrthe resource record to print
Returns
void

Definition at line 3411 of file host2str.c.

References ldns_output_format_default, and ldns_rr_print_fmt().

◆ ldns_rr_print_fmt()

void ldns_rr_print_fmt ( FILE *  output,
const ldns_output_format fmt,
const ldns_rr rr 
)

Prints the data in the resource record to the given file stream (in presentation format)

Parameters
[in]outputthe file stream to print to
[in]fmtformat of the textual representation
[in]rrthe resource record to print
Returns
void

Definition at line 3398 of file host2str.c.

References LDNS_FREE, and ldns_rr2str_fmt().

◆ ldns_pkt_print()

void ldns_pkt_print ( FILE *  output,
const ldns_pkt pkt 
)

Prints the data in the DNS packet to the given file stream (in presentation format)

Parameters
[in]outputthe file stream to print to
[in]pktthe packet to print
Returns
void

Definition at line 3430 of file host2str.c.

References ldns_output_format_default, and ldns_pkt_print_fmt().

◆ ldns_pkt_print_fmt()

void ldns_pkt_print_fmt ( FILE *  output,
const ldns_output_format fmt,
const ldns_pkt pkt 
)

Prints the data in the DNS packet to the given file stream (in presentation format)

Parameters
[in]outputthe file stream to print to
[in]fmtformat of the textual representation
[in]pktthe packet to print
Returns
void

Definition at line 3417 of file host2str.c.

References LDNS_FREE, and ldns_pkt2str_fmt().

◆ ldns_rr_list2buffer_str()

ldns_status ldns_rr_list2buffer_str ( ldns_buffer output,
const ldns_rr_list list 
)

Converts a rr_list to presentation format and appends it to the output buffer.

Parameters
[in]outputthe buffer to append output to
[in]listthe ldns_rr_list to print
Returns
ldns_status

Definition at line 2051 of file host2str.c.

References ldns_output_format_default, and ldns_rr_list2buffer_str_fmt().

◆ ldns_rr_list2buffer_str_fmt()

ldns_status ldns_rr_list2buffer_str_fmt ( ldns_buffer output,
const ldns_output_format fmt,
const ldns_rr_list list 
)

Converts a rr_list to presentation format and appends it to the output buffer.

Parameters
[in]outputthe buffer to append output to
[in]fmtformat of the textual representation
[in]listthe ldns_rr_list to print
Returns
ldns_status

Definition at line 2038 of file host2str.c.

References ldns_rr2buffer_str_fmt(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

◆ ldns_pktheader2buffer_str()

ldns_status ldns_pktheader2buffer_str ( ldns_buffer output,
const ldns_pkt pkt 
)

Converts the header of a packet to presentation format and appends it to the output buffer.

Parameters
[in]outputthe buffer to append output to
[in]pktthe packet to convert the header of
Returns
ldns_status

Definition at line 2058 of file host2str.c.

References ldns_buffer_printf(), ldns_lookup_by_id(), ldns_opcodes, ldns_pkt_aa(), ldns_pkt_ad(), ldns_pkt_ancount(), ldns_pkt_arcount(), ldns_pkt_cd(), ldns_pkt_get_opcode(), ldns_pkt_get_rcode(), ldns_pkt_id(), ldns_pkt_nscount(), ldns_pkt_qdcount(), ldns_pkt_qr(), ldns_pkt_ra(), ldns_pkt_rd(), ldns_pkt_tc(), ldns_rcodes, and ldns_struct_lookup_table::name.

◆ ldns_rr_list_print()

void ldns_rr_list_print ( FILE *  output,
const ldns_rr_list list 
)

print a rr_list to output

Parameters
[in]outputthe fd to print to
[in]listthe rr_list to print

Definition at line 3446 of file host2str.c.

References ldns_output_format_default, and ldns_rr_list_print_fmt().

◆ ldns_rr_list_print_fmt()

void ldns_rr_list_print_fmt ( FILE *  output,
const ldns_output_format fmt,
const ldns_rr_list list 
)

print a rr_list to output

Parameters
[in]outputthe fd to print to
[in]fmtformat of the textual representation
[in]listthe rr_list to print

Definition at line 3436 of file host2str.c.

References ldns_rr_list_rr(), ldns_rr_list_rr_count(), and ldns_rr_print_fmt().

◆ ldns_resolver_print()

void ldns_resolver_print ( FILE *  output,
const ldns_resolver r 
)

Print a resolver (in sofar that is possible) state to output.

Parameters
[in]outputthe fd to print to
[in]rthe resolver to print

Definition at line 3519 of file host2str.c.

References ldns_output_format_default, and ldns_resolver_print_fmt().

◆ ldns_resolver_print_fmt()

◆ ldns_zone_print()

void ldns_zone_print ( FILE *  output,
const ldns_zone z 
)

Print a zone structure * to output.

Note the SOA record is included in this output

Parameters
[in]outputthe fd to print to
[in]zthe zone to print

Definition at line 3533 of file host2str.c.

References ldns_output_format_default, and ldns_zone_print_fmt().

◆ ldns_zone_print_fmt()

void ldns_zone_print_fmt ( FILE *  output,
const ldns_output_format fmt,
const ldns_zone z 
)

Print a zone structure * to output.

Note the SOA record is included in this output

Parameters
[in]outputthe fd to print to
[in]fmtformat of the textual representation
[in]zthe zone to print

Definition at line 3525 of file host2str.c.

References ldns_rr_list_print_fmt(), ldns_rr_print_fmt(), ldns_zone_rrs(), and ldns_zone_soa().

◆ ldns_rdf2buffer_str_dname()

ldns_status ldns_rdf2buffer_str_dname ( ldns_buffer output,
const ldns_rdf dname 
)

Print the ldns_rdf containing a dname to the buffer.

Parameters
[in]outputthe buffer to print to
[in]dnamethe dname to print
Returns
ldns_status message if the printing succeeded

Definition at line 337 of file host2str.c.

References ldns_buffer_printf(), LDNS_MAX_DOMAINLEN, ldns_rdf_data(), ldns_rdf_size(), and LDNS_STATUS_DOMAINNAME_OVERFLOW.

Variable Documentation

◆ ldns_output_format_nocomments

const ldns_output_format* ldns_output_format_nocomments
extern

Standard output format record that disables commenting in the textual representation of Resource Records completely.

Definition at line 134 of file host2str.c.

◆ ldns_output_format_onlykeyids

const ldns_output_format* ldns_output_format_onlykeyids
extern

Standard output format record that annotated only DNSKEY RR's with comment text.

Definition at line 139 of file host2str.c.

◆ ldns_output_format_default

const ldns_output_format* ldns_output_format_default
extern

The default output format record.

Same as ldns_output_format_onlykeyids.

Definition at line 141 of file host2str.c.

◆ ldns_output_format_bubblebabble

const ldns_output_format* ldns_output_format_bubblebabble
extern

Standard output format record that shows all DNSKEY related information in the comment text, plus the optout flag when set with NSEC3's, plus the bubblebabble representation of DS RR's.

Definition at line 147 of file host2str.c.