ldns documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

host2str.h
Go to the documentation of this file.
1
18 #ifndef LDNS_HOST2STR_H
19 #define LDNS_HOST2STR_H
20
21 #include <ldns/common.h>
22 #include <ldns/error.h>
23 #include <ldns/rr.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>
29 #include <ctype.h>
30
31 #include "ldns/util.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #define LDNS_APL_IP4 1
38 #define LDNS_APL_IP6 2
39 #define LDNS_APL_MASK 0x7f
40 #define LDNS_APL_NEGATION 0x80
41
46 /* Flag Name Flag Nr. Has data associated
47 ---------------------------------------------------------------------*/
48 #define LDNS_COMMENT_NULLS (1 << 0)
49
50 #define LDNS_COMMENT_KEY_ID (1 << 1)
51
52 #define LDNS_COMMENT_KEY_TYPE (1 << 2)
53
54 #define LDNS_COMMENT_KEY_SIZE (1 << 3)
55
56 #define LDNS_COMMENT_BUBBLEBABBLE (1 << 4)
57
58 #define LDNS_COMMENT_FLAGS (1 << 5)
59
60 #define LDNS_COMMENT_NSEC3_CHAIN (1 << 6) /* yes */
61
62 #define LDNS_COMMENT_LAYOUT (1 << 7)
63
64 #define LDNS_COMMENT_RRSIGS (1 << 8)
65 #define LDNS_FMT_ZEROIZE_RRSIGS (1 << 9)
66 #define LDNS_FMT_PAD_SOA_SERIAL (1 << 10)
67 #define LDNS_FMT_RFC3597 (1 << 11) /* yes */
68
69 #define LDNS_FMT_FLAGS_WITH_DATA 2
70
72 #define LDNS_COMMENT_KEY (LDNS_COMMENT_KEY_ID \
73 |LDNS_COMMENT_KEY_TYPE\
74 |LDNS_COMMENT_KEY_SIZE)
75
86 struct ldns_struct_output_format
87 {
89 int flags;
91 void *data;
92 };
93 typedef struct ldns_struct_output_format ldns_output_format;
94
100 struct ldns_struct_output_format_storage
101 { int flags;
102 ldns_rbtree_t* hashmap; /* for LDNS_COMMENT_NSEC3_CHAIN */
103 ldns_rdf* bitmap; /* for LDNS_FMT_RFC3597 */
104 };
105 typedef struct ldns_struct_output_format_storage ldns_output_format_storage;
106
111 extern const ldns_output_format *ldns_output_format_nocomments;
116 extern const ldns_output_format *ldns_output_format_onlykeyids;
120 extern const ldns_output_format *ldns_output_format_default;
126 extern const ldns_output_format *ldns_output_format_bubblebabble;
127
133 INLINE
134 ldns_output_format* ldns_output_format_init(ldns_output_format_storage* fmt) {
135 fmt->flags = ldns_output_format_default->flags;
136 fmt->hashmap = NULL;
137 fmt->bitmap = NULL;
138 return (ldns_output_format*)fmt;
139 }
140
144 INLINE void ldns_output_format_set(ldns_output_format* fmt, int flag) {
145 fmt->flags |= flag;
146 }
147
151 INLINE void ldns_output_format_clear(ldns_output_format* fmt, int flag) {
152 fmt->flags &= !flag;
153 }
154
162 ldns_status
163 ldns_output_format_set_type(ldns_output_format* fmt, ldns_rr_type type);
164
174 ldns_status
175 ldns_output_format_clear_type(ldns_output_format* fmt, ldns_rr_type type);
176
184 ldns_status
185 ldns_pkt_opcode2buffer_str(ldns_buffer *output, ldns_pkt_opcode opcode);
186
194 ldns_status
195 ldns_pkt_rcode2buffer_str(ldns_buffer *output, ldns_pkt_rcode rcode);
196
204 ldns_status
205 ldns_algorithm2buffer_str(ldns_buffer *output,
206 ldns_algorithm algorithm);
207
215 ldns_status
216 ldns_cert_algorithm2buffer_str(ldns_buffer *output,
217 ldns_cert_algorithm cert_algorithm);
218
219
228 char *ldns_pkt_opcode2str(ldns_pkt_opcode opcode);
229
238 char *ldns_pkt_rcode2str(ldns_pkt_rcode rcode);
239
248 char *ldns_pkt_algorithm2str(ldns_algorithm algorithm);
249
258 char *ldns_pkt_cert_algorithm2str(ldns_cert_algorithm cert_algorithm);
259
266 ldns_status ldns_rdf2buffer_str_a(ldns_buffer *output, const ldns_rdf *rdf);
267
274 ldns_status ldns_rdf2buffer_str_aaaa(ldns_buffer *output, const ldns_rdf *rdf);
275
282 ldns_status ldns_rdf2buffer_str_str(ldns_buffer *output, const ldns_rdf *rdf);
283
290 ldns_status ldns_rdf2buffer_str_b64(ldns_buffer *output, const ldns_rdf *rdf);
291
298 ldns_status ldns_rdf2buffer_str_b32_ext(ldns_buffer *output, const ldns_rdf *rdf);
299
306 ldns_status ldns_rdf2buffer_str_hex(ldns_buffer *output, const ldns_rdf *rdf);
307
314 ldns_status ldns_rdf2buffer_str_type(ldns_buffer *output, const ldns_rdf *rdf);
315
322 ldns_status ldns_rdf2buffer_str_class(ldns_buffer *output, const ldns_rdf *rdf);
323
330 ldns_status ldns_rdf2buffer_str_alg(ldns_buffer *output, const ldns_rdf *rdf);
331
339 ldns_status ldns_rr_type2buffer_str(ldns_buffer *output,
340 const ldns_rr_type type);
341
350 char *ldns_rr_type2str(const ldns_rr_type type);
351
359 ldns_status ldns_rr_class2buffer_str(ldns_buffer *output,
360 const ldns_rr_class klass);
361
370 char *ldns_rr_class2str(const ldns_rr_class klass);
371
372
379 ldns_status ldns_rdf2buffer_str_cert_alg(ldns_buffer *output, const ldns_rdf *rdf);
380
387 ldns_status ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf);
388
395 ldns_status ldns_rdf2buffer_str_unknown(ldns_buffer *output, const ldns_rdf *rdf);
396
403 ldns_status ldns_rdf2buffer_str_nsap(ldns_buffer *output, const ldns_rdf *rdf);
404
411 ldns_status ldns_rdf2buffer_str_atma(ldns_buffer *output, const ldns_rdf *rdf);
412
419 ldns_status ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf);
420
427 ldns_status ldns_rdf2buffer_str_nsec(ldns_buffer *output, const ldns_rdf *rdf);
428
435 ldns_status ldns_rdf2buffer_str_period(ldns_buffer *output, const ldns_rdf *rdf);
436
443 ldns_status ldns_rdf2buffer_str_tsigtime(ldns_buffer *output, const ldns_rdf *rdf);
444
451 ldns_status ldns_rdf2buffer_str_apl(ldns_buffer *output, const ldns_rdf *rdf);
452
459 ldns_status ldns_rdf2buffer_str_int16_data(ldns_buffer *output, const ldns_rdf *rdf);
460
467 ldns_status ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf);
468
477 ldns_status ldns_rdf2buffer_str(ldns_buffer *output, const ldns_rdf *rdf);
478
489 ldns_status ldns_rr2buffer_str(ldns_buffer *output, const ldns_rr *rr);
490
503 ldns_status ldns_rr2buffer_str_fmt(ldns_buffer *output,
504 const ldns_output_format *fmt, const ldns_rr *rr);
505
514 ldns_status ldns_pkt2buffer_str(ldns_buffer *output, const ldns_pkt *pkt);
515
525 ldns_status ldns_pkt2buffer_str_fmt(ldns_buffer *output,
526 const ldns_output_format *fmt, const ldns_pkt *pkt);
527
534 ldns_status ldns_rdf2buffer_str_nsec3_salt(ldns_buffer *output, const ldns_rdf *rdf);
535
536
545 ldns_status ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k);
546
553 ldns_status ldns_rdf2buffer_str_int8(ldns_buffer *output, const ldns_rdf *rdf);
554
561 ldns_status ldns_rdf2buffer_str_int16(ldns_buffer *output, const ldns_rdf *rdf);
562
569 ldns_status ldns_rdf2buffer_str_int32(ldns_buffer *output, const ldns_rdf *rdf);
570
577 ldns_status ldns_rdf2buffer_str_time(ldns_buffer *output, const ldns_rdf *rdf);
578
586 ldns_status ldns_rdf2buffer_str_ilnp64(ldns_buffer *output,
587 const ldns_rdf *rdf);
588
596 ldns_status ldns_rdf2buffer_str_eui48(ldns_buffer *output,
597 const ldns_rdf *rdf);
598
606 ldns_status ldns_rdf2buffer_str_eui64(ldns_buffer *output,
607 const ldns_rdf *rdf);
608
616 ldns_status ldns_rdf2buffer_str_tag(ldns_buffer *output,
617 const ldns_rdf *rdf);
618
626 ldns_status ldns_rdf2buffer_str_long_str(ldns_buffer *output,
627 const ldns_rdf *rdf);
628
636 ldns_status ldns_rdf2buffer_str_hip(ldns_buffer *output,
637 const ldns_rdf *rdf);
638
647 char *ldns_rdf2str(const ldns_rdf *rdf);
648
657 char *ldns_rr2str(const ldns_rr *rr);
658
668 char *ldns_rr2str_fmt(const ldns_output_format *fmt, const ldns_rr *rr);
669
678 char *ldns_pkt2str(const ldns_pkt *pkt);
679
689 char *ldns_pkt2str_fmt(const ldns_output_format *fmt, const ldns_pkt *pkt);
690
699 char *ldns_key2str(const ldns_key *k);
700
709 char *ldns_rr_list2str(const ldns_rr_list *rr_list);
710
720 char *ldns_rr_list2str_fmt(
721 const ldns_output_format *fmt, const ldns_rr_list *rr_list);
722
731 char *ldns_buffer2str(ldns_buffer *buffer);
732
742 char *ldns_buffer_export2str(ldns_buffer *buffer);
743
752 void ldns_rdf_print(FILE *output, const ldns_rdf *rdf);
753
762 void ldns_rr_print(FILE *output, const ldns_rr *rr);
763
773 void ldns_rr_print_fmt(FILE *output,
774 const ldns_output_format *fmt, const ldns_rr *rr);
775
784 void ldns_pkt_print(FILE *output, const ldns_pkt *pkt);
785
795 void ldns_pkt_print_fmt(FILE *output,
796 const ldns_output_format *fmt, const ldns_pkt *pkt);
797
805 ldns_status ldns_rr_list2buffer_str(ldns_buffer *output, const ldns_rr_list *list);
806
815 ldns_status ldns_rr_list2buffer_str_fmt(ldns_buffer *output,
816 const ldns_output_format *fmt, const ldns_rr_list *list);
817
825 ldns_status ldns_pktheader2buffer_str(ldns_buffer *output, const ldns_pkt *pkt);
826
832 void ldns_rr_list_print(FILE *output, const ldns_rr_list *list);
833
840 void ldns_rr_list_print_fmt(FILE *output,
841 const ldns_output_format *fmt, const ldns_rr_list *list);
842
849 void ldns_resolver_print(FILE *output, const ldns_resolver *r);
850
858 void ldns_resolver_print_fmt(FILE *output,
859 const ldns_output_format *fmt, const ldns_resolver *r);
860
867 void ldns_zone_print(FILE *output, const ldns_zone *z);
868
876 void ldns_zone_print_fmt(FILE *output,
877 const ldns_output_format *fmt, const ldns_zone *z);
878
885 ldns_status ldns_rdf2buffer_str_dname(ldns_buffer *output, const ldns_rdf *dname);
886
887 #ifdef __cplusplus
888 }
889 #endif
890
891 #endif /* LDNS_HOST2STR_H */
ldns_struct_buffer
implementation of buffers to ease operations
Definition: buffer.h:50
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...
Definition: host2str.c:554
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 *...
Definition: host2str.c:2406
ldns_cert_algorithm
enum ldns_enum_cert_algorithm ldns_cert_algorithm
Definition: rdata.h:155
ldns_output_format_bubblebabble
const ldns_output_format * ldns_output_format_bubblebabble
Standard output format record that shows all DNSKEY related information in the comment text...
Definition: host2str.c:131
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...
Definition: host2str.c:890
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...
Definition: host2str.c:791
ldns_struct_output_format_storage
Output format struct with additional data for flags that use them.
Definition: host2str.h:100
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 *...
Definition: host2str.c:2431
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...
Definition: host2str.c:1027
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 .
Definition: host2str.c:1241
ldns_output_format_onlykeyids
const ldns_output_format * ldns_output_format_onlykeyids
Standard output format record that annotated only DNSKEY RR&#39;s with commenti text. ...
Definition: host2str.c:123
ldns_zone_print
void ldns_zone_print(FILE *output, const ldns_zone *z)
Print a zone structure * to output.
Definition: host2str.c:2636
ldns_struct_resolver
DNS stub resolver structure.
Definition: resolver.h:59
rdata.h
Defines ldns_rdf and functions to manipulate those.
ldns_rr_class
enum ldns_enum_rr_class ldns_rr_class
Definition: rr.h:64
ldns_struct_rr_list
List or Set of Resource Records.
Definition: rr.h:327
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...
Definition: host2str.c:396
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) ...
Definition: host2str.c:2514
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...
Definition: host2str.c:950
ldns_struct_output_format
Output format specifier.
Definition: host2str.h:86
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 *...
Definition: host2str.c:2388
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 *...
Definition: host2str.c:2454
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 *...
Definition: host2str.c:2483
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) ...
Definition: host2str.c:2533
ldns_output_format_default
const ldns_output_format * ldns_output_format_default
The default output format record.
Definition: host2str.c:125
ldns_struct_output_format_storage::flags
int flags
Definition: host2str.h:101
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...
Definition: host2str.c:539
ldns_struct_zone
DNS Zone.
Definition: zone.h:42
rr.h
Contains the definition of ldns_rr and functions to manipulate those.
ldns_key2str
char * ldns_key2str(const ldns_key *k)
Converts a private key to the test presentation fmt and returns that as a char *. ...
Definition: host2str.c:2437
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) ...
Definition: host2str.c:2520
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 charact...
Definition: host2str.c:1204
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.
Definition: host2str.c:195
ldns_struct_rr
Resource Record.
Definition: rr.h:299
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...
Definition: host2str.c:797
INLINE
#define INLINE
splint static inline workaround
Definition: util.h:42
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...
Definition: host2str.c:532
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...
Definition: host2str.c:1054
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 bu...
Definition: host2str.c:1931
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...
Definition: host2str.c:650
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 *...
Definition: host2str.c:2371
error.h
Defines error numbers and functions to translate those to a readable string.
ldns_struct_key
General key structure, can contain all types of keys that are used in DNSSEC.
Definition: keys.h:107
ldns_struct_output_format_storage::hashmap
ldns_rbtree_t * hashmap
Definition: host2str.h:102
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...
Definition: host2str.c:915
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...
Definition: host2str.c:372
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...
Definition: host2str.c:236
ldns_pkt_opcode
enum ldns_enum_pkt_opcode ldns_pkt_opcode
Definition: packet.h:52
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...
Definition: host2str.c:568
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...
Definition: host2str.c:470
ldns_resolver_print
void ldns_resolver_print(FILE *output, const ldns_resolver *r)
Print a resolver (in sofar that is possible) state to output.
Definition: host2str.c:2622
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.
Definition: host2str.c:1690
ldns_buffer2str
char * ldns_buffer2str(ldns_buffer *buffer)
Returns a copy of the data in the buffer as a null terminated char * string.
Definition: host2str.c:2330
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.
Definition: host2str.c:163
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 i...
Definition: host2str.c:1177
ldns_struct_output_format::data
void * data
Potential extra data to be used with formatting RR&#39;s in text.
Definition: host2str.h:91
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 b...
Definition: host2str.c:1407
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) ...
Definition: host2str.c:2489
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...
Definition: host2str.c:1710
ldns_struct_output_format::flags
int flags
Specification of how RR&#39;s should be formatted in text.
Definition: host2str.h:89
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...
Definition: host2str.c:388
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 bu...
Definition: host2str.c:1883
resolver.h
Defines the ldns_resolver structure, a stub resolver that can send queries and parse answers...
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...
Definition: host2str.c:297
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...
Definition: host2str.c:926
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) ...
Definition: host2str.c:2501
ldns_pkt_rcode
enum ldns_enum_pkt_rcode ldns_pkt_rcode
Definition: packet.h:68
util.h
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...
Definition: host2str.c:256
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...
Definition: host2str.c:221
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...
Definition: host2str.c:411
ldns_buffer_export2str
char * ldns_buffer_export2str(ldns_buffer *buffer)
Exports and returns the data in the buffer as a null terminated char * string.
Definition: host2str.c:2357
ldns_rbtree_t
definition for tree struct
Definition: rbtree.h:83
ldns_struct_pkt
DNS packet.
Definition: packet.h:233
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...
Definition: host2str.c:777
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 giv...
Definition: host2str.c:1684
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.
Definition: host2str.c:629
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...
Definition: host2str.c:276
ldns_rr_list_print
void ldns_rr_list_print(FILE *output, const ldns_rr_list *list)
print a rr_list to output
Definition: host2str.c:2549
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
Definition: host2str.c:2539
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.
Definition: host2str.c:143
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...
Definition: host2str.c:504
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...
Definition: host2str.c:684
ldns_status
enum ldns_enum_status ldns_status
Definition: error.h:131
zone.h
zone.h
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...
Definition: host2str.c:380
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 *...
Definition: host2str.c:2412
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.
Definition: host2str.c:320
buffer.h
This file contains the definition of ldns_buffer, and functions to manipulate those.
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 ...
Definition: host2str.c:1163
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.
Definition: host2str.c:207
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.
Definition: host2str.c:665
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 prin...
Definition: host2str.c:1230
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 giv...
Definition: host2str.c:1465
ldns_struct_output_format_storage::bitmap
ldns_rdf * bitmap
Definition: host2str.h:103
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...
Definition: host2str.c:454
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...
Definition: host2str.c:483
packet.h
Contains the definition of ldns_pkt and its parts, as well as functions to manipulate those...
ldns_struct_rdf
Resource record data field.
Definition: rdata.h:166
ldns_output_format_nocomments
const ldns_output_format * ldns_output_format_nocomments
Standard output format record that disables commenting in the textual representation of Resource Reco...
Definition: host2str.c:118
common.h
Common definitions for LDNS.
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...
Definition: host2str.c:183
ldns_rr_type
enum ldns_enum_rr_type ldns_rr_type
Definition: rr.h:236
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...
Definition: host2str.c:595
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 bu...
Definition: host2str.c:1762
ldns_resolver_print_fmt
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.
Definition: host2str.c:2555
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...
Definition: host2str.c:422
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 i...
Definition: host2str.c:1190
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...
Definition: host2str.c:883
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...
Definition: host2str.c:784
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.
Definition: host2str.c:1703
ldns_algorithm
enum ldns_enum_algorithm ldns_algorithm
Definition: keys.h:62
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.
Definition: host2str.c:2628