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 ldns_status ldns_pkt2buffer_wire_compress(ldns_buffer *output, const ldns_pkt *pkt, ldns_rbtree_t *compression_data);
157 
165 
176 ldns_status ldns_rdf2wire(uint8_t **dest, const ldns_rdf *rdf, size_t *size);
177 
192 ldns_status ldns_rr2wire(uint8_t **dest, const ldns_rr *rr, int section, size_t *size);
193 
204 ldns_status ldns_pkt2wire(uint8_t **dest, const ldns_pkt *p, size_t *size);
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 #endif /* LDNS_HOST2WIRE_H */
This file contains the definition of ldns_buffer, and functions to manipulate those.
Common definitions for LDNS.
Defines error numbers and functions to translate those to a readable string.
enum ldns_enum_status ldns_status
Definition: error.h:146
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:244
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:494
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:512
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:250
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:476
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:130
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:294
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_rdf2buffer_wire(ldns_buffer *output, const ldns_rdf *rdf)
Copies the rdata data to the buffer in wire format.
Definition: host2wire.c:109
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:376
ldns_status ldns_rr_rdata2buffer_wire(ldns_buffer *output, const ldns_rr *rr)
Converts an rr's rdata to wireformat, while excluding the ownername and all the stuff before the rdat...
Definition: host2wire.c:314
ldns_status ldns_pkt2buffer_wire_compress(ldns_buffer *output, const ldns_pkt *pkt, ldns_rbtree_t *compression_data)
Copies the packet data to the buffer in wire format.
Definition: host2wire.c:390
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_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:171
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:156
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:115
Contains the definition of ldns_pkt and its parts, as well as functions to manipulate those.
Defines ldns_rdf and functions to manipulate those.
Contains the definition of ldns_rr and functions to manipulate those.
definition for tree struct
Definition: rbtree.h:83
implementation of buffers to ease operations
Definition: buffer.h:51
DNS packet.
Definition: packet.h:235
Resource record data field.
Definition: rdata.h:197
List or Set of Resource Records.
Definition: rr.h:338
Resource Record.
Definition: rr.h:310