1ldns(3) Library Functions Manual ldns(3)
2
3
4
6 ldns_wire2rr, ldns_wire2pkt, ldns_wire2rdf, ldns_wire2dname - convert
7 from wire format to host type
8
9
11 #include <stdint.h>
12 #include <stdbool.h>
13
14 #include <ldns/ldns.h>
15
16 ldns_status ldns_wire2rr(ldns_rr **rr, const uint8_t *wire, size_t max,
17 size_t *pos, ldns_pkt_section section);
18
19 ldns_status ldns_wire2pkt(ldns_pkt **packet, const uint8_t *data,
20 size_t len);
21
22 ldns_status ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max,
23 size_t *pos);
24
25 ldns_status ldns_wire2dname(ldns_rdf **dname, const uint8_t *wire,
26 size_t max, size_t *pos);
27
29 ldns_wire2rr() converts the data on the uint8_t bytearray (in wire for‐
30 mat) to a DNS resource record. This function will initialize
31 and allocate memory space for the rr structure. The length of
32 the wiredata of this rr is added to the *pos value.
33
34 rr: pointer to the structure to hold the rdata value
35 wire: pointer to the buffer with the data
36 max: the length of the data buffer (in bytes)
37 pos: the position of the rr in the buffer (ie. the number of
38 bytes from the start of the buffer)
39 section: the section in the packet the rr is meant for
40 Returns LDNS_STATUS_OK if everything succeeds, error otherwise
41
42 ldns_wire2pkt() converts the data on the uint8_t bytearray (in wire
43 format) to a DNS packet. This function will initialize and al‐
44 locate memory space for the packet structure.
45
46 packet: pointer to the structure to hold the packet
47 data: pointer to the buffer with the data
48 len: the length of the data buffer (in bytes)
49 Returns LDNS_STATUS_OK if everything succeeds, error otherwise
50
51 ldns_wire2rdf() converts the data on the uint8_t bytearray (in wire
52 format) to DNS rdata fields, and adds them to the list of rdfs
53 of the given rr. This function will initialize and allocate
54 memory space for the dname structures. The length of the wire‐
55 data of these rdfs is added to the *pos value.
56
57 All rdfs belonging to the RR are read; the rr should have no
58 rdfs yet. An error is returned if the format cannot be parsed.
59
60 rr: pointer to the ldns_rr structure to hold the rdata value
61 wire: pointer to the buffer with the data
62 max: the length of the data buffer (in bytes)
63 pos: the position of the rdf in the buffer (ie. the number of
64 bytes from the start of the buffer)
65 Returns LDNS_STATUS_OK if everything succeeds, error otherwise
66
67 ldns_wire2dname() converts the data on the uint8_t bytearray (in wire
68 format) to a DNS dname rdata field. This function will initial‐
69 ize and allocate memory space for the dname structure. The
70 length of the wiredata of this rdf is added to the *pos value.
71
72 dname: pointer to the structure to hold the rdata value
73 wire: pointer to the buffer with the data
74 max: the length of the data buffer (in bytes)
75 pos: the position of the rdf in the buffer (ie. the number of
76 bytes from the start of the buffer)
77 Returns LDNS_STATUS_OK if everything succeeds, error otherwise
78
80 The ldns team at NLnet Labs.
81
82
84 Please report bugs to ldns-team@nlnetlabs.nl or in our bugzilla at
85 http://www.nlnetlabs.nl/bugs/index.html
86
87
89 Copyright (c) 2004 - 2006 NLnet Labs.
90
91 Licensed under the BSD License. There is NO warranty; not even for MER‐
92 CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
93
94
96 ldns_rr2wire, ldns_pkt2wire, ldns_rdf2wire, ldns_dname2wire. And perl‐
97 doc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035.
98
100 This manpage was automatically generated from the ldns source code.
101
102
103
104 30 May 2006 ldns(3)