Go to the source code of this file.
Macros | |
#define | LDNS_STATUS_CHECK_RETURN(st) {if (st != LDNS_STATUS_OK) { return st; }} |
#define | LDNS_STATUS_CHECK_GOTO(st, label) {if (st != LDNS_STATUS_OK) { /*printf("STG %s:%d: status code %d\n", __FILE__, __LINE__, st);*/ goto label; }} |
Functions | |
ldns_status | ldns_wire2dname (ldns_rdf **dname, const uint8_t *wire, size_t max, size_t *pos) |
converts the data on the uint8_t bytearray (in wire format) to a DNS dname rdata field. More... | |
ldns_status | ldns_wire2rdf (ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos) |
converts the data on the uint8_t bytearray (in wire format) to DNS rdata fields, and adds them to the list of rdfs of the given rr. More... | |
ldns_status | ldns_wire2rr (ldns_rr **rr_p, const uint8_t *wire, size_t max, size_t *pos, ldns_pkt_section section) |
converts the data on the uint8_t bytearray (in wire format) to a DNS resource record. More... | |
ldns_status | ldns_buffer2pkt_wire (ldns_pkt **packet, const ldns_buffer *buffer) |
converts the data in the ldns_buffer (in wire format) to a DNS packet. More... | |
ldns_status | ldns_wire2pkt (ldns_pkt **packet_p, const uint8_t *wire, size_t max) |
converts the data on the uint8_t bytearray (in wire format) to a DNS packet. More... | |
#define LDNS_STATUS_CHECK_RETURN | ( | st | ) | {if (st != LDNS_STATUS_OK) { return st; }} |
Definition at line 154 of file wire2host.c.
#define LDNS_STATUS_CHECK_GOTO | ( | st, | |
label | |||
) | {if (st != LDNS_STATUS_OK) { /*printf("STG %s:%d: status code %d\n", __FILE__, __LINE__, st);*/ goto label; }} |
Definition at line 155 of file wire2host.c.
ldns_status ldns_wire2dname | ( | ldns_rdf ** | dname, |
const uint8_t * | wire, | ||
size_t | max, | ||
size_t * | pos | ||
) |
converts the data on the uint8_t bytearray (in wire format) to a DNS dname rdata field.
This function will initialize and allocate memory space for the dname structure. The length of the wiredata of this rdf is added to the *pos value.
[out] | dname | pointer to the structure to hold the rdata value |
[in] | wire | pointer to the buffer with the data |
[in] | max | the length of the data buffer (in bytes) |
[in] | pos | the position of the rdf in the buffer (ie. the number of bytes from the start of the buffer) |
Definition at line 56 of file wire2host.c.
References LDNS_MAX_DOMAINLEN, LDNS_STATUS_PACKET_OVERFLOW, and LDNS_STATUS_WIRE_RDATA_ERR.
ldns_status ldns_wire2rdf | ( | ldns_rr * | rr, |
const uint8_t * | wire, | ||
size_t | max, | ||
size_t * | pos | ||
) |
converts the data on the uint8_t bytearray (in wire format) to DNS rdata fields, and adds them to the list of rdfs of the given rr.
This function will initialize and allocate memory space for the dname structures. The length of the wiredata of these rdfs is added to the *pos value.
All rdfs belonging to the RR are read; the rr should have no rdfs yet. An error is returned if the format cannot be parsed.
[in] | rr | pointer to the ldns_rr structure to hold the rdata value |
[in] | wire | pointer to the buffer with the data |
[in] | max | the length of the data buffer (in bytes) |
[in] | pos | the position of the rdf in the buffer (ie. the number of bytes from the start of the buffer) |
Definition at line 158 of file wire2host.c.
References ldns_rr_descript(), ldns_rr_get_type(), and LDNS_STATUS_PACKET_OVERFLOW.
ldns_status ldns_wire2rr | ( | ldns_rr ** | rr, |
const uint8_t * | wire, | ||
size_t | max, | ||
size_t * | pos, | ||
ldns_pkt_section | section | ||
) |
converts the data on the uint8_t bytearray (in wire format) to a DNS resource record.
This function will initialize and allocate memory space for the rr structure. The length of the wiredata of this rr is added to the *pos value.
[out] | rr | pointer to the structure to hold the rdata value |
[in] | wire | pointer to the buffer with the data |
[in] | max | the length of the data buffer (in bytes) |
[in] | pos | the position of the rr in the buffer (ie. the number of bytes from the start of the buffer) |
[in] | section | the section in the packet the rr is meant for |
Definition at line 320 of file wire2host.c.
References ldns_rr_new(), ldns_rr_set_owner(), ldns_rr_set_type(), LDNS_STATUS_CHECK_GOTO, LDNS_STATUS_PACKET_OVERFLOW, and ldns_wire2dname().
ldns_status ldns_buffer2pkt_wire | ( | ldns_pkt ** | packet, |
const ldns_buffer * | buffer | ||
) |
converts the data in the ldns_buffer (in wire format) to a DNS packet.
This function will initialize and allocate memory space for the packet structure.
[out] | packet | pointer to the structure to hold the packet |
[in] | buffer | the buffer with the data |
Definition at line 396 of file wire2host.c.
References ldns_wire2pkt().
ldns_status ldns_wire2pkt | ( | ldns_pkt ** | packet, |
const uint8_t * | data, | ||
size_t | len | ||
) |
converts the data on the uint8_t bytearray (in wire format) to a DNS packet.
This function will initialize and allocate memory space for the packet structure.
[out] | packet | pointer to the structure to hold the packet |
[in] | data | pointer to the buffer with the data |
[in] | len | the length of the data buffer (in bytes) |
Definition at line 405 of file wire2host.c.
References ldns_pkt_new(), LDNS_STATUS_MEM_ERR, and LDNS_STATUS_OK.