diff options
Diffstat (limited to 'ldns/host2wire.h')
-rw-r--r-- | ldns/host2wire.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/ldns/host2wire.h b/ldns/host2wire.h index 5eafe9ddc443..94693cda3666 100644 --- a/ldns/host2wire.h +++ b/ldns/host2wire.h @@ -40,6 +40,15 @@ extern "C" { ldns_status ldns_dname2buffer_wire(ldns_buffer *buffer, const ldns_rdf *name); /** + * Copies the dname data to the buffer in wire format + * \param[out] *buffer buffer to append the result to + * \param[in] *name rdata dname to convert + * \param[out] *compression_data data structure holding state for compression + * \return ldns_status + */ +ldns_status ldns_dname2buffer_wire_compress(ldns_buffer *buffer, const ldns_rdf *name, ldns_rbtree_t *compression_data); + +/** * Copies the rdata data to the buffer in wire format * \param[out] *output buffer to append the result to * \param[in] *rdf rdata to convert @@ -49,6 +58,15 @@ ldns_status ldns_rdf2buffer_wire(ldns_buffer *output, const ldns_rdf *rdf); /** * Copies the rdata data to the buffer in wire format + * \param[out] *output buffer to append the result to + * \param[in] *rdf rdata to convert + * \param[out] *compression_data data structure holding state for compression + * \return ldns_status + */ +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 * If the rdata is a dname, the letters will be lowercased * during the conversion * \param[out] *output buffer to append the result to @@ -71,6 +89,20 @@ ldns_status ldns_rr2buffer_wire(ldns_buffer *output, int section); /** + * Copies the rr data to the buffer in wire format while doing DNAME compression + * \param[out] *output buffer to append the result to + * \param[in] *rr resource record to convert + * \param[in] section the section in the packet this rr is supposed to be in + * (to determine whether to add rdata or not) + * \param[out] *compression_data data structure holding state information for compression + * \return ldns_status + */ +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, in canonical format * according to RFC3597 (every dname in rdata fields of RR's mentioned in * that RFC will be lowercased) @@ -145,9 +177,10 @@ ldns_status ldns_rdf2wire(uint8_t **dest, const ldns_rdf *rdf, size_t *size); * * \param[out] dest pointer to the array of bytes to be created * \param[in] rr the rr to convert + * \param[in] section the rr section, determines how the rr is written. * \param[out] size the size of the converted result */ -ldns_status ldns_rr2wire(uint8_t **dest, const ldns_rr *rr, int, size_t *size); +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 |