301 if (keydata[0] == 0) {
304 memmove(&int16, keydata + 1, 2);
306 return (len - exp - 3)*8;
312 return (len-exp-1)*8;
358 return (uint32_t) (intptr_t) data;
368 return s + (intptr_t) data;
376 time_t t = data ? (time_t) (intptr_t) data : ldns_time(NULL);
378 (void) strftime(s_str, 11,
"%Y%m%d00", localtime_r(&t, &tm));
379 new_s = (int32_t) atoi(s_str);
380 return new_s - ((int32_t) s) <= 0 ? s+1 : ((uint32_t) new_s);
385 int32_t new_s = data ? (int32_t) (intptr_t) data
386 : (int32_t) ldns_time(NULL);
387 return new_s - ((int32_t) s) <= 0 ? s+1 : ((uint32_t) new_s);
enum ldns_enum_signing_algorithm ldns_signing_algorithm
@ LDNS_SIGN_ECDSAP256SHA256
@ LDNS_SIGN_RSASHA1_NSEC3
@ LDNS_SIGN_ECDSAP384SHA384
enum ldns_enum_algorithm ldns_algorithm
Including this file will include all ldns files, and define some lookup tables.
void ldns_rdf_deep_free(ldns_rdf *rd)
frees a rdf structure and frees the data.
uint32_t ldns_rdf2native_int32(const ldns_rdf *rd)
returns the native uint32_t representation from the rdf.
uint8_t ldns_rdf2native_int8(const ldns_rdf *rd)
returns the native uint8_t representation from the rdf.
@ LDNS_RDF_TYPE_INT32
32 bits
size_t ldns_rdf_size(const ldns_rdf *rd)
returns the size of the rdf.
uint8_t * ldns_rdf_data(const ldns_rdf *rd)
returns the data of the rdf.
ldns_rdf * ldns_native2rdf_int32(ldns_rdf_type type, uint32_t value)
returns an rdf that contains the given int32 value.
enum ldns_enum_rr_type ldns_rr_type
@ LDNS_RR_TYPE_RRSIG
DNSSEC.
@ LDNS_RR_TYPE_A
a host address
@ LDNS_RR_TYPE_SOA
marks the start of a zone of authority
@ LDNS_RR_TYPE_AAAA
ipv6 address
@ LDNS_RR_TYPE_NS
an authoritative name server
@ LDNS_RR_TYPE_MX
mail exchange
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.
ldns_rr_type ldns_rr_get_type(const ldns_rr *rr)
returns the type of the rr.
ldns_rdf * ldns_rr_rdf(const ldns_rr *rr, size_t nr)
returns the rdata field member counter.
ldns_rdf * ldns_rr_dnskey_key(const ldns_rr *r)
returns the key data of a LDNS_RR_TYPE_DNSKEY rr
signed char ldns_rr_dnskey_set_protocol(ldns_rr *r, ldns_rdf *f)
sets the protocol of a LDNS_RR_TYPE_DNSKEY rr
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
signed char ldns_rr_rrsig_set_keytag(ldns_rr *r, ldns_rdf *f)
sets the keytag of a LDNS_RR_TYPE_RRSIG rr
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 ...
signed char ldns_rr_rrsig_set_origttl(ldns_rr *r, ldns_rdf *f)
sets the original TTL of a LDNS_RR_TYPE_RRSIG rr
signed char ldns_rr_rrsig_set_typecovered(ldns_rr *r, ldns_rdf *f)
sets the typecovered of a LDNS_RR_TYPE_RRSIG rr
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...
uint32_t ldns_soa_serial_increment(uint32_t s, void *unused __attribute__((unused)))
ldns_rdf * ldns_rr_dnskey_flags(const ldns_rr *r)
returns the flags of a LDNS_RR_TYPE_DNSKEY rr
ldns_rdf * ldns_rr_dnskey_algorithm(const ldns_rr *r)
returns the algorithm of a LDNS_RR_TYPE_DNSKEY rr
ldns_rdf * ldns_rr_rrsig_algorithm(const ldns_rr *r)
returns the algorithm of a LDNS_RR_TYPE_RRSIG RR
ldns_rdf * ldns_rr_rrsig_inception(const ldns_rr *r)
returns the inception time of a LDNS_RR_TYPE_RRSIG RR
ldns_rdf * ldns_rr_ns_nsdname(const ldns_rr *r)
returns the name of a LDNS_RR_TYPE_NS rr
ldns_rdf * ldns_rr_rrsig_expiration(const ldns_rr *r)
returns the expiration time of a LDNS_RR_TYPE_RRSIG RR
ldns_rdf * ldns_rr_rrsig_keytag(const ldns_rr *r)
returns the keytag of a LDNS_RR_TYPE_RRSIG RR
ldns_rdf * ldns_rr_dnskey_protocol(const ldns_rr *r)
returns the protocol of a LDNS_RR_TYPE_DNSKEY rr
size_t ldns_rr_dnskey_key_size(const ldns_rr *key)
get the length of the keydata in bits
signed char ldns_rr_rrsig_set_sig(ldns_rr *r, ldns_rdf *f)
sets the signature data of a LDNS_RR_TYPE_RRSIG rr
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.
signed char ldns_rr_dnskey_set_flags(ldns_rr *r, ldns_rdf *f)
sets the flags of a LDNS_RR_TYPE_DNSKEY rr
signed char ldns_rr_rrsig_set_algorithm(ldns_rr *r, ldns_rdf *f)
sets the algorithm of a LDNS_RR_TYPE_RRSIG rr
ldns_rdf * ldns_rr_rrsig_labels(const ldns_rr *r)
returns the number of labels of a LDNS_RR_TYPE_RRSIG RR
signed char ldns_rr_a_set_address(ldns_rr *r, ldns_rdf *f)
sets the address of a LDNS_RR_TYPE_A rr
ldns_rdf * ldns_rr_rrsig_origttl(const ldns_rr *r)
returns the original TTL of a LDNS_RR_TYPE_RRSIG RR
ldns_rdf * ldns_rr_mx_preference(const ldns_rr *r)
returns the mx pref.
signed char ldns_rr_dnskey_set_key(ldns_rr *r, ldns_rdf *f)
sets the key data of a LDNS_RR_TYPE_DNSKEY rr
ldns_rdf * ldns_rr_mx_exchange(const ldns_rr *r)
returns the mx host of a LDNS_RR_TYPE_MX rr
signed char ldns_rr_dnskey_set_algorithm(ldns_rr *r, ldns_rdf *f)
sets the algorithm of a LDNS_RR_TYPE_DNSKEY rr
uint32_t ldns_soa_serial_identity(uint32_t unused __attribute__((unused)), void *data)
void ldns_rr_soa_increment(ldns_rr *soa)
Increment the serial number of the given SOA by one.
ldns_rdf * ldns_rr_rrsig_typecovered(const ldns_rr *r)
returns the type covered of a LDNS_RR_TYPE_RRSIG rr
ldns_rdf * ldns_rr_rrsig_sig(const ldns_rr *r)
returns the signature data of a LDNS_RR_TYPE_RRSIG RR
signed char ldns_rr_rrsig_set_expiration(ldns_rr *r, ldns_rdf *f)
sets the expiration date of a LDNS_RR_TYPE_RRSIG rr
ldns_rdf * ldns_rr_rrsig_signame(const ldns_rr *r)
returns the signers name of a LDNS_RR_TYPE_RRSIG RR
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...
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
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...
ldns_rdf * ldns_rr_a_address(const ldns_rr *r)
returns the address of a LDNS_RR_TYPE_A rr
signed char ldns_rr_rrsig_set_inception(ldns_rr *r, ldns_rdf *f)
sets the inception date of a LDNS_RR_TYPE_RRSIG rr
signed char ldns_rr_rrsig_set_signame(ldns_rr *r, ldns_rdf *f)
sets the signers name of a LDNS_RR_TYPE_RRSIG rr
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 ...
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...
Resource record data field.