update.h File Reference

Defines functions to perform UPDATE queries. More...

Go to the source code of this file.

Functions

ldns_pktldns_update_pkt_new (ldns_rdf *zone_rdf, ldns_rr_class clas, 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 More...
 
ldns_status ldns_update_pkt_tsig_add (ldns_pkt *p, const ldns_resolver *r)
 add tsig credentials to a packet from a resolver More...
 
uint16_t ldns_update_zocount (const ldns_pkt *p)
 Get the zo count. More...
 
uint16_t ldns_update_prcount (const ldns_pkt *p)
 Get the zo count. More...
 
uint16_t ldns_update_upcount (const ldns_pkt *p)
 Get the zo count. More...
 
uint16_t ldns_update_ad (const ldns_pkt *p)
 Get the zo count. More...
 
void ldns_update_set_zo (ldns_pkt *p, uint16_t c)
 Set the zo count. More...
 
void ldns_update_set_prcount (ldns_pkt *p, uint16_t c)
 Set the pr count. More...
 
void ldns_update_set_upcount (ldns_pkt *p, uint16_t c)
 Set the up count. More...
 
void ldns_update_set_adcount (ldns_pkt *p, uint16_t c)
 Set the ad count. More...
 
ldns_status ldns_update_soa_mname (ldns_rdf *zone, ldns_resolver *r, ldns_rr_class c, ldns_rdf **mname)
 
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)
 

Detailed Description

Defines functions to perform UPDATE queries.

Definition in file update.h.

Function Documentation

◆ ldns_update_pkt_new()

ldns_pkt* ldns_update_pkt_new ( ldns_rdf zone_rdf,
ldns_rr_class  clas,
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

Parameters
[in]zone_rdfname of the zone The returned packet will take ownership of zone_rdf, so the caller should not free it
[in]claszone class
[in]pr_rrlistlist of Prerequisite Section RRs
[in]up_rrlistlist of Updates Section RRs
[in]ad_rrlistlist of Additional Data Section RRs (currently unused)
Returns
the new packet

Definition at line 27 of file update.c.

References ldns_struct_pkt::_additional, ldns_struct_pkt::_answer, ldns_struct_pkt::_authority, LDNS_PACKET_UPDATE, ldns_pkt_query_new(), ldns_pkt_set_additional(), ldns_pkt_set_answer(), ldns_pkt_set_authority(), ldns_pkt_set_opcode(), LDNS_RD, LDNS_RR_CLASS_IN, ldns_rr_list_clone(), ldns_rr_list_deep_free(), ldns_rr_list_rr_count(), LDNS_RR_TYPE_SOA, ldns_update_set_adcount(), ldns_update_set_prcount(), and ldns_update_set_upcount().

◆ ldns_update_pkt_tsig_add()

ldns_status ldns_update_pkt_tsig_add ( ldns_pkt p,
const ldns_resolver r 
)

add tsig credentials to a packet from a resolver

Parameters
[in]ppacket to copy to
[in]rresolver to copy from
Returns
status whether successful or not

Definition at line 70 of file update.c.

References ldns_pkt_tsig_sign(), ldns_resolver_tsig_algorithm(), ldns_resolver_tsig_keydata(), ldns_resolver_tsig_keyname(), and LDNS_STATUS_OK.

◆ ldns_update_zocount()

uint16_t ldns_update_zocount ( const ldns_pkt p)

Get the zo count.

Parameters
[in]pthe packet
Returns
the zo count

Definition at line 280 of file update.c.

References ldns_pkt_qdcount().

◆ ldns_update_prcount()

uint16_t ldns_update_prcount ( const ldns_pkt p)

Get the zo count.

Parameters
[in]pthe packet
Returns
the pr count

Definition at line 286 of file update.c.

References ldns_pkt_ancount().

◆ ldns_update_upcount()

uint16_t ldns_update_upcount ( const ldns_pkt p)

Get the zo count.

Parameters
[in]pthe packet
Returns
the up count

Definition at line 292 of file update.c.

References ldns_pkt_nscount().

◆ ldns_update_ad()

uint16_t ldns_update_ad ( const ldns_pkt p)

Get the zo count.

Parameters
[in]pthe packet
Returns
the ad count

Definition at line 298 of file update.c.

References ldns_pkt_arcount().

◆ ldns_update_set_zo()

void ldns_update_set_zo ( ldns_pkt p,
uint16_t  c 
)

Set the zo count.

Parameters
[in]pthe packet
[in]cthe zo count to set

Definition at line 304 of file update.c.

References ldns_pkt_set_qdcount().

◆ ldns_update_set_prcount()

void ldns_update_set_prcount ( ldns_pkt p,
uint16_t  c 
)

Set the pr count.

Parameters
[in]pthe packet
[in]cthe pr count to set

Definition at line 310 of file update.c.

References ldns_pkt_set_ancount().

◆ ldns_update_set_upcount()

void ldns_update_set_upcount ( ldns_pkt p,
uint16_t  c 
)

Set the up count.

Parameters
[in]pthe packet
[in]cthe up count to set

Definition at line 316 of file update.c.

References ldns_pkt_set_nscount().

◆ ldns_update_set_adcount()

void ldns_update_set_adcount ( ldns_pkt p,
uint16_t  c 
)

Set the ad count.

Parameters
[in]pthe packet
[in]cthe ad count to set

Definition at line 322 of file update.c.

References ldns_pkt_set_arcount().

◆ ldns_update_soa_mname()

◆ ldns_update_soa_zone_mname()