From: Jelte Jansen Date: Wed, 23 Mar 2005 12:39:01 +0000 (+0000) Subject: doxygen comments -> .h + tweaking X-Git-Tag: release-0.50~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=310592efd544dd37597dd5179d3e2390550ef470;p=thirdparty%2Fldns.git doxygen comments -> .h + tweaking --- diff --git a/host2str.c b/host2str.c index 969e818a..13445084 100644 --- a/host2str.c +++ b/host2str.c @@ -165,9 +165,6 @@ ldns_rdf2buffer_str_time(ldns_buffer *output, ldns_rdf *rdf) return ldns_buffer_status(output); } -/** - * Converts A address - */ ldns_status ldns_rdf2buffer_str_a(ldns_buffer *output, ldns_rdf *rdf) { @@ -179,9 +176,6 @@ 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) { @@ -194,9 +188,6 @@ 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) { @@ -220,9 +211,6 @@ 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) { @@ -235,10 +223,6 @@ 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) { @@ -261,9 +245,6 @@ ldns_buffer_printf(output, "HEX: "); return ldns_buffer_status(output); } -/** - * Converts type encoded data - */ ldns_status ldns_rdf2buffer_str_type(ldns_buffer *output, ldns_rdf *rdf) { @@ -279,9 +260,6 @@ 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) { @@ -722,10 +700,6 @@ ldns_status ldns_rdf2buffer_str_tsig(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) { @@ -880,12 +854,6 @@ ldns_rr2buffer_str(ldns_buffer *output, ldns_rr *rr) 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) { @@ -898,9 +866,6 @@ 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) { diff --git a/host2wire.c b/host2wire.c index 5c5cee7b..f3eccee4 100644 --- a/host2wire.c +++ b/host2wire.c @@ -98,12 +98,6 @@ ldns_rr2buffer_wire(ldns_buffer *buffer, const ldns_rr *rr, int section) 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) { @@ -123,15 +117,6 @@ 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) { @@ -163,7 +148,7 @@ 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) @@ -203,9 +188,6 @@ 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) { @@ -275,12 +257,6 @@ 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) { @@ -297,15 +273,6 @@ 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) { @@ -322,12 +289,6 @@ 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) { diff --git a/ldns/dnssec.h b/ldns/dnssec.h index e582f1a1..17ee51f5 100644 --- a/ldns/dnssec.h +++ b/ldns/dnssec.h @@ -11,11 +11,11 @@ #ifndef _DNSSEC_H_ #define _DNSSEC_H_ -#include #include #include #include #include +#include #define MAX_KEYLEN 2048 #define DNSSEC_KEYPROTO 3 diff --git a/ldns/host2str.h b/ldns/host2str.h index 9b0361ca..f79221fc 100644 --- a/ldns/host2str.h +++ b/ldns/host2str.h @@ -13,6 +13,175 @@ #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 @@ -119,7 +288,24 @@ void ldns_rr_print(FILE *output, ldns_rr *rr); */ 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 *); diff --git a/ldns/host2wire.h b/ldns/host2wire.h index f4b12866..9da8c9f0 100644 --- a/ldns/host2wire.h +++ b/ldns/host2wire.h @@ -14,12 +14,62 @@ 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 *);