Go to the documentation of this file.
19 #ifdef HAVE_SYS_SOCKET_H
20 #include <sys/socket.h>
22 #ifdef HAVE_ARPA_INET_H
23 #include <arpa/inet.h>
32 #include <openssl/bn.h>
33 #include <openssl/rsa.h>
35 #include <openssl/dsa.h>
39 #ifndef INET_ADDRSTRLEN
40 #define INET_ADDRSTRLEN 16
42 #ifndef INET6_ADDRSTRLEN
43 #define INET6_ADDRSTRLEN 46
204 if (lt && lt->
name) {
209 return ldns_buffer_status(output);
216 if (lt && lt->
name) {
221 return ldns_buffer_status(output);
230 if (lt && lt->
name) {
235 return ldns_buffer_status(output);
244 if (lt && lt->
name) {
250 return ldns_buffer_status(output);
361 for(i = 0; i < len; i++) {
365 c = (
unsigned char) data[src_pos];
366 if(c ==
'.' || c ==
';' ||
367 c ==
'(' || c ==
')' ||
371 }
else if (!(isascii(c) && isgraph(c))) {
386 return ldns_buffer_status(output);
394 return ldns_buffer_status(output);
402 return ldns_buffer_status(output);
410 return ldns_buffer_status(output);
420 memset(&tm, 0,
sizeof(tm));
422 && strftime(date_buf, 15,
"%Y%m%d%H%M%S", &tm)) {
425 return ldns_buffer_status(output);
436 return ldns_buffer_status(output);
448 return ldns_buffer_status(output);
453 size_t amount,
const uint8_t* characters)
458 if (isprint((
int)ch) || ch ==
'\t') {
459 if (ch ==
'\"' || ch ==
'\\')
465 (
unsigned)(uint8_t) ch);
481 ldns_characters2buffer_str(output,
484 return ldns_buffer_status(output);
495 return ldns_buffer_status(output);
506 return ldns_buffer_status(output);
527 return ldns_buffer_status(output);
538 return ldns_buffer_status(output);
547 if (! ldns_output_format_covers_type(fmt, data) &&
555 return ldns_buffer_status(output);
561 return ldns_rdf2buffer_str_type_fmt(output,
577 return ldns_buffer_status(output);
591 return ldns_buffer_status(output);
601 loc_cm_print(
ldns_buffer *output, uint8_t mantissa, uint8_t exponent)
613 for(i=0; i<exponent-2; i++)
641 if (descriptor && descriptor->
_name) {
647 return ldns_buffer_status(output);
683 return ldns_buffer_status(output);
711 uint8_t horizontal_precision;
712 uint8_t vertical_precision;
716 char latitude_hemisphere;
717 char longitude_hemisphere;
722 uint32_t equator = (uint32_t) ldns_power(2, 31);
740 if (latitude > equator) {
741 latitude_hemisphere =
'N';
742 latitude = latitude - equator;
744 latitude_hemisphere =
'S';
745 latitude = equator - latitude;
747 h = latitude / (1000 * 60 * 60);
748 latitude = latitude % (1000 * 60 * 60);
749 m = latitude / (1000 * 60);
750 latitude = latitude % (1000 * 60);
751 s = (double) latitude / 1000.0;
753 h, m, s, latitude_hemisphere);
755 if (longitude > equator) {
756 longitude_hemisphere =
'E';
757 longitude = longitude - equator;
759 longitude_hemisphere =
'W';
760 longitude = equator - longitude;
762 h = longitude / (1000 * 60 * 60);
763 longitude = longitude % (1000 * 60 * 60);
764 m = longitude / (1000 * 60);
765 longitude = longitude % (1000 * 60);
766 s = (double) longitude / (1000.0);
768 h, m, s, longitude_hemisphere);
770 s = ((double) altitude) / 100;
773 if(altitude%100 != 0)
780 loc_cm_print(output, (size & 0xf0) >> 4, size & 0x0f);
783 loc_cm_print(output, (horizontal_precision & 0xf0) >> 4,
784 horizontal_precision & 0x0f);
787 loc_cm_print(output, (vertical_precision & 0xf0) >> 4,
788 vertical_precision & 0x0f);
791 return ldns_buffer_status(output);
821 struct protoent *protocol;
822 char *proto_name = NULL;
824 struct servent *service;
825 uint16_t current_service;
831 protocol = getprotobynumber((
int) protocol_nr);
832 if (protocol && (protocol->p_name != NULL)) {
833 proto_name = protocol->p_name;
839 #ifdef HAVE_ENDPROTOENT
843 for (current_service = 0;
844 current_service < (
ldns_rdf_size(rdf)-1)*8; current_service++) {
846 service = getservbyport((
int) htons(current_service),
848 if (service && service->s_name) {
853 #ifdef HAVE_ENDSERVENT
858 if(current_service == 65535) {
break; }
860 return ldns_buffer_status(output);
870 uint8_t window_block_nr;
871 uint8_t bitmap_length;
878 window_block_nr = data[pos];
879 bitmap_length = data[pos + 1];
884 for (bit_pos = 0; bit_pos < (bitmap_length) * 8; bit_pos++) {
888 type = 256 * (uint16_t) window_block_nr + bit_pos;
890 if (! ldns_output_format_covers_type(fmt, type) &&
900 pos += (uint16_t) bitmap_length;
902 return ldns_buffer_status(output);
908 return ldns_rdf2buffer_str_nsec_fmt(output,
923 salt_length = data[0];
925 if (salt_length == 0 || ((
size_t)salt_length)+1 >
ldns_rdf_size(rdf)) {
928 for (salt_pos = 0; salt_pos < salt_length; salt_pos++) {
934 return ldns_buffer_status(output);
945 return ldns_buffer_status(output);
952 uint64_t tsigtime = 0;
954 uint64_t d0, d1, d2, d3, d4, d5;
965 tsigtime = (d0<<40) | (d1<<32) | (d2<<24) | (d3<<16) | (d4<<8) | d5;
969 return ldns_buffer_status(output);
976 uint16_t address_family;
986 address_family = ldns_read_uint16(&data[pos]);
987 prefix = data[pos + 2];
997 for (i = 0; i < 4; i++) {
1001 if (i < (
unsigned short) adf_length) {
1018 for (i = 0; i < 16; i++) {
1019 if (i % 2 == 0 && i > 0) {
1022 if (i < (
unsigned short) adf_length) {
1036 "Unknown address family: %u data: ",
1038 for (i = 1; i < (
unsigned short) (4 + adf_length); i++) {
1044 pos += 4 + adf_length;
1046 return ldns_buffer_status(output);
1058 size = ldns_b64_ntop_calculate_size(
ldns_rdf_size(rdf) - 2);
1073 return ldns_buffer_status(output);
1084 uint8_t gateway_type;
1088 uint8_t *gateway_data;
1090 size_t public_key_size;
1091 uint8_t *public_key_data;
1100 precedence = data[0];
1101 gateway_type = data[1];
1102 algorithm = data[2];
1105 switch (gateway_type) {
1158 public_key_data =
LDNS_XMALLOC(uint8_t, public_key_size);
1159 if(!public_key_data) {
1163 memcpy(public_key_data, &data[offset], public_key_size);
1165 public_key_size, public_key_data);
1183 return ldns_buffer_status(output);
1197 return ldns_buffer_status(output);
1210 return ldns_buffer_status(output);
1224 return ldns_buffer_status(output);
1231 const uint8_t* chars;
1242 while (nchars > 0) {
1243 ch = (char)*chars++;
1244 if (! isalnum((
unsigned char)ch)) {
1250 return ldns_buffer_status(output);
1258 ldns_characters2buffer_str(output,
1261 return ldns_buffer_status(output);
1276 if ((hit_size = data[0]) == 0 ||
1277 (pk_size = ldns_read_uint16(data + 2)) == 0 ||
1278 rdf_size < (
size_t) hit_size + pk_size + 4) {
1285 for (data += 4; hit_size > 0; hit_size--, data++) {
1289 ldns_buffer_write_u8(output, (uint8_t)
' ');
1292 ldns_b64_ntop_calculate_size(pk_size))) {
1295 (
char *) ldns_buffer_current(output),
1296 ldns_buffer_remaining(output));
1299 written < (
int) ldns_buffer_remaining(output)) {
1304 return ldns_buffer_status(output);
1316 uint8_t discovery_optional;
1320 uint8_t *relay_data;
1328 precedence = data[0];
1329 discovery_optional = ((data[1] & 0x80) >> 7);
1330 relay_type = data[1] & 0x7F;
1333 switch (relay_type) {
1386 precedence, discovery_optional, relay_type);
1391 return ldns_buffer_status(output);
1394 #ifdef RRTYPE_SVCB_HTTPS
1398 svcparam_mandatory2buffer_str(
ldns_buffer *output,
size_t sz, uint8_t *data)
1403 svcparam_key2buffer_str(output, ldns_read_uint16(data));
1404 for (data += 2, sz -= 2; sz; data += 2, sz -= 2) {
1405 ldns_buffer_write_u8(output,
',');
1406 svcparam_key2buffer_str(output, ldns_read_uint16(data));
1408 return ldns_buffer_status(output);
1412 svcparam_alpn2buffer_str(
ldns_buffer *output,
size_t sz, uint8_t *data)
1414 uint8_t *eod = data + sz, *dp;
1418 for (dp = data; dp < eod && !quote; dp += 1 + *dp) {
1419 if (dp + 1 + *dp > eod)
1422 for (i = 0; i < *dp; i++)
1423 if (isspace(dp[i + 1]))
1428 ldns_buffer_write_u8(output,
'"');
1429 while (data < eod) {
1430 uint8_t *eot = data + 1 + *data;
1435 if (eod - data < (
int)sz)
1436 ldns_buffer_write_u8(output,
',');
1438 for (data += 1; data < eot; data += 1) {
1441 if (isprint(ch) || ch ==
'\t') {
1442 if (ch ==
'"' || ch ==
',' || ch ==
'\\')
1443 ldns_buffer_write_u8(output,
'\\');
1444 ldns_buffer_write_u8(output, ch);
1451 ldns_buffer_write_u8(output,
'"');
1452 return ldns_buffer_status(output);
1456 svcparam_port2buffer_str(
ldns_buffer *output,
size_t sz, uint8_t *data)
1461 return ldns_buffer_status(output);
1465 svcparam_ipv4hint2buffer_str(
ldns_buffer *output,
size_t sz, uint8_t *data)
1472 ldns_buffer_write_string(output, str);
1474 for (data += 4, sz -= 4; sz ; data += 4, sz -= 4 ) {
1475 ldns_buffer_write_u8(output,
',');
1479 ldns_buffer_write_string(output, str);
1481 return ldns_buffer_status(output);
1485 svcparam_echconfig2buffer_str(
ldns_buffer *output,
size_t sz, uint8_t *data)
1487 size_t str_sz = ldns_b64_ntop_calculate_size(sz);
1494 , (
char *)ldns_buffer_current(output), str_sz);
1496 ldns_buffer_skip(output, written);
1500 return ldns_buffer_status(output);
1504 svcparam_ipv6hint2buffer_str(
ldns_buffer *output,
size_t sz, uint8_t *data)
1511 ldns_buffer_write_string(output, str);
1513 for (data += 16, sz -= 16; sz ; data += 16, sz -= 16) {
1514 ldns_buffer_write_u8(output,
',');
1518 ldns_buffer_write_string(output, str);
1520 return ldns_buffer_status(output);
1524 svcparam_value2buffer_str(
ldns_buffer *output,
size_t sz, uint8_t *data)
1526 uint8_t *eod = data + sz, *dp;
1529 for (dp = data; dp < eod && !isspace(*dp); dp++)
1532 if ((quote = dp < eod))
1533 ldns_buffer_write_u8(output,
'"');
1535 for (dp = data; dp < eod; dp++) {
1538 if (isprint(ch) || ch ==
'\t') {
1539 if (ch ==
'"' || ch ==
'\\')
1540 ldns_buffer_write_u8(output,
'\\');
1541 ldns_buffer_write_u8(output, ch);
1546 ldns_buffer_write_u8(output,
'"');
1547 return ldns_buffer_status(output);
1553 uint8_t *data, *dp, *next_dp = NULL;
1564 for (dp = data; dp + 4 < data + sz; dp = next_dp) {
1566 uint16_t val_sz = ldns_read_uint16(dp + 2);
1568 if ((next_dp = dp + 4 + val_sz) > data + sz)
1572 ldns_buffer_write_u8(output,
' ');
1574 if ((st = svcparam_key2buffer_str(output, key)))
1580 ldns_buffer_write_u8(output,
'=');
1583 st = svcparam_mandatory2buffer_str(output, val_sz, dp);
1586 st = svcparam_alpn2buffer_str(output, val_sz, dp);
1591 st = svcparam_port2buffer_str(output, val_sz, dp);
1594 st = svcparam_ipv4hint2buffer_str(output, val_sz, dp);
1597 st = svcparam_echconfig2buffer_str(output, val_sz, dp);
1600 st = svcparam_ipv6hint2buffer_str(output, val_sz, dp);
1603 st = svcparam_value2buffer_str(output, val_sz, dp);
1609 return ldns_buffer_status(output);
1615 (void)output; (void)rdf;
1675 res = ldns_rdf2buffer_str_nsec_fmt(buffer, fmt, rdf);
1681 res = ldns_rdf2buffer_str_type_fmt(buffer, fmt, rdf);
1757 ldns_b32_ext2dname(
const ldns_rdf *rdf)
1765 size = ldns_b32_ntop_calculate_size(
ldns_rdf_size(rdf) - 1);
1786 size_t total_rdfsize = 0;
1793 if (total_rdfsize == 0) {
1795 return ldns_buffer_status(output);
1805 return ldns_buffer_status(output);
1816 if (fmt_st == NULL) {
1825 return ldns_buffer_status(output);
1847 return ldns_rr2buffer_str_rfc3597(output, rr);
1879 status = ldns_buffer_status(output);
1886 (
unsigned long) ldns_read_uint32(
1888 status = ldns_buffer_status(output);
1890 status = ldns_rdf2buffer_str_fmt(output,
1927 }
else if (fmt_st->
flags
2001 key = ldns_b32_ext2dname(
2029 return ldns_buffer_status(output);
2048 return ldns_buffer_status(output);
2107 return ldns_buffer_status(output);
2117 struct timeval time;
2126 if (!ldns_buffer_status_ok(output)) {
2127 return ldns_buffer_status(output);
2192 ";; EDNS: version %u; flags:",
2225 time_tt = (time_t)time.tv_sec;
2227 (
char*)ctime(&time_tt));
2261 #if defined(HAVE_SSL) && defined(USE_GOST)
2263 ldns_gost_key2buffer_str(
ldns_buffer *output, EVP_PKEY *p)
2265 unsigned char* pp = NULL;
2272 ret = i2d_PrivateKey(p, &pp);
2283 #if defined(HAVE_SSL) && defined(USE_ED25519)
2285 ldns_ed25519_key2buffer_str(
ldns_buffer *output, EVP_PKEY *p)
2287 unsigned char* pp = NULL;
2294 ret = i2d_PrivateKey(p, &pp);
2296 if(ret != 16 + 32) {
2301 (
size_t)ret-16, pp+16);
2311 #if defined(HAVE_SSL) && defined(USE_ED448)
2313 ldns_ed448_key2buffer_str(
ldns_buffer *output, EVP_PKEY *p)
2315 unsigned char* pp = NULL;
2322 ret = i2d_PrivateKey(p, &pp);
2324 if(ret != 16 + 57) {
2329 (
size_t)ret-16, pp+16);
2339 #if defined(HAVE_SSL)
2342 ldns_print_bignum_b64_line(
ldns_buffer* output,
const char* label,
const BIGNUM* num)
2345 if(!bignumbuf)
return 0;
2350 int i = BN_bn2bin(num, bignumbuf);
2375 unsigned char *bignum;
2392 if (ldns_buffer_status_ok(output)) {
2408 "Algorithm: %u (RSA)\n",
2413 "Algorithm: %u (RSASHA1)\n",
2418 "Algorithm: %u (RSASHA1_NSEC3)\n",
2424 "Algorithm: %u (RSASHA256)\n",
2429 "Algorithm: %u (RSASHA512)\n",
2435 fprintf(stderr,
"Warning: unknown signature ");
2437 "algorithm type %u\n",
2441 "Algorithm: %u (Unknown)\n",
2451 const BIGNUM *n=NULL, *e=NULL, *d=NULL,
2452 *p=NULL, *q=NULL, *dmp1=NULL,
2453 *dmq1=NULL, *iqmp=NULL;
2454 #if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL)
2464 RSA_get0_key(rsa, &n, &e, &d);
2465 RSA_get0_factors(rsa, &p, &q);
2466 RSA_get0_crt_params(rsa, &dmp1,
2469 if(!ldns_print_bignum_b64_line(output,
"Modulus", n))
2471 if(!ldns_print_bignum_b64_line(output,
"PublicExponent", e))
2473 if(!ldns_print_bignum_b64_line(output,
"PrivateExponent", d))
2475 if(!ldns_print_bignum_b64_line(output,
"Prime1", p))
2477 if(!ldns_print_bignum_b64_line(output,
"Prime2", q))
2479 if(!ldns_print_bignum_b64_line(output,
"Exponent1", dmp1))
2481 if(!ldns_print_bignum_b64_line(output,
"Exponent2", dmq1))
2483 if(!ldns_print_bignum_b64_line(output,
"Coefficient", iqmp))
2505 const BIGNUM *p=NULL, *q=NULL, *g=NULL,
2506 *priv_key=NULL, *pub_key=NULL;
2507 #if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL)
2512 priv_key = dsa->priv_key;
2513 pub_key = dsa->pub_key;
2516 DSA_get0_pqg(dsa, &p, &q, &g);
2517 DSA_get0_key(dsa, &pub_key, &priv_key);
2519 if(!ldns_print_bignum_b64_line(output,
"Prime(p)", p))
2521 if(!ldns_print_bignum_b64_line(output,
"Subprime(q)", q))
2523 if(!ldns_print_bignum_b64_line(output,
"Base(g)", g))
2525 if(!ldns_print_bignum_b64_line(output,
"Private_value(x)", priv_key))
2527 if(!ldns_print_bignum_b64_line(output,
"Public_value(y)", pub_key))
2534 #if defined(HAVE_SSL) && defined(USE_GOST)
2537 status = ldns_gost_key2buffer_str(output,
2557 EC_KEY* ec = EVP_PKEY_get1_EC_KEY(k->
_key.
key);
2558 const BIGNUM* b = EC_KEY_get0_private_key(ec);
2559 if(!ldns_print_bignum_b64_line(output,
"PrivateKey", b))
2577 status = ldns_ed25519_key2buffer_str(output,
2588 status = ldns_ed448_key2buffer_str(output,
2597 status = ldns_hmac_key2buffer_str(output, k);
2602 status = ldns_hmac_key2buffer_str(output, k);
2607 status = ldns_hmac_key2buffer_str(output, k);
2612 status = ldns_hmac_key2buffer_str(output, k);
2617 status = ldns_hmac_key2buffer_str(output, k);
2622 status = ldns_hmac_key2buffer_str(output, k);
2628 return ldns_buffer_status(output);
2652 if (*(ldns_buffer_at(buffer, ldns_buffer_position(buffer))) != 0) {
2656 ldns_buffer_write_u8(buffer, (uint8_t)
'\0');
2662 str = strdup((
const char *)ldns_buffer_begin(buffer));
2679 ldns_buffer_write_u8(buffer, 0);
2689 char *result = NULL;
2706 char *result = NULL;
2730 char *result = NULL;
2755 char *result = NULL;
2772 char *result = NULL;
2780 tmp_buffer, fmt, list)
2809 fprintf(output,
"%s", str);
2811 fprintf(output,
";Unable to convert rdf to string\n");
2822 fprintf(output,
"%s", str);
2824 fprintf(output,
";Unable to convert rr to string\n");
2841 fprintf(output,
"%s", str);
2843 fprintf(output,
";Unable to convert packet to string\n");
2900 fprintf(output,
"trust anchors (%d listed):\n",
2903 fprintf(output,
"tsig: %s %s\n",
2908 fprintf(output,
"default domain: ");
2910 fprintf(output,
"\n");
2915 fprintf(output,
"\t");
2917 fprintf(output,
"\n");
2923 fprintf(output,
"\t");
2926 switch ((
int)rtt[i]) {
2928 fprintf(output,
" - reachable\n");
2931 fprintf(output,
" - unreachable\n");
ldns_rdf * ldns_rr_rdf(const ldns_rr *rr, size_t nr)
returns the rdata field member counter.
#define LDNS_COMMENT_NSEC3_CHAIN
Show the unhashed owner and next owner names for NSEC3 RR's as comment.
ldns_status ldns_rdf2buffer_str_svcparams(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_SVCPARAMS rdata element to presentation format.
ldns_status ldns_rr_class2buffer_str(ldns_buffer *output, const ldns_rr_class klass)
Converts an ldns_rr_class value to its string representation, and places it in the given buffer.
List or Set of Resource Records.
ldns_rdf * ldns_pkt_edns_data(const ldns_pkt *packet)
return the packet's edns data
enum ldns_enum_rr_class ldns_rr_class
ldns_status ldns_rdf2buffer_str_amtrelay(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_AMTRELAY rdata element to presentation format for the precedence,...
const ldns_output_format * ldns_output_format_onlykeyids
Standard output format record that annotated only DNSKEY RR's with comment text.
ldns_status ldns_pktheader2buffer_str(ldns_buffer *output, const ldns_pkt *pkt)
Converts the header of a packet to presentation format and appends it to the output buffer.
size_t _position
The current position used for reading/writing.
size_t ldns_rdf_size(const ldns_rdf *rd)
returns the size of the rdf.
ldns_lookup_table ldns_algorithms[]
Taken from RFC 2535, section 7.
ldns_status ldns_rdf2buffer_str_int16(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_INT16 rdata element to string format and adds it to the output buffer.
implementation of buffers to ease operations
#define LDNS_MAX_PACKETLEN
bool ldns_pkt_edns_do(const ldns_pkt *packet)
return the packet's edns do bit
@ LDNS_RDF_TYPE_MATCHING_TYPE
ldns_buffer * ldns_buffer_new(size_t capacity)
creates a new buffer with the specified capacity.
ldns_status ldns_rdf2buffer_str_int16_data(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_INT16_DATA rdata element to string format and adds it to the output buffer.
@ LDNS_RR_CLASS_NONE
None class, dynamic update.
bool ldns_resolver_recursive(const ldns_resolver *r)
Is the resolver set to recurse.
ldns_status ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_IPSECKEY rdata element to string format and adds it to the output buffer.
@ LDNS_RDF_TYPE_HEX
hex string
ldns_lookup_table ldns_opcodes[]
Operation codes.
int ldns_get_bit(uint8_t bits[], size_t index)
Returns the value of the specified bit The bits are counted from left to right, so bit #0 is the left...
ldns_status ldns_rdf2buffer_str_time(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_TIME rdata element to string format and adds it to the output buffer.
@ LDNS_RDF_TYPE_INT32
32 bits
const ldns_output_format ldns_output_format_onlykeyids_record
bool ldns_buffer_set_capacity(ldns_buffer *buffer, size_t capacity)
changes the buffer's capacity.
const char * ldns_resolver_tsig_keyname(const ldns_resolver *r)
Return the tsig keyname as used by the nameserver.
#define LDNS_FMT_PAD_SOA_SERIAL
ldns_status ldns_pkt_opcode2buffer_str(ldns_buffer *output, ldns_pkt_opcode opcode)
Converts an ldns packet opcode value to its mnemonic, and adds that to the output buffer.
ldns_status ldns_rdf_bitmap_known_rr_types(ldns_rdf **rdf)
Create a rr type bitmap rdf with at least all known (to ldns) rr types set.
uint16_t ldns_pkt_id(const ldns_pkt *packet)
Read the packet id.
@ LDNS_SVCPARAM_KEY_MANDATORY
void ldns_rdf_print(FILE *output, const ldns_rdf *rdf)
Prints the data in the rdata field to the given file stream (in presentation format)
ldns_status ldns_rdf2buffer_str(ldns_buffer *buffer, const ldns_rdf *rdf)
Converts the data in the rdata field to presentation format (as char *) and appends it to the given b...
@ LDNS_RR_TYPE_ANY
any type (wildcard)
@ LDNS_RDF_TYPE_INT16
16 bits
ldns_rr_list * ldns_pkt_question(const ldns_pkt *packet)
Return the packet's question section.
bool ldns_resolver_fallback(const ldns_resolver *r)
Get the truncation fallback status.
@ LDNS_SVCPARAM_KEY_NO_DEFAULT_ALPN
ldns_status ldns_nsec_bitmap_clear_type(ldns_rdf *bitmap, ldns_rr_type type)
Checks if RR type t is enumerated in the type bitmap rdf and clears the bit.
ldns_pkt_opcode ldns_pkt_get_opcode(const ldns_pkt *packet)
Read the packet's code.
ldns_status ldns_rr_list2buffer_str(ldns_buffer *output, const ldns_rr_list *list)
Converts a rr_list to presentation format and appends it to the output buffer.
@ LDNS_RDF_TYPE_SVCPARAMS
draft-ietf-dnsop-svcb-https
size_t ldns_key_hmac_size(const ldns_key *k)
return the hmac key size
ldns_rdf ** ldns_resolver_searchlist(const ldns_resolver *r)
What is the searchlist as used by the resolver.
#define LDNS_COMMENT_FLAGS
Show when a NSEC3 RR has the optout flag set as comment.
@ LDNS_RDF_TYPE_NSAP
NSAP.
ldns_status ldns_rdf2buffer_str_ilnp64(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_ILNP64 rdata element to 4 hexadecimal numbers separated by colons and adds ...
void ldns_pkt_print(FILE *output, const ldns_pkt *pkt)
Prints the data in the DNS packet to the given file stream (in presentation format)
ldns_lookup_table ldns_rr_classes[]
rr types
void ldns_rr_print(FILE *output, const ldns_rr *rr)
Prints the data in the resource record to the given file stream (in presentation format)
ldns_status ldns_output_format_set_type(ldns_output_format *fmt, ldns_rr_type t)
Makes sure the LDNS_FMT_RFC3597 is set in the output format.
@ LDNS_RDF_TYPE_LOC
location data
@ LDNS_RDF_TYPE_TAG
A non-zero sequence of US-ASCII letters and numbers in lower case.
ldns_rdf * ldns_dname_label(const ldns_rdf *rdf, uint8_t labelpos)
look inside the rdf and if it is an LDNS_RDF_TYPE_DNAME try and retrieve a specific label.
#define LDNS_KEY_ZONE_KEY
uint16_t ldns_pkt_qdcount(const ldns_pkt *packet)
Return the packet's qd count.
ldns_status ldns_rdf2buffer_str_nsec(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_NSEC rdata element to string format and adds it to the output buffer.
@ LDNS_RDF_TYPE_A
A record.
void ldns_resolver_print(FILE *output, const ldns_resolver *r)
Print a resolver (in sofar that is possible) state to output.
@ LDNS_RR_CLASS_CH
Chaos class.
@ LDNS_RR_CLASS_IN
the Internet
bool ldns_rr_is_question(const ldns_rr *rr)
returns the question flag of an rr structure.
@ LDNS_SIGN_ECDSAP256SHA256
enum ldns_enum_pkt_opcode ldns_pkt_opcode
ldns_status ldns_rdf2buffer_str_eui64(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_EUI64 rdata element to 8 hexadecimal numbers separated by dashes and adds i...
ldns_rdf ** ldns_resolver_nameservers(const ldns_resolver *r)
Return the configured nameserver ip address.
@ LDNS_RDF_TYPE_CERT_ALG
certificate algorithm
bool ldns_resolver_igntc(const ldns_resolver *r)
Does the resolver ignore the TC bit (truncated)
uint32_t ldns_pkt_querytime(const ldns_pkt *packet)
Return the packet's querytime.
@ LDNS_RDF_TYPE_APL
apl data
void ldns_pkt_print_fmt(FILE *output, const ldns_output_format *fmt, const ldns_pkt *pkt)
Prints the data in the DNS packet to the given file stream (in presentation format)
const char * ldns_resolver_tsig_algorithm(const ldns_resolver *r)
Return the tsig algorithm as used by the nameserver.
bool ldns_pkt_aa(const ldns_pkt *packet)
Read the packet's aa bit.
ldns_lookup_table ldns_cert_algorithms[]
Taken from RFC 2538.
#define LDNS_COMMENT_RRSIGS
Also comment KEY_ID with RRSIGS.
#define LDNS_RESOLV_RTT_INF
struct tm * ldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result)
The function interprets time as the number of seconds since epoch with respect to now using serial ar...
ldns_pkt_rcode ldns_pkt_get_rcode(const ldns_pkt *packet)
Return the packet's response code.
ldns_rr_list * ldns_zone_rrs(const ldns_zone *z)
Get a list of a zone's content.
@ LDNS_RDF_TYPE_CERTIFICATE_USAGE
Since RFC7218 TLSA records can be given with mnemonics, hence these rdata field types.
bool ldns_resolver_random(const ldns_resolver *r)
Does the resolver randomize the nameserver before usage.
ldns_rbnode_t * ldns_rbtree_search(ldns_rbtree_t *rbtree, const void *key)
Find key in tree.
char * ldns_buffer_export2str(ldns_buffer *buffer)
Exports and returns the data in the buffer as a null terminated char * string.
ldns_status ldns_rdf2buffer_str_hip(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_HIP rdata element to presentation format for the algorithm,...
@ LDNS_SVCPARAM_KEY_IPV6HINT
char * ldns_rdf2str(const ldns_rdf *rdf)
Converts the data in the rdata field to presentation format and returns that as a char *.
char * ldns_pkt_algorithm2str(ldns_algorithm algorithm)
Converts a signing algorithms to its mnemonic and returns that as an allocated null-terminated string...
ldns_status ldns_str2rdf_dname(ldns_rdf **d, const char *str)
convert a dname string into wireformat
uint8_t ldns_resolver_retrans(const ldns_resolver *r)
Get the retransmit interval.
ldns_rr_list * ldns_resolver_dnssec_anchors(const ldns_resolver *r)
Get the resolver's DNSSEC anchors.
bool ldns_pkt_ra(const ldns_pkt *packet)
Read the packet's ra bit.
@ LDNS_STATUS_WIRE_RDATA_ERR
ldns_status ldns_rdf2buffer_str_int8(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_INT8 rdata element to string format and adds it to the output buffer.
bool ldns_pkt_tc(const ldns_pkt *packet)
Read the packet's tc bit.
ldns_status ldns_rr_list2buffer_str_fmt(ldns_buffer *output, const ldns_output_format *fmt, const ldns_rr_list *list)
Converts a rr_list to presentation format and appends it to the output buffer.
ldns_rr_class ldns_rr_get_class(const ldns_rr *rr)
returns the class of the rr.
@ LDNS_RDF_TYPE_SERVICE
protocol and port bitmaps
bool ldns_buffer_reserve(ldns_buffer *buffer, size_t amount)
ensures BUFFER can contain at least AMOUNT more bytes.
ldns_status ldns_rdf2buffer_str_period(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_PERIOD rdata element to string format and adds it to the output buffer.
ldns_status ldns_algorithm2buffer_str(ldns_buffer *output, ldns_algorithm algorithm)
Converts an ldns algorithm type to its mnemonic, and adds that to the output buffer.
ldns_rdf * ldns_resolver_domain(const ldns_resolver *r)
What is the default dname to add to relative queries.
#define LDNS_APL_NEGATION
bool ldns_pkt_rd(const ldns_pkt *packet)
Read the packet's rd bit.
ldns_rdf * ldns_rdf_new(ldns_rdf_type type, size_t size, void *data)
allocates a new rdf structure and fills it.
unsigned char * ldns_key_hmac_key(const ldns_key *k)
return the hmac key data
ldns_rdf * ldns_rdf_new_frm_data(ldns_rdf_type type, size_t size, const void *data)
allocates a new rdf structure and fills it.
char * ldns_rr2str_fmt(const ldns_output_format *fmt, const ldns_rr *rr)
Converts the data in the resource record to presentation format and returns that as a char *.
uint8_t ldns_pkt_edns_version(const ldns_pkt *packet)
return the packet's edns version
@ LDNS_RR_TYPE_DS
RFC4034, RFC3658.
@ LDNS_RR_CLASS_ANY
Any class.
void * ldns_buffer_export(ldns_buffer *buffer)
Makes the buffer fixed and returns a pointer to the data.
@ LDNS_RDF_TYPE_ILNP64
4 shorts represented as 4 * 16 bit hex numbers separated by colons.
@ LDNS_STATUS_DOMAINNAME_OVERFLOW
ldns_status ldns_rdf_bitmap_known_rr_types_space(ldns_rdf **rdf)
Create a rr type bitmap rdf providing enough space to set all known (to ldns) rr types.
ldns_status ldns_rdf2buffer_str_dname(ldns_buffer *output, const ldns_rdf *dname)
Print the ldns_rdf containing a dname to the buffer.
const ldns_output_format * ldns_output_format_default
The default output format record.
ldns_status ldns_rdf2buffer_str_int32(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_INT32 rdata element to string format and adds it to the output buffer.
@ LDNS_RDF_TYPE_ATMA
ATMA.
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.
uint8_t ldns_resolver_ip6(const ldns_resolver *r)
Does the resolver use ip6 or ip4.
bool ldns_nsec_bitmap_covers_type(const ldns_rdf *bitmap, ldns_rr_type type)
Check if RR type t is enumerated and set in the RR type bitmap rdf.
ldns_rdf * ldns_pkt_answerfrom(const ldns_pkt *packet)
Return the packet's answerfrom.
uint8_t ldns_resolver_retry(const ldns_resolver *r)
Get the number of retries.
bool ldns_resolver_debug(const ldns_resolver *r)
Get the debug status of the resolver.
enum ldns_enum_rr_type ldns_rr_type
uint16_t ldns_resolver_port(const ldns_resolver *r)
Get the port the resolver should use.
ldns_rdf * ldns_dnssec_name_name(const ldns_dnssec_name *name)
Returns the domain name of the given dnssec_name structure.
void ldns_buffer_free(ldns_buffer *buffer)
frees the buffer.
@ LDNS_RR_TYPE_SOA
marks the start of a zone of authority
bool ldns_pkt_ad(const ldns_pkt *packet)
Read the packet's ad bit.
ldns_status ldns_rdf2buffer_str_tag(ldns_buffer *output, const ldns_rdf *rdf)
Adds the LDNS_RDF_TYPE_TAG rdata to the output buffer, provided it contains only alphanumeric charact...
bool ldns_resolver_usevc(const ldns_resolver *r)
Does the resolver use tcp or udp.
General key structure, can contain all types of keys that are used in DNSSEC.
ldns_rr_list * ldns_pkt_authority(const ldns_pkt *packet)
Return the packet's authority section.
ldns_status ldns_rdf2buffer_str_nsap(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_NSAP rdata element to string format and adds it to the output buffer.
ldns_status ldns_rdf2buffer_str_b64(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_B64 rdata element to string format and adds it to the output buffer.
#define LDNS_COMMENT_KEY_TYPE
Show if a DNSKEY is a ZSK or KSK as comment.
void ldns_rdf_deep_free(ldns_rdf *rd)
frees a rdf structure and frees the data.
ldns_status ldns_rdf2buffer_str_atma(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_ATMA rdata element to string format and adds it to the output buffer.
void ldns_resolver_print_fmt(FILE *output, const ldns_output_format *fmt, const ldns_resolver *r)
Print a resolver (in sofar that is possible) state to output.
bool ldns_resolver_dnssec(const ldns_resolver *r)
Does the resolver do DNSSEC.
uint32_t ldns_rdf2native_int32(const ldns_rdf *rd)
returns the native uint32_t representation from the rdf.
ldns_status ldns_rdf2buffer_str_unknown(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_UNKNOWN rdata element to string format and adds it to the output buffer.
uint8_t ldns_pkt_edns_extended_rcode(const ldns_pkt *packet)
return the packet's edns extended rcode
uint16_t ldns_pkt_nscount(const ldns_pkt *packet)
Return the packet's ns count.
@ LDNS_RDF_TYPE_TSIGTIME
tsig time 48 bits
int ldns_b32_ntop_extended_hex(const uint8_t *src, size_t src_sz, char *dst, size_t dst_sz)
@ LDNS_RDF_TYPE_HIP
Represents the Public Key Algorithm, HIT and Public Key fields for the HIP RR types.
uint16_t ldns_resolver_edns_udp_size(const ldns_resolver *r)
Get the resolver's udp size.
ldns_status ldns_rdf2buffer_str_tsigtime(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_TSIGTIME rdata element to string format and adds it to the output buffer.
bool ldns_resolver_dnsrch(const ldns_resolver *r)
Does the resolver apply search list.
size_t ldns_resolver_nameserver_count(const ldns_resolver *r)
How many nameserver are configured in the resolver.
void ldns_rr_list_print_fmt(FILE *output, const ldns_output_format *fmt, const ldns_rr_list *lst)
print a rr_list to output
ldns_status ldns_rdf2buffer_str_a(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_A rdata element to string format and adds it to the output buffer.
uint16_t ldns_calc_keytag(const ldns_rr *key)
calculates a keytag of a key for use in DNSSEC.
struct timeval ldns_pkt_timestamp(const ldns_pkt *packet)
Return the packet's timestamp.
enum ldns_enum_status ldns_status
void ldns_zone_print(FILE *output, const ldns_zone *z)
Print a zone structure * to output.
bool ldns_nsec3_optout(const ldns_rr *nsec3_rr)
Returns true if the opt-out flag has been set in the given NSEC3 RR.
@ LDNS_RDF_TYPE_B64
b64 string
@ LDNS_RDF_TYPE_LONG_STR
A <character-string> encoding of the value field as specified [RFC1035], Section 5....
#define LDNS_XMALLOC(type, count)
const char * _name
Textual name of the RR type.
@ LDNS_RDF_TYPE_DNAME
domain name
@ LDNS_RDF_TYPE_B32_EXT
b32 string
A general purpose lookup table.
const ldns_output_format ldns_output_format_nocomments_record
ldns_rr * ldns_zone_soa(const ldns_zone *z)
Return the soa record of a zone.
const ldns_output_format * ldns_output_format_nocomments
Standard output format record that disables commenting in the textual representation of Resource Reco...
char * ldns_pkt_cert_algorithm2str(ldns_cert_algorithm cert_algorithm)
Converts a cert algorithm to its mnemonic and returns that as an allocated null-terminated string.
@ LDNS_RDF_TYPE_EUI64
8 * 8 bit hex numbers separated by dashes.
size_t ldns_rr_rd_count(const ldns_rr *rr)
returns the rd_count of an rr structure.
@ LDNS_RDF_TYPE_EUI48
6 * 8 bit hex numbers separated by dashes.
@ LDNS_RDF_TYPE_NSEC3_NEXT_OWNER
nsec3 base32 string (with length byte on wire
@ LDNS_RDF_TYPE_WKS
well known services
#define LDNS_COMMENT_KEY_ID
Show key id with DNSKEY RR's as comment.
@ LDNS_STATUS_NO_SVCPARAM_VALUE_EXPECTED
@ LDNS_RR_TYPE_MAILA
A request for mail agent RRs (Obsolete - see MX)
Resource record data field.
uint16_t ldns_rdf2native_int16(const ldns_rdf *rd)
returns the native uint16_t representation from the rdf.
ldns_status ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k)
Converts the data in the DNS packet to presentation format (as char *) and appends it to the given bu...
ldns_status ldns_cert_algorithm2buffer_str(ldns_buffer *output, ldns_cert_algorithm cert_algorithm)
Converts an ldns certificate algorithm type to its mnemonic, and adds that to the output buffer.
ldns_rr_list * ldns_pkt_additional(const ldns_pkt *packet)
Return the packet's additional section.
ldns_status ldns_rdf2buffer_str_hex(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_HEX rdata element to string format and adds it to the output buffer.
@ LDNS_SVCPARAM_KEY_IPV4HINT
@ LDNS_STATUS_INVALID_SVCPARAM_VALUE
Contains all information about resource record types.
ldns_status ldns_pkt2buffer_str_fmt(ldns_buffer *output, const ldns_output_format *fmt, const ldns_pkt *pkt)
Converts the data in the DNS packet to presentation format (as char *) and appends it to the given bu...
ldns_status ldns_rdf2buffer_str_cert_alg(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_CERT rdata element to string format and adds it to the output buffer.
uint32_t ldns_rr_ttl(const ldns_rr *rr)
returns the ttl of an rr structure.
ldns_status ldns_rdf2buffer_str_apl(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_APL rdata element to string format and adds it to the output buffer.
ldns_lookup_table * ldns_lookup_by_id(ldns_lookup_table *table, int id)
@ LDNS_RDF_TYPE_INT8
8 bits
#define LDNS_COMMENT_NULLS
Represent a NULL pointer (instead of a pointer to a ldns_rr as "; (null)" as opposed to outputting no...
uint8_t * ldns_rdf_data(const ldns_rdf *rd)
returns the data of the rdf.
@ LDNS_RDF_TYPE_UNKNOWN
unknown types
bool ldns_pkt_cd(const ldns_pkt *packet)
Read the packet's cd bit.
@ LDNS_RR_TYPE_MAILB
A request for mailbox-related records (MB, MG or MR)
ldns_status ldns_rdf2buffer_str_aaaa(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_AAAA rdata element to string format and adds it to the output buffer.
ldns_lookup_table ldns_rcodes[]
Response codes.
char * ldns_buffer2str(ldns_buffer *buffer)
Returns a copy of the data in the buffer as a null terminated char * string.
const ldns_output_format * ldns_output_format_bubblebabble
Standard output format record that shows all DNSKEY related information in the comment text,...
@ LDNS_RDF_TYPE_PERIOD
period
char * ldns_pkt_opcode2str(ldns_pkt_opcode opcode)
Converts a packet opcode to its mnemonic and returns that as an allocated null-terminated string.
@ LDNS_RDF_TYPE_INT16_DATA
variable length any type rdata where the length is specified by the first 2 bytes
@ LDNS_RDF_TYPE_STR
txt string
enum ldns_enum_algorithm ldns_algorithm
ldns_status ldns_rdf2buffer_str_alg(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_ALG rdata element to string format and adds it to the output buffer.
bool ldns_pkt_qr(const ldns_pkt *packet)
Read the packet's qr bit.
ldns_status ldns_rdf2buffer_str_long_str(ldns_buffer *output, const ldns_rdf *rdf)
Adds the LDNS_RDF_TYPE_LONG_STR rdata to the output buffer, in-between double quotes and all non prin...
bool ldns_resolver_fail(const ldns_resolver *r)
Does the resolver only try the first nameserver.
bool ldns_resolver_dnssec_cd(const ldns_resolver *r)
Does the resolver set the CD bit.
ldns_rdf * ldns_nsec3_next_owner(const ldns_rr *nsec3_rr)
Returns the first label of the next ownername in the NSEC3 chain (ie.
#define LDNS_RESOLV_RTT_MIN
bool ldns_pkt_edns(const ldns_pkt *pkt)
returns true if this packet needs and EDNS rr to be sent.
@ LDNS_RDF_TYPE_IPSECKEY
IPSECKEY.
const ldns_output_format ldns_output_format_bubblebabble_record
enum ldns_enum_cert_algorithm ldns_cert_algorithm
char * ldns_rr_list2str_fmt(const ldns_output_format *fmt, const ldns_rr_list *list)
Converts a list of resource records to presentation format and returns that as a char *.
@ LDNS_RDF_TYPE_CLASS
a class
@ LDNS_RR_TYPE_RRSIG
DNSSEC.
char * ldns_pkt2str_fmt(const ldns_output_format *fmt, const ldns_pkt *pkt)
Converts the data in the DNS packet to presentation format and returns that as a char *.
@ LDNS_RDF_TYPE_NSEC
nsec type codes
char * ldns_key2str(const ldns_key *k)
Converts a private key to the test presentation fmt and returns that as a char *.
ldns_status ldns_pkt2buffer_str(ldns_buffer *output, const ldns_pkt *pkt)
Converts the data in the DNS packet to presentation format (as char *) and appends it to the given bu...
size_t * ldns_resolver_rtt(const ldns_resolver *r)
Return the used round trip times for the nameservers.
char * ldns_rr_list2str(const ldns_rr_list *list)
Converts a list of resource records to presentation format and returns that as a char *.
enum ldns_enum_svcparam_key ldns_svcparam_key
const void * data
pointer to data
ldns_rr_list * ldns_pkt_answer(const ldns_pkt *packet)
Return the packet's answer section.
uint16_t ldns_pkt_ancount(const ldns_pkt *packet)
Return the packet's an count.
ldns_status ldns_rdf2buffer_str_str(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_STR rdata element to string format and adds it to the output buffer.
ldns_status ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_WKS rdata element to string format and adds it to the output buffer.
char * ldns_pkt2str(const ldns_pkt *pkt)
Converts the data in the DNS packet to presentation format and returns that as a char *.
RSA * ldns_key_rsa_key(const ldns_key *k)
returns the (openssl) RSA struct contained in the key
ldns_status ldns_rr2buffer_str(ldns_buffer *output, const ldns_rr *rr)
Converts the data in the resource record to presentation format (as char *) and appends it to the giv...
ldns_status ldns_rdf2buffer_str_type(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_TYPE rdata element to string format and adds it to the output buffer.
char * ldns_rr_class2str(const ldns_rr_class klass)
Converts an ldns_rr_class value to its string representation, and returns that string.
ldns_rr * ldns_pkt_tsig(const ldns_pkt *pkt)
Return the packet's tsig pseudo rr's.
void ldns_rr_print_fmt(FILE *output, const ldns_output_format *fmt, const ldns_rr *rr)
Prints the data in the resource record to the given file stream (in presentation format)
ldns_rr * ldns_rr_list_rr(const ldns_rr_list *rr_list, size_t nr)
returns a specific rr of an rrlist.
@ LDNS_RDF_TYPE_AAAA
AAAA record.
ldns_status ldns_rr2buffer_str_fmt(ldns_buffer *output, const ldns_output_format *fmt, const ldns_rr *rr)
Converts the data in the resource record to presentation format (as char *) and appends it to the giv...
#define LDNS_COMMENT_KEY
Show key id, type and size as comment for DNSKEY RR's.
ldns_status ldns_rdf2buffer_str_nsec3_salt(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_NSEC3_SALT rdata element to string format and adds it to the output buffer.
int ldns_buffer_printf(ldns_buffer *buffer, const char *format,...)
prints to the buffer, increasing the capacity if required using buffer_reserve().
@ LDNS_STATUS_RDATA_OVERFLOW
#define LDNS_COMMENT_KEY_SIZE
Show DNSKEY key size as comment.
uint16_t ldns_pkt_edns_udp_size(const ldns_pkt *packet)
return the packet's edns udp size
size_t ldns_rr_dnskey_key_size(const ldns_rr *key)
get the length of the keydata in bits
ldns_status ldns_rdf2buffer_str_b32_ext(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_B32_EXT rdata element to string format and adds it to the output buffer.
char * ldns_bubblebabble(uint8_t *data, size_t len)
Encode data as BubbleBabble.
ldns_status ldns_rdf2buffer_str_class(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_CLASS rdata element to string format and adds it to the output buffer.
bool ldns_resolver_defnames(const ldns_resolver *r)
Does the resolver apply default domain name.
@ LDNS_RDF_TYPE_NSEC3_SALT
nsec3 hash salt
@ LDNS_RDF_TYPE_TYPE
a RR type
#define LDNS_COMMENT_BUBBLEBABBLE
Provide bubblebabble representation for DS RR's as comment.
ldns_status ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_LOC rdata element to string format and adds it to the output buffer.
int ldns_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize)
ldns_status ldns_output_format_clear_type(ldns_output_format *fmt, ldns_rr_type t)
Makes sure the LDNS_FMT_RFC3597 is set in the output format.
char * ldns_rr_type2str(const ldns_rr_type type)
Converts an ldns_rr_type value to its string representation, and returns that string.
@ LDNS_SVCPARAM_KEY_ECHCONFIG
ldns_rdf_type ldns_rdf_get_type(const ldns_rdf *rd)
returns the type of the rdf.
@ LDNS_SIGN_RSASHA1_NSEC3
enum ldns_enum_pkt_rcode ldns_pkt_rcode
The rbnode_t struct definition.
const ldns_rr_descriptor * ldns_rr_descript(uint16_t type)
returns the resource record descriptor for the given rr type.
ldns_rdf * ldns_rr_owner(const ldns_rr *rr)
returns the owner name of an rr structure.
@ LDNS_RR_CLASS_HS
Hesiod (Dyer 87)
#define LDNS_FMT_ZEROIZE_RRSIGS
void ldns_rr_list_print(FILE *output, const ldns_rr_list *lst)
print a rr_list to output
void ldns_zone_print_fmt(FILE *output, const ldns_output_format *fmt, const ldns_zone *z)
Print a zone structure * to output.
ldns_status ldns_rr_type2buffer_str(ldns_buffer *output, const ldns_rr_type type)
Converts an ldns_rr_type value to its string representation, and places it in the given buffer.
@ LDNS_RDF_TYPE_TIME
time (32 bits)
#define LDNS_MAX_DOMAINLEN
Maximum length of a complete dname.
#define LDNS_FMT_SHORT
Prints only answer section of packets and only rdata of RRs.
char * ldns_pkt_rcode2str(ldns_pkt_rcode rcode)
Converts a packet rcode to its mnemonic and returns that as an allocated null-terminated string.
struct timeval ldns_resolver_timeout(const ldns_resolver *r)
What is the timeout on socket connections.
uint16_t ldns_pkt_arcount(const ldns_pkt *packet)
Return the packet's ar count.
@ LDNS_RDF_TYPE_AMTRELAY
draft-ietf-mboned-driad-amt-discovery
ldns_status ldns_nsec_bitmap_set_type(ldns_rdf *bitmap, ldns_rr_type type)
Checks if RR type t is enumerated in the type bitmap rdf and sets the bit.
struct ldns_struct_key::@0 _key
Storage pointers for the types of keys supported.
DSA * ldns_key_dsa_key(const ldns_key *k)
returns the (openssl) DSA struct contained in the key
ldns_signing_algorithm ldns_key_algorithm(const ldns_key *k)
return the signing alg of the key
ldns_status ldns_rdf2buffer_str_eui48(ldns_buffer *output, const ldns_rdf *rdf)
Converts an LDNS_RDF_TYPE_EUI48 rdata element to 6 hexadecimal numbers separated by dashes and adds i...
@ LDNS_SIGN_ECDSAP384SHA384
size_t ldns_pkt_size(const ldns_pkt *packet)
Return the packet's size in bytes.
ldns_status ldns_pkt_rcode2buffer_str(ldns_buffer *output, ldns_pkt_rcode rcode)
Converts an ldns packet rcode value to its mnemonic, and adds that to the output buffer.
size_t ldns_resolver_searchlist_count(const ldns_resolver *r)
Return the resolver's searchlist count.
@ LDNS_RDF_TYPE_ALG
a key algorithm
DNS stub resolver structure.
char * ldns_rr2str(const ldns_rr *rr)
Converts the data in the resource record to presentation format and returns that as a char *.
ldns_rr_type ldns_rr_get_type(const ldns_rr *rr)
returns the type of the rr.
size_t ldns_rr_list_rr_count(const ldns_rr_list *rr_list)
returns the number of rr's in an rr_list.