/build/ldns-VHZYR1/ldns-1.9.2/rr_functions.c
Go to the documentation of this file.
/*
* rr_function.c
*
* function that operate on specific rr types
*
* (c) NLnet Labs, 2004-2006
* See the file LICENSE for the license
*/
/*
* These come strait from perldoc Net::DNS::RR::xxx
* first the read variant, then the write. This is
* not complete.
*/
#include <ldns/config.h>
#include <ldns/ldns.h>
#include <limits.h>
#include <strings.h>
static ldns_rdf *
ldns_rr_function(ldns_rr_type type, const ldns_rr *rr, size_t pos)
{
if (!rr || ldns_rr_get_type(rr) != type) {
return NULL;
}
return ldns_rr_rdf(rr, pos);
}
static bool
ldns_rr_set_function(ldns_rr_type type, ldns_rr *rr, ldns_rdf *rdf, size_t pos)
{
ldns_rdf *pop;
if (!rr || ldns_rr_get_type(rr) != type) {
return false;
}
pop = ldns_rr_set_rdf(rr, rdf, pos);
ldns_rdf_deep_free(pop);
return true;
}
/* A/AAAA records */
ldns_rdf *
ldns_rr_a_address(const ldns_rr *r)
{
/* 2 types to check, cannot use the macro */
if (!r || (ldns_rr_get_type(r) != LDNS_RR_TYPE_A &&
ldns_rr_get_type(r) != LDNS_RR_TYPE_AAAA)) {
return NULL;
}
return ldns_rr_rdf(r, 0);
}
bool
ldns_rr_a_set_address(ldns_rr *r, ldns_rdf *f)
{
/* 2 types to check, cannot use the macro... */
ldns_rdf *pop;
if (!r || (ldns_rr_get_type(r) != LDNS_RR_TYPE_A &&
ldns_rr_get_type(r) != LDNS_RR_TYPE_AAAA)) {
return false;
}
pop = ldns_rr_set_rdf(r, f, 0);
if (pop) {
LDNS_FREE(pop);
return true;
} else {
return false;
}
}
/* NS record */
ldns_rdf *
ldns_rr_ns_nsdname(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_NS, r, 0);
}
/* MX record */
ldns_rdf *
ldns_rr_mx_preference(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_MX, r, 0);
}
ldns_rdf *
ldns_rr_mx_exchange(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_MX, r, 1);
}
/* RRSIG record */
ldns_rdf *
ldns_rr_rrsig_typecovered(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_RRSIG, r, 0);
}
bool
ldns_rr_rrsig_set_typecovered(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_RRSIG, r, f, 0);
}
ldns_rdf *
ldns_rr_rrsig_algorithm(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_RRSIG, r, 1);
}
bool
ldns_rr_rrsig_set_algorithm(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_RRSIG, r, f, 1);
}
ldns_rdf *
ldns_rr_rrsig_labels(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_RRSIG, r, 2);
}
bool
ldns_rr_rrsig_set_labels(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_RRSIG, r, f, 2);
}
ldns_rdf *
ldns_rr_rrsig_origttl(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_RRSIG, r, 3);
}
bool
ldns_rr_rrsig_set_origttl(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_RRSIG, r, f, 3);
}
ldns_rdf *
ldns_rr_rrsig_expiration(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_RRSIG, r, 4);
}
bool
ldns_rr_rrsig_set_expiration(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_RRSIG, r, f, 4);
}
ldns_rdf *
ldns_rr_rrsig_inception(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_RRSIG, r, 5);
}
bool
ldns_rr_rrsig_set_inception(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_RRSIG, r, f, 5);
}
ldns_rdf *
ldns_rr_rrsig_keytag(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_RRSIG, r, 6);
}
bool
ldns_rr_rrsig_set_keytag(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_RRSIG, r, f, 6);
}
ldns_rdf *
ldns_rr_rrsig_signame(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_RRSIG, r, 7);
}
bool
ldns_rr_rrsig_set_signame(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_RRSIG, r, f, 7);
}
ldns_rdf *
ldns_rr_rrsig_sig(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_RRSIG, r, 8);
}
bool
ldns_rr_rrsig_set_sig(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_RRSIG, r, f, 8);
}
/* DNSKEY record */
ldns_rdf *
ldns_rr_dnskey_flags(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_DNSKEY, r, 0);
}
bool
ldns_rr_dnskey_set_flags(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_DNSKEY, r, f, 0);
}
ldns_rdf *
ldns_rr_dnskey_protocol(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_DNSKEY, r, 1);
}
bool
ldns_rr_dnskey_set_protocol(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_DNSKEY, r, f, 1);
}
ldns_rdf *
ldns_rr_dnskey_algorithm(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_DNSKEY, r, 2);
}
bool
ldns_rr_dnskey_set_algorithm(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_DNSKEY, r, f, 2);
}
ldns_rdf *
ldns_rr_dnskey_key(const ldns_rr *r)
{
return ldns_rr_function(LDNS_RR_TYPE_DNSKEY, r, 3);
}
bool
ldns_rr_dnskey_set_key(ldns_rr *r, ldns_rdf *f)
{
return ldns_rr_set_function(LDNS_RR_TYPE_DNSKEY, r, f, 3);
}
size_t
ldns_rr_dnskey_key_size_raw(const unsigned char* keydata,
const size_t len,
const ldns_algorithm alg)
{
#ifdef USE_DSA
/* for DSA keys */
uint8_t t;
#endif /* USE_DSA */
/* for RSA keys */
uint16_t exp;
uint16_t int16;
switch ((ldns_signing_algorithm)alg) {
#ifdef USE_DSA
case LDNS_SIGN_DSA:
case LDNS_SIGN_DSA_NSEC3:
if (len > 0) {
t = keydata[0];
return (64 + t*8)*8;
} else {
return 0;
}
break;
#endif /* USE_DSA */
case LDNS_SIGN_RSAMD5:
case LDNS_SIGN_RSASHA1:
case LDNS_SIGN_RSASHA1_NSEC3:
#ifdef USE_SHA2
case LDNS_SIGN_RSASHA256:
case LDNS_SIGN_RSASHA512:
#endif
if (len > 0) {
if (keydata[0] == 0) {
/* big exponent */
if (len > 3) {
memmove(&int16, keydata + 1, 2);
exp = ntohs(int16);
return (len - exp - 3)*8;
} else {
return 0;
}
} else {
exp = keydata[0];
return (len-exp-1)*8;
}
} else {
return 0;
}
break;
#ifdef USE_GOST
case LDNS_SIGN_ECC_GOST:
return 512;
#endif
#ifdef USE_ECDSA
case LDNS_SIGN_ECDSAP256SHA256:
return 256;
case LDNS_SIGN_ECDSAP384SHA384:
return 384;
#endif
#ifdef USE_ED25519
case LDNS_SIGN_ED25519:
return 256;
#endif
#ifdef USE_ED448
case LDNS_SIGN_ED448:
return 456;
#endif
case LDNS_SIGN_HMACMD5:
return len;
default:
return 0;
}
}
size_t
ldns_rr_dnskey_key_size(const ldns_rr *key)
{
if (!key || !ldns_rr_dnskey_key(key)
|| !ldns_rr_dnskey_algorithm(key)) {
return 0;
}
return ldns_rr_dnskey_key_size_raw((unsigned char*)ldns_rdf_data(ldns_rr_dnskey_key(key)),
ldns_rdf_size(ldns_rr_dnskey_key(key)),
ldns_rdf2native_int8(ldns_rr_dnskey_algorithm(key))
);
}
uint32_t ldns_soa_serial_identity(uint32_t ATTR_UNUSED(unused), void *data)
{
return (uint32_t) (intptr_t) data;
}
uint32_t ldns_soa_serial_increment(uint32_t s, void *ATTR_UNUSED(unused))
{
return ldns_soa_serial_increment_by(s, (void *)1);
}
uint32_t ldns_soa_serial_increment_by(uint32_t s, void *data)
{
return s + (intptr_t) data;
}
uint32_t ldns_soa_serial_datecounter(uint32_t s, void *data)
{
struct tm tm;
char s_str[11];
int32_t new_s;
time_t t = data ? (time_t) (intptr_t) data : ldns_time(NULL);
(void) strftime(s_str, 11, "%Y%m%d00", localtime_r(&t, &tm));
new_s = (int32_t) atoi(s_str);
return new_s - ((int32_t) s) <= 0 ? s+1 : ((uint32_t) new_s);
}
uint32_t ldns_soa_serial_unixtime(uint32_t s, void *data)
{
int32_t new_s = data ? (int32_t) (intptr_t) data
: (int32_t) ldns_time(NULL);
return new_s - ((int32_t) s) <= 0 ? s+1 : ((uint32_t) new_s);
}
void
ldns_rr_soa_increment(ldns_rr *soa)
{
ldns_rr_soa_increment_func_data(soa, ldns_soa_serial_increment, NULL);
}
void
ldns_rr_soa_increment_func(ldns_rr *soa, ldns_soa_serial_increment_func_t f)
{
ldns_rr_soa_increment_func_data(soa, f, NULL);
}
void
ldns_rr_soa_increment_func_data(ldns_rr *soa,
ldns_soa_serial_increment_func_t f, void *data)
{
ldns_rdf *prev_soa_serial_rdf;
if ( !soa || !f || ldns_rr_get_type(soa) != LDNS_RR_TYPE_SOA
|| !ldns_rr_rdf(soa, 2)) {
return;
}
prev_soa_serial_rdf = ldns_rr_set_rdf(
soa
, ldns_native2rdf_int32(
LDNS_RDF_TYPE_INT32
, (*f)( ldns_rdf2native_int32(
ldns_rr_rdf(soa, 2))
, data
)
)
, 2
);
LDNS_FREE(prev_soa_serial_rdf);
}
void
ldns_rr_soa_increment_func_int(ldns_rr *soa,
ldns_soa_serial_increment_func_t f, int data)
{
ldns_rr_soa_increment_func_data(soa, f, (void *) (intptr_t) data);
}
ATTR_UNUSED
#define ATTR_UNUSED(x)
Definition common.h:72
config.h
ldns_signing_algorithm
enum ldns_enum_signing_algorithm ldns_signing_algorithm
Definition keys.h:110
LDNS_SIGN_RSASHA1
@ LDNS_SIGN_RSASHA1
Definition keys.h:84
LDNS_SIGN_ECDSAP256SHA256
@ LDNS_SIGN_ECDSAP256SHA256
Definition keys.h:95
LDNS_SIGN_DSA_NSEC3
@ LDNS_SIGN_DSA_NSEC3
Definition keys.h:92
LDNS_SIGN_ECC_GOST
@ LDNS_SIGN_ECC_GOST
Definition keys.h:94
LDNS_SIGN_ED448
@ LDNS_SIGN_ED448
Definition keys.h:101
LDNS_SIGN_ED25519
@ LDNS_SIGN_ED25519
Definition keys.h:98
LDNS_SIGN_RSASHA1_NSEC3
@ LDNS_SIGN_RSASHA1_NSEC3
Definition keys.h:88
LDNS_SIGN_ECDSAP384SHA384
@ LDNS_SIGN_ECDSAP384SHA384
Definition keys.h:96
LDNS_SIGN_HMACMD5
@ LDNS_SIGN_HMACMD5
Definition keys.h:103
LDNS_SIGN_RSAMD5
@ LDNS_SIGN_RSAMD5
Definition keys.h:83
LDNS_SIGN_RSASHA512
@ LDNS_SIGN_RSASHA512
Definition keys.h:90
LDNS_SIGN_DSA
@ LDNS_SIGN_DSA
Definition keys.h:86
LDNS_SIGN_RSASHA256
@ LDNS_SIGN_RSASHA256
Definition keys.h:89
ldns_algorithm
enum ldns_enum_algorithm ldns_algorithm
Definition keys.h:64
ldns_rdf_data
uint8_t * ldns_rdf_data(const ldns_rdf *rd)
returns the data of the rdf.
Definition rdata.c:38
ldns_rdf_deep_free
void ldns_rdf_deep_free(ldns_rdf *rd)
frees a rdf structure and frees the data.
Definition rdata.c:230
ldns_rdf2native_int32
uint32_t ldns_rdf2native_int32(const ldns_rdf *rd)
returns the native uint32_t representation from the rdf.
Definition rdata.c:98
ldns_rdf2native_int8
uint8_t ldns_rdf2native_int8(const ldns_rdf *rd)
returns the native uint8_t representation from the rdf.
Definition rdata.c:70
LDNS_RDF_TYPE_INT32
@ LDNS_RDF_TYPE_INT32
32 bits
Definition rdata.h:56
ldns_native2rdf_int32
ldns_rdf * ldns_native2rdf_int32(ldns_rdf_type type, uint32_t value)
returns an rdf that contains the given int32 value.
Definition rdata.c:147
ldns_rdf_size
size_t ldns_rdf_size(const ldns_rdf *rd)
returns the size of the rdf.
Definition rdata.c:24
ldns_rdf
struct ldns_struct_rdf ldns_rdf
Definition rdata.h:211
ldns_rr
struct ldns_struct_rr ldns_rr
Definition rr.h:346
ldns_rr_type
enum ldns_enum_rr_type ldns_rr_type
Definition rr.h:260
LDNS_RR_TYPE_RRSIG
@ LDNS_RR_TYPE_RRSIG
DNSSEC.
Definition rr.h:170
LDNS_RR_TYPE_A
@ LDNS_RR_TYPE_A
a host address
Definition rr.h:80
LDNS_RR_TYPE_DNSKEY
@ LDNS_RR_TYPE_DNSKEY
Definition rr.h:172
LDNS_RR_TYPE_SOA
@ LDNS_RR_TYPE_SOA
marks the start of a zone of authority
Definition rr.h:90
LDNS_RR_TYPE_AAAA
@ LDNS_RR_TYPE_AAAA
ipv6 address
Definition rr.h:134
LDNS_RR_TYPE_NS
@ LDNS_RR_TYPE_NS
an authoritative name server
Definition rr.h:82
LDNS_RR_TYPE_MX
@ LDNS_RR_TYPE_MX
mail exchange
Definition rr.h:108
ldns_rr_rdf
ldns_rdf * ldns_rr_rdf(const ldns_rr *rr, size_t nr)
returns the rdata field member counter.
Definition rr.c:907
ldns_rr_get_type
ldns_rr_type ldns_rr_get_type(const ldns_rr *rr)
returns the type of the rr.
Definition rr.c:941
ldns_rr_set_rdf
ldns_rdf * ldns_rr_set_rdf(ldns_rr *rr, const ldns_rdf *f, size_t position)
sets a rdf member, it will be set on the position given.
Definition rr.c:838
ldns_rr_rrsig_algorithm
ldns_rdf * ldns_rr_rrsig_algorithm(const ldns_rr *r)
returns the algorithm of a LDNS_RR_TYPE_RRSIG RR
Definition rr_functions.c:123
ldns_rr_dnskey_protocol
ldns_rdf * ldns_rr_dnskey_protocol(const ldns_rr *r)
returns the protocol of a LDNS_RR_TYPE_DNSKEY rr
Definition rr_functions.c:232
ldns_rr_dnskey_set_protocol
signed char ldns_rr_dnskey_set_protocol(ldns_rr *r, ldns_rdf *f)
sets the protocol of a LDNS_RR_TYPE_DNSKEY rr
Definition rr_functions.c:238
ldns_rr_rrsig_set_labels
signed char ldns_rr_rrsig_set_labels(ldns_rr *r, ldns_rdf *f)
sets the number of labels of a LDNS_RR_TYPE_RRSIG rr
Definition rr_functions.c:141
ldns_rr_mx_preference
ldns_rdf * ldns_rr_mx_preference(const ldns_rr *r)
returns the mx pref.
Definition rr_functions.c:98
ldns_rr_rrsig_set_keytag
signed char ldns_rr_rrsig_set_keytag(ldns_rr *r, ldns_rdf *f)
sets the keytag of a LDNS_RR_TYPE_RRSIG rr
Definition rr_functions.c:189
ldns_soa_serial_unixtime
uint32_t ldns_soa_serial_unixtime(uint32_t s, void *data)
Function to be used with ldns_rr_soa_increment_func or ldns_rr_soa_increment_func_int to set the soa ...
Definition rr_functions.c:383
ldns_rr_rrsig_set_origttl
signed char ldns_rr_rrsig_set_origttl(ldns_rr *r, ldns_rdf *f)
sets the original TTL of a LDNS_RR_TYPE_RRSIG rr
Definition rr_functions.c:153
ldns_rr_rrsig_set_typecovered
signed char ldns_rr_rrsig_set_typecovered(ldns_rr *r, ldns_rdf *f)
sets the typecovered of a LDNS_RR_TYPE_RRSIG rr
Definition rr_functions.c:117
ldns_rr_soa_increment_func_int
void ldns_rr_soa_increment_func_int(ldns_rr *soa, ldns_soa_serial_increment_func_t f, int data)
Increment the serial number of the given SOA with the given function using data as an argument for th...
Definition rr_functions.c:426
ldns_soa_serial_increment
uint32_t ldns_soa_serial_increment(uint32_t s, void *unused __attribute__((unused)))
Definition rr_functions.c:361
ldns_rr_ns_nsdname
ldns_rdf * ldns_rr_ns_nsdname(const ldns_rr *r)
returns the name of a LDNS_RR_TYPE_NS rr
Definition rr_functions.c:91
ldns_rr_dnskey_algorithm
ldns_rdf * ldns_rr_dnskey_algorithm(const ldns_rr *r)
returns the algorithm of a LDNS_RR_TYPE_DNSKEY rr
Definition rr_functions.c:244
ldns_rr_rrsig_origttl
ldns_rdf * ldns_rr_rrsig_origttl(const ldns_rr *r)
returns the original TTL of a LDNS_RR_TYPE_RRSIG RR
Definition rr_functions.c:147
ldns_rr_rrsig_expiration
ldns_rdf * ldns_rr_rrsig_expiration(const ldns_rr *r)
returns the expiration time of a LDNS_RR_TYPE_RRSIG RR
Definition rr_functions.c:159
ldns_rr_dnskey_key_size
size_t ldns_rr_dnskey_key_size(const ldns_rr *key)
get the length of the keydata in bits
Definition rr_functions.c:344
ldns_rr_rrsig_set_sig
signed char ldns_rr_rrsig_set_sig(ldns_rr *r, ldns_rdf *f)
sets the signature data of a LDNS_RR_TYPE_RRSIG rr
Definition rr_functions.c:213
ldns_rr_mx_exchange
ldns_rdf * ldns_rr_mx_exchange(const ldns_rr *r)
returns the mx host of a LDNS_RR_TYPE_MX rr
Definition rr_functions.c:104
ldns_rr_soa_increment_func
void ldns_rr_soa_increment_func(ldns_rr *soa, ldns_soa_serial_increment_func_t f)
Increment the serial number of the given SOA with the given function.
Definition rr_functions.c:397
ldns_rr_dnskey_set_flags
signed char ldns_rr_dnskey_set_flags(ldns_rr *r, ldns_rdf *f)
sets the flags of a LDNS_RR_TYPE_DNSKEY rr
Definition rr_functions.c:226
ldns_rr_rrsig_set_algorithm
signed char ldns_rr_rrsig_set_algorithm(ldns_rr *r, ldns_rdf *f)
sets the algorithm of a LDNS_RR_TYPE_RRSIG rr
Definition rr_functions.c:129
ldns_rr_dnskey_key
ldns_rdf * ldns_rr_dnskey_key(const ldns_rr *r)
returns the key data of a LDNS_RR_TYPE_DNSKEY rr
Definition rr_functions.c:256
ldns_rr_rrsig_inception
ldns_rdf * ldns_rr_rrsig_inception(const ldns_rr *r)
returns the inception time of a LDNS_RR_TYPE_RRSIG RR
Definition rr_functions.c:171
ldns_rr_a_set_address
signed char ldns_rr_a_set_address(ldns_rr *r, ldns_rdf *f)
sets the address of a LDNS_RR_TYPE_A rr
Definition rr_functions.c:72
ldns_rr_rrsig_sig
ldns_rdf * ldns_rr_rrsig_sig(const ldns_rr *r)
returns the signature data of a LDNS_RR_TYPE_RRSIG RR
Definition rr_functions.c:207
ldns_rr_rrsig_keytag
ldns_rdf * ldns_rr_rrsig_keytag(const ldns_rr *r)
returns the keytag of a LDNS_RR_TYPE_RRSIG RR
Definition rr_functions.c:183
ldns_rr_dnskey_set_key
signed char ldns_rr_dnskey_set_key(ldns_rr *r, ldns_rdf *f)
sets the key data of a LDNS_RR_TYPE_DNSKEY rr
Definition rr_functions.c:262
ldns_rr_rrsig_typecovered
ldns_rdf * ldns_rr_rrsig_typecovered(const ldns_rr *r)
returns the type covered of a LDNS_RR_TYPE_RRSIG rr
Definition rr_functions.c:111
ldns_rr_dnskey_set_algorithm
signed char ldns_rr_dnskey_set_algorithm(ldns_rr *r, ldns_rdf *f)
sets the algorithm of a LDNS_RR_TYPE_DNSKEY rr
Definition rr_functions.c:250
ldns_rr_rrsig_signame
ldns_rdf * ldns_rr_rrsig_signame(const ldns_rr *r)
returns the signers name of a LDNS_RR_TYPE_RRSIG RR
Definition rr_functions.c:195
ldns_soa_serial_identity
uint32_t ldns_soa_serial_identity(uint32_t unused __attribute__((unused)), void *data)
Definition rr_functions.c:356
ldns_rr_soa_increment
void ldns_rr_soa_increment(ldns_rr *soa)
Increment the serial number of the given SOA by one.
Definition rr_functions.c:391
ldns_rr_dnskey_flags
ldns_rdf * ldns_rr_dnskey_flags(const ldns_rr *r)
returns the flags of a LDNS_RR_TYPE_DNSKEY rr
Definition rr_functions.c:220
ldns_rr_rrsig_set_expiration
signed char ldns_rr_rrsig_set_expiration(ldns_rr *r, ldns_rdf *f)
sets the expiration date of a LDNS_RR_TYPE_RRSIG rr
Definition rr_functions.c:165
ldns_rr_soa_increment_func_data
void ldns_rr_soa_increment_func_data(ldns_rr *soa, ldns_soa_serial_increment_func_t f, void *data)
Increment the serial number of the given SOA with the given function passing it the given data argume...
Definition rr_functions.c:403
ldns_rr_dnskey_key_size_raw
size_t ldns_rr_dnskey_key_size_raw(const unsigned char *keydata, const size_t len, const ldns_algorithm alg)
get the length of the keydata in bits
Definition rr_functions.c:268
ldns_soa_serial_increment_by
uint32_t ldns_soa_serial_increment_by(uint32_t s, void *data)
Function to be used with dns_rr_soa_increment_func_int, to increment the soa serial number with a cer...
Definition rr_functions.c:366
ldns_rr_a_address
ldns_rdf * ldns_rr_a_address(const ldns_rr *r)
returns the address of a LDNS_RR_TYPE_A rr
Definition rr_functions.c:61
ldns_rr_rrsig_labels
ldns_rdf * ldns_rr_rrsig_labels(const ldns_rr *r)
returns the number of labels of a LDNS_RR_TYPE_RRSIG RR
Definition rr_functions.c:135
ldns_rr_rrsig_set_inception
signed char ldns_rr_rrsig_set_inception(ldns_rr *r, ldns_rdf *f)
sets the inception date of a LDNS_RR_TYPE_RRSIG rr
Definition rr_functions.c:177
ldns_rr_rrsig_set_signame
signed char ldns_rr_rrsig_set_signame(ldns_rr *r, ldns_rdf *f)
sets the signers name of a LDNS_RR_TYPE_RRSIG rr
Definition rr_functions.c:201
ldns_soa_serial_datecounter
uint32_t ldns_soa_serial_datecounter(uint32_t s, void *data)
Function to be used with ldns_rr_soa_increment_func or ldns_rr_soa_increment_func_int to set the soa ...
Definition rr_functions.c:371
ldns_soa_serial_increment
uint32_t ldns_soa_serial_increment(uint32_t s, void *unused)
Function to be used with dns_rr_soa_increment_func, to increment the soa serial number with one.
ldns_soa_serial_increment_func_t
uint32_t(* ldns_soa_serial_increment_func_t)(uint32_t, void *)
The type of function to be passed to ldns_rr_soa_increment_func, ldns_rr_soa_increment_func_data or l...
Definition rr_functions.h:266
LDNS_FREE
#define LDNS_FREE(ptr)
Definition util.h:60