Defines some extra convenience functions for ldns_rr structures. More...
Go to the source code of this file.
Typedefs | |
typedef 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 ldns_rr_soa_increment_int. More... | |
Functions | |
ldns_rdf * | ldns_rr_a_address (const ldns_rr *r) |
returns the address of a LDNS_RR_TYPE_A rr More... | |
bool | ldns_rr_a_set_address (ldns_rr *r, ldns_rdf *f) |
sets the address of a LDNS_RR_TYPE_A rr More... | |
ldns_rdf * | ldns_rr_ns_nsdname (const ldns_rr *r) |
returns the name of a LDNS_RR_TYPE_NS rr More... | |
ldns_rdf * | ldns_rr_mx_preference (const ldns_rr *r) |
returns the mx pref. More... | |
ldns_rdf * | ldns_rr_mx_exchange (const ldns_rr *r) |
returns the mx host of a LDNS_RR_TYPE_MX rr More... | |
ldns_rdf * | ldns_rr_rrsig_typecovered (const ldns_rr *r) |
returns the type covered of a LDNS_RR_TYPE_RRSIG rr More... | |
bool | ldns_rr_rrsig_set_typecovered (ldns_rr *r, ldns_rdf *f) |
sets the typecovered of a LDNS_RR_TYPE_RRSIG rr More... | |
ldns_rdf * | ldns_rr_rrsig_algorithm (const ldns_rr *r) |
returns the algorithm of a LDNS_RR_TYPE_RRSIG RR More... | |
bool | ldns_rr_rrsig_set_algorithm (ldns_rr *r, ldns_rdf *f) |
sets the algorithm of a LDNS_RR_TYPE_RRSIG rr More... | |
ldns_rdf * | ldns_rr_rrsig_labels (const ldns_rr *r) |
returns the number of labels of a LDNS_RR_TYPE_RRSIG RR More... | |
bool | ldns_rr_rrsig_set_labels (ldns_rr *r, ldns_rdf *f) |
sets the number of labels of a LDNS_RR_TYPE_RRSIG rr More... | |
ldns_rdf * | ldns_rr_rrsig_origttl (const ldns_rr *r) |
returns the original TTL of a LDNS_RR_TYPE_RRSIG RR More... | |
bool | ldns_rr_rrsig_set_origttl (ldns_rr *r, ldns_rdf *f) |
sets the original TTL of a LDNS_RR_TYPE_RRSIG rr More... | |
ldns_rdf * | ldns_rr_rrsig_expiration (const ldns_rr *r) |
returns the expiration time of a LDNS_RR_TYPE_RRSIG RR More... | |
bool | ldns_rr_rrsig_set_expiration (ldns_rr *r, ldns_rdf *f) |
sets the expiration date of a LDNS_RR_TYPE_RRSIG rr More... | |
ldns_rdf * | ldns_rr_rrsig_inception (const ldns_rr *r) |
returns the inception time of a LDNS_RR_TYPE_RRSIG RR More... | |
bool | ldns_rr_rrsig_set_inception (ldns_rr *r, ldns_rdf *f) |
sets the inception date of a LDNS_RR_TYPE_RRSIG rr More... | |
ldns_rdf * | ldns_rr_rrsig_keytag (const ldns_rr *r) |
returns the keytag of a LDNS_RR_TYPE_RRSIG RR More... | |
bool | ldns_rr_rrsig_set_keytag (ldns_rr *r, ldns_rdf *f) |
sets the keytag of a LDNS_RR_TYPE_RRSIG rr More... | |
ldns_rdf * | ldns_rr_rrsig_signame (const ldns_rr *r) |
returns the signers name of a LDNS_RR_TYPE_RRSIG RR More... | |
bool | ldns_rr_rrsig_set_signame (ldns_rr *r, ldns_rdf *f) |
sets the signers name of a LDNS_RR_TYPE_RRSIG rr More... | |
ldns_rdf * | ldns_rr_rrsig_sig (const ldns_rr *r) |
returns the signature data of a LDNS_RR_TYPE_RRSIG RR More... | |
bool | ldns_rr_rrsig_set_sig (ldns_rr *r, ldns_rdf *f) |
sets the signature data of a LDNS_RR_TYPE_RRSIG rr More... | |
ldns_rdf * | ldns_rr_dnskey_flags (const ldns_rr *r) |
returns the flags of a LDNS_RR_TYPE_DNSKEY rr More... | |
bool | ldns_rr_dnskey_set_flags (ldns_rr *r, ldns_rdf *f) |
sets the flags of a LDNS_RR_TYPE_DNSKEY rr More... | |
ldns_rdf * | ldns_rr_dnskey_protocol (const ldns_rr *r) |
returns the protocol of a LDNS_RR_TYPE_DNSKEY rr More... | |
bool | ldns_rr_dnskey_set_protocol (ldns_rr *r, ldns_rdf *f) |
sets the protocol of a LDNS_RR_TYPE_DNSKEY rr More... | |
ldns_rdf * | ldns_rr_dnskey_algorithm (const ldns_rr *r) |
returns the algorithm of a LDNS_RR_TYPE_DNSKEY rr More... | |
bool | ldns_rr_dnskey_set_algorithm (ldns_rr *r, ldns_rdf *f) |
sets the algorithm of a LDNS_RR_TYPE_DNSKEY rr More... | |
ldns_rdf * | ldns_rr_dnskey_key (const ldns_rr *r) |
returns the key data of a LDNS_RR_TYPE_DNSKEY rr More... | |
bool | ldns_rr_dnskey_set_key (ldns_rr *r, ldns_rdf *f) |
sets the key data of a LDNS_RR_TYPE_DNSKEY rr More... | |
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 More... | |
size_t | ldns_rr_dnskey_key_size (const ldns_rr *key) |
get the length of the keydata in bits More... | |
uint32_t | ldns_soa_serial_identity (uint32_t unused, void *data) |
Function to be used with dns_rr_soa_increment_func_int, to set the soa serial number. More... | |
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. More... | |
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 certain amount. More... | |
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 serial to the number of seconds since unix epoch (1-1-1970 00:00). More... | |
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 serial to the current date succeeded by a two digit iteration (datecounter). More... | |
void | ldns_rr_soa_increment (ldns_rr *soa) |
Increment the serial number of the given SOA by one. More... | |
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. More... | |
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 argument. More... | |
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 the function. More... | |
Defines some extra convenience functions for ldns_rr structures.
Definition in file rr_functions.h.
typedef 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 ldns_rr_soa_increment_int.
The function will be called with as the first argument the current serial number of the SOA RR to be updated, and as the second argument a value given when calling ldns_rr_soa_increment_func_data or ldns_rr_soa_increment_int. With ldns_rr_soa_increment_int the pointer value holds the integer value passed to ldns_rr_soa_increment_int, and it should be cast to intptr_t to be used as an integer by the serial modifying function.
Definition at line 266 of file rr_functions.h.
returns the address of a LDNS_RR_TYPE_A rr
[in] | r | the resource record |
Definition at line 61 of file rr_functions.c.
References ldns_rr_get_type(), ldns_rr_rdf(), LDNS_RR_TYPE_A, and LDNS_RR_TYPE_AAAA.
sets the address of a LDNS_RR_TYPE_A rr
[in] | r | the rr to use |
[in] | f | the address to set |
Definition at line 72 of file rr_functions.c.
References LDNS_FREE, ldns_rr_get_type(), ldns_rr_set_rdf(), LDNS_RR_TYPE_A, and LDNS_RR_TYPE_AAAA.
returns the name of a LDNS_RR_TYPE_NS rr
[in] | r | the resource record |
Definition at line 91 of file rr_functions.c.
returns the mx pref.
of a LDNS_RR_TYPE_MX rr
[in] | r | the resource record |
Definition at line 98 of file rr_functions.c.
returns the mx host of a LDNS_RR_TYPE_MX rr
[in] | r | the resource record |
Definition at line 104 of file rr_functions.c.
returns the type covered of a LDNS_RR_TYPE_RRSIG rr
[in] | r | the resource record |
Definition at line 111 of file rr_functions.c.
sets the typecovered of a LDNS_RR_TYPE_RRSIG rr
[in] | r | the rr to use |
[in] | f | the typecovered to set |
Definition at line 117 of file rr_functions.c.
returns the algorithm of a LDNS_RR_TYPE_RRSIG RR
[in] | r | the resource record |
Definition at line 123 of file rr_functions.c.
sets the algorithm of a LDNS_RR_TYPE_RRSIG rr
[in] | r | the rr to use |
[in] | f | the algorithm to set |
Definition at line 129 of file rr_functions.c.
returns the number of labels of a LDNS_RR_TYPE_RRSIG RR
[in] | r | the resource record |
Definition at line 135 of file rr_functions.c.
sets the number of labels of a LDNS_RR_TYPE_RRSIG rr
[in] | r | the rr to use |
[in] | f | the number of labels to set |
Definition at line 141 of file rr_functions.c.
returns the original TTL of a LDNS_RR_TYPE_RRSIG RR
[in] | r | the resource record |
Definition at line 147 of file rr_functions.c.
sets the original TTL of a LDNS_RR_TYPE_RRSIG rr
[in] | r | the rr to use |
[in] | f | the original TTL to set |
Definition at line 153 of file rr_functions.c.
returns the expiration time of a LDNS_RR_TYPE_RRSIG RR
[in] | r | the resource record |
Definition at line 159 of file rr_functions.c.
sets the expiration date of a LDNS_RR_TYPE_RRSIG rr
[in] | r | the rr to use |
[in] | f | the expiration date to set |
Definition at line 165 of file rr_functions.c.
returns the inception time of a LDNS_RR_TYPE_RRSIG RR
[in] | r | the resource record |
Definition at line 171 of file rr_functions.c.
sets the inception date of a LDNS_RR_TYPE_RRSIG rr
[in] | r | the rr to use |
[in] | f | the inception date to set |
Definition at line 177 of file rr_functions.c.
returns the keytag of a LDNS_RR_TYPE_RRSIG RR
[in] | r | the resource record |
Definition at line 183 of file rr_functions.c.
sets the keytag of a LDNS_RR_TYPE_RRSIG rr
[in] | r | the rr to use |
[in] | f | the keytag to set |
Definition at line 189 of file rr_functions.c.
returns the signers name of a LDNS_RR_TYPE_RRSIG RR
[in] | r | the resource record |
Definition at line 195 of file rr_functions.c.
sets the signers name of a LDNS_RR_TYPE_RRSIG rr
[in] | r | the rr to use |
[in] | f | the signers name to set |
Definition at line 201 of file rr_functions.c.
returns the signature data of a LDNS_RR_TYPE_RRSIG RR
[in] | r | the resource record |
Definition at line 207 of file rr_functions.c.
sets the signature data of a LDNS_RR_TYPE_RRSIG rr
[in] | r | the rr to use |
[in] | f | the signature data to set |
Definition at line 213 of file rr_functions.c.
returns the flags of a LDNS_RR_TYPE_DNSKEY rr
[in] | r | the resource record |
Definition at line 220 of file rr_functions.c.
sets the flags of a LDNS_RR_TYPE_DNSKEY rr
[in] | r | the rr to use |
[in] | f | the flags to set |
Definition at line 226 of file rr_functions.c.
returns the protocol of a LDNS_RR_TYPE_DNSKEY rr
[in] | r | the resource record |
Definition at line 232 of file rr_functions.c.
sets the protocol of a LDNS_RR_TYPE_DNSKEY rr
[in] | r | the rr to use |
[in] | f | the protocol to set |
Definition at line 238 of file rr_functions.c.
returns the algorithm of a LDNS_RR_TYPE_DNSKEY rr
[in] | r | the resource record |
Definition at line 244 of file rr_functions.c.
sets the algorithm of a LDNS_RR_TYPE_DNSKEY rr
[in] | r | the rr to use |
[in] | f | the algorithm to set |
Definition at line 250 of file rr_functions.c.
returns the key data of a LDNS_RR_TYPE_DNSKEY rr
[in] | r | the resource record |
Definition at line 256 of file rr_functions.c.
sets the key data of a LDNS_RR_TYPE_DNSKEY rr
[in] | r | the rr to use |
[in] | f | the key data to set |
Definition at line 262 of file rr_functions.c.
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
[in] | keydata | the raw key data |
[in] | len | the length of the keydata |
[in] | alg | the cryptographic algorithm this is a key for |
Definition at line 268 of file rr_functions.c.
References LDNS_SIGN_DSA, LDNS_SIGN_DSA_NSEC3, LDNS_SIGN_ECC_GOST, LDNS_SIGN_ECDSAP256SHA256, LDNS_SIGN_ECDSAP384SHA384, LDNS_SIGN_ED25519, LDNS_SIGN_ED448, LDNS_SIGN_HMACMD5, LDNS_SIGN_RSAMD5, LDNS_SIGN_RSASHA1, LDNS_SIGN_RSASHA1_NSEC3, LDNS_SIGN_RSASHA256, and LDNS_SIGN_RSASHA512.
size_t ldns_rr_dnskey_key_size | ( | const ldns_rr * | key | ) |
get the length of the keydata in bits
[in] | key | the key rr to use |
Definition at line 344 of file rr_functions.c.
References ldns_rdf2native_int8(), ldns_rdf_data(), ldns_rdf_size(), ldns_rr_dnskey_algorithm(), ldns_rr_dnskey_key(), and ldns_rr_dnskey_key_size_raw().
uint32_t ldns_soa_serial_identity | ( | uint32_t | unused, |
void * | data | ||
) |
Function to be used with dns_rr_soa_increment_func_int, to set the soa serial number.
[in] | unused | the (unused) current serial number. |
[in] | data | the serial number to be set. |
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.
[in] | s | the current serial number. |
[in] | unused | unused. |
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 certain amount.
[in] | s | the current serial number. |
[in] | data | the amount to add to the current serial number. |
Definition at line 366 of file rr_functions.c.
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 serial to the number of seconds since unix epoch (1-1-1970 00:00).
When data is given (i.e. the function is called via ldns_rr_soa_increment_func_int), it is used as the current time. When the resulting serial number is smaller than the current serial number, the current serial number is increased by one.
[in] | s | the current serial number. |
[in] | data | the time in seconds since 1-1-1970 00:00 |
Definition at line 383 of file rr_functions.c.
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 serial to the current date succeeded by a two digit iteration (datecounter).
When data is given (i.e. the function is called via ldns_rr_soa_increment_func_int), it is used as the current time. When the resulting serial number is smaller than the current serial number, the current serial number is increased by one.
[in] | s | the current serial number. |
[in] | data | the time in seconds since 1-1-1970 00:00 |
Definition at line 371 of file rr_functions.c.
void ldns_rr_soa_increment | ( | ldns_rr * | soa | ) |
Increment the serial number of the given SOA by one.
[in] | soa | The soa rr to be incremented |
Definition at line 391 of file rr_functions.c.
References ldns_rr_soa_increment_func_data(), and ldns_soa_serial_increment().
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.
Included functions to be used here are: ldns_rr_soa_increment, ldns_soa_serial_unixtime and ldns_soa_serial_datecounter.
[in] | soa | The soa rr to be incremented |
[in] | f | the function to use to increment the soa rr. |
Definition at line 397 of file rr_functions.c.
References 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 argument.
[in] | soa | The soa rr to be incremented |
[in] | f | the function to use to increment the soa rr. |
[in] | data | this argument will be passed to f as the second argument. |
Definition at line 403 of file rr_functions.c.
References LDNS_FREE, ldns_native2rdf_int32(), ldns_rdf2native_int32(), LDNS_RDF_TYPE_INT32, ldns_rr_get_type(), ldns_rr_rdf(), ldns_rr_set_rdf(), and LDNS_RR_TYPE_SOA.
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 the function.
Included functions to be used here are: ldns_soa_serial_identity, ldns_rr_soa_increment_by, ldns_soa_serial_unixtime and ldns_soa_serial_datecounter.
[in] | soa | The soa rr to be incremented |
[in] | f | the function to use to increment the soa rr. |
[in] | data | this argument will be passed to f as the second argument (by casting it to void*). |
Definition at line 426 of file rr_functions.c.
References ldns_rr_soa_increment_func_data().