return ldns_buffer_status(output);
}
-/**
- * Converts A address
- */
ldns_status
ldns_rdf2buffer_str_a(ldns_buffer *output, ldns_rdf *rdf)
{
return ldns_buffer_status(output);
}
-/**
- * converts AAAA address
- */
ldns_status
ldns_rdf2buffer_str_aaaa(ldns_buffer *output, ldns_rdf *rdf)
{
return ldns_buffer_status(output);
}
-/**
- * Converts TXT rdata
- */
ldns_status
ldns_rdf2buffer_str_str(ldns_buffer *output, ldns_rdf *rdf)
{
return ldns_buffer_status(output);
}
-/**
- * Converts Base 64 encoded data
- */
ldns_status
ldns_rdf2buffer_str_b64(ldns_buffer *output, ldns_rdf *rdf)
{
return ldns_buffer_status(output);
}
-/**
- * Converts Hex encoded data
- * move this to general func?
- */
ldns_status
ldns_rdf2buffer_str_hex(ldns_buffer *output, ldns_rdf *rdf)
{
return ldns_buffer_status(output);
}
-/**
- * Converts type encoded data
- */
ldns_status
ldns_rdf2buffer_str_type(ldns_buffer *output, ldns_rdf *rdf)
{
return ldns_buffer_status(output);
}
-/**
- * Converts class encoded data
- */
ldns_status
ldns_rdf2buffer_str_class(ldns_buffer *output, ldns_rdf *rdf)
{
}
-/**
- * Returns string representation of the specified rdf
- * Data is not static
- */
ldns_status
ldns_rdf2buffer_str(ldns_buffer *buffer, ldns_rdf *rdf)
{
return ldns_buffer_status(output);
}
-/**
- * convert a rr_list
- * \param[in] output the buffer to output to
- * \param[in] list the list to print
- * \return ldns_status
- */
ldns_status
ldns_rr_list2buffer_str(ldns_buffer *output, ldns_rr_list *list)
{
return ldns_buffer_status(output);
}
-/**
- * Prints the header in default format in the given buffer
- */
ldns_status
ldns_pktheader2buffer_str(ldns_buffer *output, ldns_pkt *pkt)
{
return ldns_buffer_status(buffer);
}
-/**
- * convert a rrsig to wireformat BUT EXCLUDE the rrsig rdata
- * This is needed in DNSSEC verification
- * \param[out] *buffer buffer where to put the result
- * \param[in] *rr sigrr to operate on
- */
ldns_status
ldns_rrsig2buffer_wire(ldns_buffer *buffer, ldns_rr *rr)
{
return ldns_buffer_status(buffer);
}
-/**
- * convert a rr's rdata to wireformat, while excluding
- * the ownername and all the crap before the rdata.
- * This is needed in DNSSEC keytag calculation, the ds
- * calcalution from the key and maybe elsewhere.
- *
- * \param[out] *buffer buffer where to put the result
- * \param[in] *rr rr to operate on
- */
ldns_status
ldns_rr_rdata2buffer_wire(ldns_buffer *buffer, ldns_rr *rr)
{
}
/**
- * Copy the packet header data to the buffer in wire format
+ * Copies the packet header data to the buffer in wire format
*/
static ldns_status
ldns_hdr2buffer_wire(ldns_buffer *buffer, const ldns_pkt *packet)
return ldns_buffer_status(buffer);
}
-/**
- * Copy the packet data to the buffer in wire format
- */
ldns_status
ldns_pkt2buffer_wire(ldns_buffer *buffer, const ldns_pkt *packet)
{
return LDNS_STATUS_OK;
}
-/**
- * Allocates an array of uint8_t, and puts the wireformat of the
- * given rdf in that array. The result_size value contains the
- * length of the array, if it succeeds, and 0 otherwise (in which case
- * the function also returns NULL)
- */
uint8_t *
ldns_rdf2wire(const ldns_rdf *rdf, size_t *result_size)
{
return result;
}
-/**
- * Allocates an array of uint8_t, and puts the wireformat of the
- * given rr in that array. The result_size value contains the
- * length of the array, if it succeeds, and 0 otherwise (in which case
- * the function also returns NULL)
- *
- * If the section argument is LDNS_SECTION_QUESTION, data like ttl and rdata
- * are not put into the result
- */
uint8_t *
ldns_rr2wire(const ldns_rr *rr, int section, size_t *result_size)
{
return result;
}
-/**
- * Allocates an array of uint8_t, and puts the wireformat of the
- * given packet in that array. The result_size value contains the
- * length of the array, if it succeeds, and 0 otherwise (in which case
- * the function also returns NULL)
- */
uint8_t *
ldns_pkt2wire(const ldns_pkt *packet, size_t *result_size)
{
#include "util.h"
+/**
+ * Converts an LDNS_RDF_TYPE_A rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_a(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_AAAA rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_aaaa(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_STR rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_str(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_B64 rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_b64(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_HEX rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_hex(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_TYPE rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_type(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_CLASS rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_class(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_ALG rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_alg(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_CERT rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_cert(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_LOC rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_loc(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_UNKNOWN rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_unknown(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_NSAP rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_nsap(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_WKS rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_wks(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_NSEC rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_nsec(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_PERIOD rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_period(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_TSIGTIME rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_tsigtime(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_APL rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_apl(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_TODO rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_todo(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_INT16_DATA rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_int16_data(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_IPSECKEY rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_TSIG rdata element to string format and adds it to the output buffer
+ * @param *rdf The rdata to convert
+ * @param *output The buffer to add the data to
+ * @return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_tsig(ldns_buffer *output, ldns_rdf *rdf);
+
+
/**
* Converts the data in the rdata field to presentation
* format (as char *) and appends it to the given buffer
*/
void ldns_pkt_print(FILE *output, ldns_pkt *pkt);
-ldns_status ldns_rr_list2buffer_str(ldns_buffer *, ldns_rr_list *);
+/**
+ * Converts a rr_list to presentation format and appends it to
+ * the output buffer
+ * \param[in] output the buffer to append output to
+ * \param[in] list the ldns_rr_list to print
+ * \return ldns_status
+ */
+ldns_status ldns_rr_list2buffer_str(ldns_buffer *output, ldns_rr_list *list);
+
+/**
+ * Converts the header of a packet to presentation format and appends it to
+ * the output buffer
+ * \param[in] output the buffer to append output to
+ * \param[in] pkt the packet to convert the header of
+ * \return ldns_status
+ */
+ldns_status ldns_pktheader2buffer_str(ldns_buffer *output, ldns_pkt *pkt);
+
void ldns_rr_list_print(FILE *, ldns_rr_list *);
void ldns_resolver_print(FILE *, ldns_resolver *);
ldns_status ldns_rdf2buffer_wire(ldns_buffer *, const ldns_rdf *);
ldns_status ldns_rr2buffer_wire(ldns_buffer *, const ldns_rr *, int);
-ldns_status ldns_pkt2buffer_wire(ldns_buffer *, const ldns_pkt *);
-ldns_status ldns_rr_rdata2buffer_wire(ldns_buffer *, ldns_rr *);
-ldns_status ldns_rrsig2buffer_wire(ldns_buffer *, ldns_rr *);
+
+/**
+ * Converts a rrsig to wireformat BUT EXCLUDE the rrsig rdata
+ * This is needed in DNSSEC verification
+ * \param[out] output buffer to append the result to
+ * \param[in] sigrr signature rr to operate on
+ * \return ldns_status
+ */
+ldns_status ldns_rrsig2buffer_wire(ldns_buffer *output, ldns_rr *sigrr);
+
+/**
+ * Converts an rr's rdata to wireformat, while excluding
+ * the ownername and all the crap before the rdata.
+ * This is needed in DNSSEC keytag calculation, the ds
+ * calcalution from the key and maybe elsewhere.
+ *
+ * \param[out] *output buffer where to put the result
+ * \param[in] *rr rr to operate on
+ * \return ldns_status
+ */
+ldns_status ldns_rr_rdata2buffer_wire(ldns_buffer *output, ldns_rr *rr);
+
+/**
+ * Copies the packet data to the buffer in wire format
+ * \param[out] *output buffer to append the result to
+ * \param[in] *pkt packet to convert
+ * \return ldns_status
+ */
+ldns_status ldns_pkt2buffer_wire(ldns_buffer *output, const ldns_pkt *pkt);
ldns_status ldns_rr_list2buffer_wire(ldns_buffer *, ldns_rr_list *);
+
+/**
+ * Allocates an array of uint8_t, and puts the wireformat of the
+ * given rdf in that array. The result_size value contains the
+ * length of the array, if it succeeds, and 0 otherwise (in which case
+ * the function also returns NULL)
+ */
uint8_t *ldns_rdf2wire(const ldns_rdf *, size_t *);
+
+/**
+ * Allocates an array of uint8_t, and puts the wireformat of the
+ * given rr in that array. The result_size value contains the
+ * length of the array, if it succeeds, and 0 otherwise (in which case
+ * the function also returns NULL)
+ *
+ * If the section argument is LDNS_SECTION_QUESTION, data like ttl and rdata
+ * are not put into the result
+ */
uint8_t *ldns_rr2wire(const ldns_rr *, int, size_t *);
+
+/**
+ * Allocates an array of uint8_t, and puts the wireformat of the
+ * given packet in that array. The result_size value contains the
+ * length of the array, if it succeeds, and 0 otherwise (in which case
+ * the function also returns NULL)
+ */
uint8_t *ldns_pkt2wire(const ldns_pkt *, size_t *);