32 if (!zone_rdf || !up_rrlist) {
134 ldns_rdf *soa_zone = NULL, *soa_mname = NULL;
213 nslist[0] = nslist[i];
225 nslist[0] = nslist[i];
270 *zone_rdf = soa_zone;
271 *mname_rdf = soa_mname;
ldns_rdf * ldns_dname_new_frm_str(const char *str)
creates a new dname rdf from a string.
enum ldns_enum_status ldns_status
Including this file will include all ldns files, and define some lookup tables.
void ldns_pkt_free(ldns_pkt *packet)
frees the packet structure and all data that it contains.
void ldns_pkt_set_additional(ldns_pkt *p, ldns_rr_list *rr)
directly set the additional section
ldns_rr_list * ldns_pkt_authority(const ldns_pkt *p)
Return the packet's authority section.
void ldns_pkt_set_authority(ldns_pkt *p, ldns_rr_list *rr)
directly set the authority section
uint16_t ldns_pkt_ancount(const ldns_pkt *p)
Return the packet's an count.
uint16_t ldns_pkt_nscount(const ldns_pkt *p)
Return the packet's ns count.
ldns_rr_list * ldns_pkt_answer(const ldns_pkt *p)
Return the packet's answer section.
void ldns_pkt_set_answer(ldns_pkt *p, ldns_rr_list *rr)
directly set the answer section
void ldns_pkt_set_qdcount(ldns_pkt *p, uint16_t c)
Set the packet's qd count.
uint16_t ldns_pkt_qdcount(const ldns_pkt *p)
Return the packet's qd count.
void ldns_pkt_set_arcount(ldns_pkt *p, uint16_t c)
Set the packet's arcount.
void ldns_pkt_set_opcode(ldns_pkt *p, ldns_pkt_opcode c)
Set the packet's opcode.
uint16_t ldns_pkt_arcount(const ldns_pkt *p)
Return the packet's ar count.
void ldns_pkt_set_random_id(ldns_pkt *p)
Set the packet's id to a random value.
void ldns_pkt_set_ancount(ldns_pkt *p, uint16_t c)
Set the packet's an count.
void ldns_pkt_set_nscount(ldns_pkt *p, uint16_t c)
Set the packet's ns count.
ldns_pkt * ldns_pkt_query_new(ldns_rdf *rr_name, ldns_rr_type rr_type, ldns_rr_class rr_class, uint16_t flags)
creates a packet with a query in it for the given name, type and class.
int ldns_rdf_compare(const ldns_rdf *rd1, const ldns_rdf *rd2)
compares two rdf's on their wire formats.
ldns_rdf * ldns_rdf_clone(const ldns_rdf *rd)
clones a rdf structure.
const char * ldns_resolver_tsig_algorithm(const ldns_resolver *r)
Return the tsig algorithm as used by the nameserver.
ldns_resolver * ldns_resolver_clone(ldns_resolver *r)
Clone a resolver.
const char * ldns_resolver_tsig_keydata(const ldns_resolver *r)
Return the tsig keydata as used by the nameserver.
size_t ldns_resolver_nameserver_count(const ldns_resolver *r)
How many nameserver are configured in the resolver.
void ldns_resolver_free(ldns_resolver *res)
Frees the allocated space for this resolver.
ldns_status ldns_resolver_push_nameserver(ldns_resolver *r, const ldns_rdf *n)
Push a new nameserver to the resolver.
const char * ldns_resolver_tsig_keyname(const ldns_resolver *r)
Return the tsig keyname as used by the nameserver.
ldns_rdf ** ldns_resolver_nameservers(const ldns_resolver *r)
Return the configured nameserver ip address.
void ldns_resolver_set_random(ldns_resolver *r, signed char b)
Should the nameserver list be randomized before each use.
ldns_status ldns_resolver_send_pkt(ldns_pkt **answer, ldns_resolver *r, ldns_pkt *query_pkt)
Send the given packet to a nameserver.
ldns_rr * ldns_rr_list_pop_rr(ldns_rr_list *rr_list)
pops the last rr from an rrlist.
ldns_rdf * ldns_rr_owner(const ldns_rr *rr)
returns the owner name of an rr structure.
void ldns_rr_list_deep_free(ldns_rr_list *rr_list)
frees an rr_list structure and all rrs contained therein.
@ LDNS_RR_TYPE_A
a host address
@ LDNS_RR_TYPE_SOA
marks the start of a zone of authority
size_t ldns_rr_list_rr_count(const ldns_rr_list *rr_list)
returns the number of rr's in an rr_list.
ldns_rr_type ldns_rr_get_type(const ldns_rr *rr)
returns the type of the rr.
enum ldns_enum_rr_class ldns_rr_class
@ LDNS_RR_CLASS_IN
the Internet
ldns_rr_list * ldns_rr_list_clone(const ldns_rr_list *rrlist)
clones an rrlist.
ldns_rdf * ldns_rr_rdf(const ldns_rr *rr, size_t nr)
returns the rdata field member counter.
ldns_rr_list * _authority
Authority section.
ldns_rr_list * _answer
Answer section.
ldns_rr_list * _additional
Additional section.
Resource record data field.
DNS stub resolver structure.
List or Set of Resource Records.
ldns_status ldns_pkt_tsig_sign(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge, const char *algorithm_name, const ldns_rdf *query_mac)
creates a tsig rr for the given packet and key.
uint16_t ldns_update_ad(const ldns_pkt *p)
Get the zo count.
void ldns_update_set_zo(ldns_pkt *p, uint16_t v)
Set the zo count.
void ldns_update_set_adcount(ldns_pkt *p, uint16_t v)
Set the ad count.
uint16_t ldns_update_upcount(const ldns_pkt *p)
Get the zo count.
uint16_t ldns_update_zocount(const ldns_pkt *p)
Get the zo count.
ldns_status ldns_update_soa_zone_mname(const char *fqdn, ldns_resolver *r, ldns_rr_class c, ldns_rdf **zone_rdf, ldns_rdf **mname_rdf)
ldns_pkt * ldns_update_pkt_new(ldns_rdf *zone_rdf, ldns_rr_class c, const ldns_rr_list *pr_rrlist, const ldns_rr_list *up_rrlist, const ldns_rr_list *ad_rrlist)
create an update packet from zone name, class and the rr lists
uint16_t ldns_update_prcount(const ldns_pkt *p)
Get the zo count.
void ldns_update_set_prcount(ldns_pkt *p, uint16_t v)
Set the pr count.
void ldns_update_set_upcount(ldns_pkt *p, uint16_t v)
Set the up count.
ldns_status ldns_update_pkt_tsig_add(ldns_pkt *p, const ldns_resolver *r)
add tsig credentials to a packet from a resolver
ldns_status ldns_update_soa_mname(ldns_rdf *zone, ldns_resolver *r, ldns_rr_class c, ldns_rdf **mname)