ldns documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

rr_functions.h
Go to the documentation of this file.
1 /*
2 * rr_functions.h
3 *
4 * the .h file with defs for the per rr
5 * functions
6 *
7 * a Net::DNS like library for C
8 *
9 * (c) NLnet Labs, 2005-2006
10 *
11 * See the file LICENSE for the license
12 */
13 #ifndef LDNS_RR_FUNCTIONS_H
14 #define LDNS_RR_FUNCTIONS_H
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
26 /* A / AAAA */
32 ldns_rdf* ldns_rr_a_address(const ldns_rr *r);
33
40 bool ldns_rr_a_set_address(ldns_rr *r, ldns_rdf *f);
41
42 /* NS */
48 ldns_rdf* ldns_rr_ns_nsdname(const ldns_rr *r);
49
50 /* MX */
56 ldns_rdf* ldns_rr_mx_preference(const ldns_rr *r);
62 ldns_rdf* ldns_rr_mx_exchange(const ldns_rr *r);
63
64 /* RRSIG */
70 ldns_rdf* ldns_rr_rrsig_typecovered(const ldns_rr *r);
77 bool ldns_rr_rrsig_set_typecovered(ldns_rr *r, ldns_rdf *f);
83 ldns_rdf* ldns_rr_rrsig_algorithm(const ldns_rr *r);
90 bool ldns_rr_rrsig_set_algorithm(ldns_rr *r, ldns_rdf *f);
96 ldns_rdf *ldns_rr_rrsig_labels(const ldns_rr *r);
103 bool ldns_rr_rrsig_set_labels(ldns_rr *r, ldns_rdf *f);
109 ldns_rdf* ldns_rr_rrsig_origttl(const ldns_rr *r);
116 bool ldns_rr_rrsig_set_origttl(ldns_rr *r, ldns_rdf *f);
122 ldns_rdf* ldns_rr_rrsig_expiration(const ldns_rr *r);
129 bool ldns_rr_rrsig_set_expiration(ldns_rr *r, ldns_rdf *f);
135 ldns_rdf* ldns_rr_rrsig_inception(const ldns_rr *r);
142 bool ldns_rr_rrsig_set_inception(ldns_rr *r, ldns_rdf *f);
148 ldns_rdf* ldns_rr_rrsig_keytag(const ldns_rr *r);
155 bool ldns_rr_rrsig_set_keytag(ldns_rr *r, ldns_rdf *f);
161 ldns_rdf* ldns_rr_rrsig_signame(const ldns_rr *r);
168 bool ldns_rr_rrsig_set_signame(ldns_rr *r, ldns_rdf *f);
174 ldns_rdf* ldns_rr_rrsig_sig(const ldns_rr *r);
181 bool ldns_rr_rrsig_set_sig(ldns_rr *r, ldns_rdf *f);
182
183 /* DNSKEY */
189 ldns_rdf* ldns_rr_dnskey_flags(const ldns_rr *r);
196 bool ldns_rr_dnskey_set_flags(ldns_rr *r, ldns_rdf *f);
202 ldns_rdf* ldns_rr_dnskey_protocol(const ldns_rr *r);
209 bool ldns_rr_dnskey_set_protocol(ldns_rr *r, ldns_rdf *f);
215 ldns_rdf* ldns_rr_dnskey_algorithm(const ldns_rr *r);
222 bool ldns_rr_dnskey_set_algorithm(ldns_rr *r, ldns_rdf *f);
228 ldns_rdf* ldns_rr_dnskey_key(const ldns_rr *r);
235 bool ldns_rr_dnskey_set_key(ldns_rr *r, ldns_rdf *f);
236
244 size_t ldns_rr_dnskey_key_size_raw(const unsigned char *keydata,
245 const size_t len,
246 const ldns_algorithm alg);
247
253 size_t ldns_rr_dnskey_key_size(const ldns_rr *key);
254
266 typedef uint32_t (*ldns_soa_serial_increment_func_t)(uint32_t, void*);
267
274 uint32_t ldns_soa_serial_identity(uint32_t unused, void *data);
275
282 uint32_t ldns_soa_serial_increment(uint32_t s, void *unused);
283
290 uint32_t ldns_soa_serial_increment_by(uint32_t s, void *data);
291
303 uint32_t ldns_soa_serial_unixtime(uint32_t s, void *data);
304
316 uint32_t ldns_soa_serial_datecounter(uint32_t s, void *data);
317
322 void ldns_rr_soa_increment(
323 ldns_rr *soa);
324
332 void ldns_rr_soa_increment_func(
333 ldns_rr *soa, ldns_soa_serial_increment_func_t f);
334
342 void ldns_rr_soa_increment_func_data(
343 ldns_rr *soa, ldns_soa_serial_increment_func_t f, void *data);
344
356 void ldns_rr_soa_increment_func_int(
357 ldns_rr *soa, ldns_soa_serial_increment_func_t f, int data);
358
359 #ifdef __cplusplus
360 }
361 #endif
362
363 #endif /* LDNS_RR_FUNCTIONS_H */
ldns_rr_rrsig_set_origttl
bool 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_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_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_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_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_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:414
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_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_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_set_algorithm
bool 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_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:371
ldns_rr_rrsig_set_labels
bool 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_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_rrsig_set_algorithm
bool 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_size
size_t ldns_rr_dnskey_key_size(const ldns_rr *key)
get the length of the keydata in bits
Definition: rr_functions.c:332
ldns_rr_rrsig_set_typecovered
bool 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_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_struct_rr
Resource Record.
Definition: rr.h:299
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:385
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_set_protocol
bool 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_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:354
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_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:359
ldns_rr_dnskey_set_flags
bool 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_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:391
ldns_rr_rrsig_set_expiration
bool ldns_rr_rrsig_set_expiration(ldns_rr *r, ldns_rdf *f)
sets the expireation date of a LDNS_RR_TYPE_RRSIG rr
Definition: rr_functions.c:165
ldns_rr_rrsig_set_signame
bool 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_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_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
bool 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_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_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_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_sig
bool 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_rrsig_set_keytag
bool 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_rr_dnskey_set_key
bool 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_struct_rdf
Resource record data field.
Definition: rdata.h:166
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_soa_increment
void ldns_rr_soa_increment(ldns_rr *soa)
Increment the serial number of the given SOA by one.
Definition: rr_functions.c:379
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_rrsig_set_inception
bool 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_soa_serial_identity
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.
ldns_algorithm
enum ldns_enum_algorithm ldns_algorithm
Definition: keys.h:62