Changeset View
Changeset View
Standalone View
Standalone View
contrib/ldns/ldns/host2str.h
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
#define LDNS_COMMENT_NSEC3_CHAIN (1 << 6) /* yes */ | #define LDNS_COMMENT_NSEC3_CHAIN (1 << 6) /* yes */ | ||||
/** Print mark up */ | /** Print mark up */ | ||||
#define LDNS_COMMENT_LAYOUT (1 << 7) | #define LDNS_COMMENT_LAYOUT (1 << 7) | ||||
/** Also comment KEY_ID with RRSIGS **/ | /** Also comment KEY_ID with RRSIGS **/ | ||||
#define LDNS_COMMENT_RRSIGS (1 << 8) | #define LDNS_COMMENT_RRSIGS (1 << 8) | ||||
#define LDNS_FMT_ZEROIZE_RRSIGS (1 << 9) | #define LDNS_FMT_ZEROIZE_RRSIGS (1 << 9) | ||||
#define LDNS_FMT_PAD_SOA_SERIAL (1 << 10) | #define LDNS_FMT_PAD_SOA_SERIAL (1 << 10) | ||||
#define LDNS_FMT_RFC3597 (1 << 11) /* yes */ | #define LDNS_FMT_RFC3597 (1 << 11) /* yes */ | ||||
/** Prints only answer section of packets and only rdata of RRs **/ | |||||
#define LDNS_FMT_SHORT (1 << 12) | |||||
#define LDNS_FMT_FLAGS_WITH_DATA 2 | #define LDNS_FMT_FLAGS_WITH_DATA 2 | ||||
/** Show key id, type and size as comment for DNSKEY RR's */ | /** Show key id, type and size as comment for DNSKEY RR's */ | ||||
#define LDNS_COMMENT_KEY (LDNS_COMMENT_KEY_ID \ | #define LDNS_COMMENT_KEY (LDNS_COMMENT_KEY_ID \ | ||||
|LDNS_COMMENT_KEY_TYPE\ | |LDNS_COMMENT_KEY_TYPE\ | ||||
|LDNS_COMMENT_KEY_SIZE) | |LDNS_COMMENT_KEY_SIZE) | ||||
/** | /** | ||||
* Output format specifier | * Output format specifier | ||||
* | * | ||||
* Determines how Packets, Resource Records and Resource record data fiels are | * Determines how Packets, Resource Records and Resource record data field are | ||||
* formatted when printing or converting to string. | * formatted when printing or converting to string. | ||||
* Currently it is only used to specify what aspects of a Resource Record are | * Currently it is only used to specify what aspects of a Resource Record are | ||||
* annotated in the comment section of the textual representation the record. | * annotated in the comment section of the textual representation the record. | ||||
* This is speciefed with flags and potential exra data (such as for example | * This is specified with flags and potential extra data (such as for example | ||||
* a lookup map of hashes to real names for annotation NSEC3 records). | * a lookup map of hashes to real names for annotation NSEC3 records). | ||||
*/ | */ | ||||
struct ldns_struct_output_format | struct ldns_struct_output_format | ||||
{ | { | ||||
/** Specification of how RR's should be formatted in text */ | /** Specification of how RR's should be formatted in text */ | ||||
int flags; | int flags; | ||||
/** Potential extra data to be used with formatting RR's in text */ | /** Potential extra data to be used with formatting RR's in text */ | ||||
void *data; | void *data; | ||||
Show All 13 Lines | |||||
typedef struct ldns_struct_output_format_storage ldns_output_format_storage; | typedef struct ldns_struct_output_format_storage ldns_output_format_storage; | ||||
/** | /** | ||||
* Standard output format record that disables commenting in the textual | * Standard output format record that disables commenting in the textual | ||||
* representation of Resource Records completely. | * representation of Resource Records completely. | ||||
*/ | */ | ||||
extern const ldns_output_format *ldns_output_format_nocomments; | extern const ldns_output_format *ldns_output_format_nocomments; | ||||
/** | /** | ||||
* Standard output format record that annotated only DNSKEY RR's with commenti | * Standard output format record that annotated only DNSKEY RR's with comment | ||||
* text. | * text. | ||||
*/ | */ | ||||
extern const ldns_output_format *ldns_output_format_onlykeyids; | extern const ldns_output_format *ldns_output_format_onlykeyids; | ||||
/** | /** | ||||
* The default output format record. Same as ldns_output_format_onlykeyids. | * The default output format record. Same as ldns_output_format_onlykeyids. | ||||
*/ | */ | ||||
extern const ldns_output_format *ldns_output_format_default; | extern const ldns_output_format *ldns_output_format_default; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 387 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* \param[in] output pointer to the buffer to append the data to | * \param[in] output pointer to the buffer to append the data to | ||||
* \param[in] pkt the pointer to the packet to convert | * \param[in] pkt the pointer to the packet to convert | ||||
* \return status | * \return status | ||||
*/ | */ | ||||
ldns_status ldns_pkt2buffer_str(ldns_buffer *output, const ldns_pkt *pkt); | ldns_status ldns_pkt2buffer_str(ldns_buffer *output, const ldns_pkt *pkt); | ||||
/** | /** | ||||
* Converts the list of EDNS options to presentation | |||||
* format (as char *) and appends it to the given buffer | |||||
* | |||||
* \param[in] output pointer to the buffer to append the data to | |||||
* \param[in] edns_list the list of EDNS options | |||||
* \return status | |||||
*/ | |||||
ldns_status ldns_edns_option_list2buffer_str(ldns_buffer *output, | |||||
ldns_edns_option_list* edns_list); | |||||
/** | |||||
* Converts the data in the DNS packet to presentation | * Converts the data in the DNS packet to presentation | ||||
* format (as char *) and appends it to the given buffer | * format (as char *) and appends it to the given buffer | ||||
* | * | ||||
* \param[in] output pointer to the buffer to append the data to | * \param[in] output pointer to the buffer to append the data to | ||||
* \param[in] fmt how to format the textual representation of the packet | * \param[in] fmt how to format the textual representation of the packet | ||||
* \param[in] pkt the pointer to the packet to convert | * \param[in] pkt the pointer to the packet to convert | ||||
* \return status | * \return status | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Converts an LDNS_RDF_TYPE_HIP rdata element to presentation format for | * Converts an LDNS_RDF_TYPE_HIP rdata element to presentation format for | ||||
* the algorithm, HIT and Public Key and adds it the output buffer . | * the algorithm, HIT and Public Key and adds it the output buffer . | ||||
* \param[in] *rdf The rdata to convert | * \param[in] *rdf The rdata to convert | ||||
* \param[in] *output The buffer to add the data to | * \param[in] *output The buffer to add the data to | ||||
* \return LDNS_STATUS_OK on success, and error status on failure | * \return LDNS_STATUS_OK on success, and error status on failure | ||||
*/ | */ | ||||
ldns_status ldns_rdf2buffer_str_hip(ldns_buffer *output, | ldns_status ldns_rdf2buffer_str_hip(ldns_buffer *output, | ||||
const ldns_rdf *rdf); | |||||
/** | |||||
* Converts an LDNS_RDF_TYPE_AMTRELAY rdata element to presentation format for | |||||
* the precedence, D-bit, type and relay and adds it to the output buffer | |||||
* \param[in] *rdf The rdata to convert | |||||
* \param[in] *output The buffer to add the data to | |||||
* \return LDNS_STATUS_OK on success, and error status on failure | |||||
*/ | |||||
ldns_status ldns_rdf2buffer_str_amtrelay(ldns_buffer *output, | |||||
const ldns_rdf *rdf); | |||||
/** | |||||
* Converts an LDNS_RDF_TYPE_SVCPARAMS rdata element to presentation format. | |||||
* \param[in] *rdf The rdata to convert | |||||
* \param[in] *output The buffer to add the data to | |||||
* \return LDNS_STATUS_OK on success, and error status on failure | |||||
*/ | |||||
ldns_status ldns_rdf2buffer_str_svcparams(ldns_buffer *output, | |||||
const ldns_rdf *rdf); | const ldns_rdf *rdf); | ||||
/** | /** | ||||
* Converts the data in the rdata field to presentation format and | * Converts the data in the rdata field to presentation format and | ||||
* returns that as a char *. | * returns that as a char *. | ||||
* Remember to free it. | * Remember to free it. | ||||
* | * | ||||
* \param[in] rdf The rdata field to convert | * \param[in] rdf The rdata field to convert | ||||
▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines |