ldns  1.7.0
host2wire.h
Go to the documentation of this file.
1 /*
2  * host2wire.h - 2wire conversion routines
3  *
4  * a Net::DNS like library for C
5  *
6  * (c) NLnet Labs, 2005-2006
7  *
8  * See the file LICENSE for the license
9  */
10 
17 #ifndef LDNS_HOST2WIRE_H
18 #define LDNS_HOST2WIRE_H
19 
20 #include <ldns/common.h>
21 #include <ldns/error.h>
22 #include <ldns/rr.h>
23 #include <ldns/rdata.h>
24 #include <ldns/packet.h>
25 #include <ldns/buffer.h>
26 #include <ctype.h>
27 
28 #include "ldns/util.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
41 
49 ldns_status ldns_dname2buffer_wire_compress(ldns_buffer *buffer, const ldns_rdf *name, ldns_rbtree_t *compression_data);
50 
58 
66 ldns_status ldns_rdf2buffer_wire_compress(ldns_buffer *output, const ldns_rdf *rdf, ldns_rbtree_t *compression_data);
67 
77  const ldns_rdf *rdf);
78 
88  const ldns_rr *rr,
89  int section);
90 
101  const ldns_rr *rr,
102  int section,
103  ldns_rbtree_t *compression_data);
104 
116  const ldns_rr *rr,
117  int section);
118 
119 
128 
140 
148 
156 
167 ldns_status ldns_rdf2wire(uint8_t **dest, const ldns_rdf *rdf, size_t *size);
168 
183 ldns_status ldns_rr2wire(uint8_t **dest, const ldns_rr *rr, int section, size_t *size);
184 
191 ldns_status ldns_pkt2wire(uint8_t **dest, const ldns_pkt *p, size_t *size);
192 
193 #ifdef __cplusplus
194 }
195 #endif
196 
197 #endif /* LDNS_HOST2WIRE_H */
implementation of buffers to ease operations
Definition: buffer.h:50
ldns_status ldns_rr2wire(uint8_t **dest, const ldns_rr *rr, int section, size_t *size)
Allocates an array of uint8_t at dest, and puts the wireformat of the given rr in that array...
Definition: host2wire.c:461
Defines ldns_rdf and functions to manipulate those.
List or Set of Resource Records.
Definition: rr.h:330
Contains the definition of ldns_rr and functions to manipulate those.
Resource Record.
Definition: rr.h:302
ldns_status ldns_pkt2buffer_wire(ldns_buffer *output, const ldns_pkt *pkt)
Copies the packet data to the buffer in wire format.
Definition: host2wire.c:366
Defines error numbers and functions to translate those to a readable string.
ldns_status ldns_dname2buffer_wire(ldns_buffer *buffer, const ldns_rdf *name)
Copies the dname data to the buffer in wire format.
Definition: host2wire.c:20
ldns_status ldns_rdf2buffer_wire_compress(ldns_buffer *output, const ldns_rdf *rdf, ldns_rbtree_t *compression_data)
Copies the rdata data to the buffer in wire format.
Definition: host2wire.c:105
ldns_status ldns_rdf2buffer_wire(ldns_buffer *output, const ldns_rdf *rdf)
Copies the rdata data to the buffer in wire format.
Definition: host2wire.c:99
ldns_status ldns_rrsig2buffer_wire(ldns_buffer *output, const ldns_rr *sigrr)
Converts a rrsig to wireformat BUT EXCLUDE the rrsig rdata This is needed in DNSSEC verification...
Definition: host2wire.c:284
definition for tree struct
Definition: rbtree.h:83
DNS packet.
Definition: packet.h:233
ldns_status ldns_rr2buffer_wire(ldns_buffer *output, const ldns_rr *rr, int section)
Copies the rr data to the buffer in wire format.
Definition: host2wire.c:234
enum ldns_enum_status ldns_status
Definition: error.h:134
This file contains the definition of ldns_buffer, and functions to manipulate those.
ldns_status ldns_pkt2wire(uint8_t **dest, const ldns_pkt *p, size_t *size)
Allocates an array of uint8_t at dest, and puts the wireformat of the given packet in that array...
Definition: host2wire.c:479
Contains the definition of ldns_pkt and its parts, as well as functions to manipulate those...
Resource record data field.
Definition: rdata.h:174
Common definitions for LDNS.
ldns_status ldns_rr2buffer_wire_compress(ldns_buffer *output, const ldns_rr *rr, int section, ldns_rbtree_t *compression_data)
Copies the rr data to the buffer in wire format while doing DNAME compression.
Definition: host2wire.c:240
ldns_status ldns_rdf2wire(uint8_t **dest, const ldns_rdf *rdf, size_t *size)
Allocates an array of uint8_t at dest, and puts the wireformat of the given rdf in that array...
Definition: host2wire.c:443
ldns_status ldns_rdf2buffer_wire_canonical(ldns_buffer *output, const ldns_rdf *rdf)
Copies the rdata data to the buffer in wire format If the rdata is a dname, the letters will be lower...
Definition: host2wire.c:120
ldns_status ldns_rr_list2buffer_wire(ldns_buffer *output, const ldns_rr_list *rrlist)
Copies the rr_list data to the buffer in wire format.
Definition: host2wire.c:146
ldns_status ldns_dname2buffer_wire_compress(ldns_buffer *buffer, const ldns_rdf *name, ldns_rbtree_t *compression_data)
Copies the dname data to the buffer in wire format.
Definition: host2wire.c:26
ldns_status ldns_rr_rdata2buffer_wire(ldns_buffer *output, const ldns_rr *rr)
Converts an rr&#39;s rdata to wireformat, while excluding the ownername and all the stuff before the rdat...
Definition: host2wire.c:304
ldns_status ldns_rr2buffer_wire_canonical(ldns_buffer *output, const ldns_rr *rr, int section)
Copies the rr data to the buffer in wire format, in canonical format according to RFC3597 (every dnam...
Definition: host2wire.c:161