ldns documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

Functions
update.c File Reference

Go to the source code of this file.

## Functions
ldns_pkt * | ldns_update_pkt_new (ldns_rdf *zone_rdf, ldns_rr_class c, ldns_rr_list *pr_rrlist, ldns_rr_list *up_rrlist, 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, ldns_resolver *r)
| add tsig credentials to a packet from a resolver 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)
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 v)
| Set the zo count. More...
void | ldns_update_set_prcount (ldns_pkt *p, uint16_t v)
| Set the pr count. More...
void | ldns_update_set_upcount (ldns_pkt *p, uint16_t v)
| Set the up count. More...
void | ldns_update_set_adcount (ldns_pkt *p, uint16_t v)
| Set the ad count. More...

## Function Documentation

ldns_pkt* ldns_update_pkt_new | ( | ldns_rdf * | zone_rdf,
|  | ldns_rr_class | clas,
|  | ldns_rr_list * | pr_rrlist,
|  | ldns_rr_list * | up_rrlist,
|  | ldns_rr_list * | ad_rrlist
| ) |  |

create an update packet from zone name, class and the rr lists

Parameters

  [in] | zone_rdf | name of the zone
  [in] | clas | zone class
  [in] | pr_rrlist | list of Prerequisite Section RRs
  [in] | up_rrlist | list of Updates Section RRs
  [in] | ad_rrlist | list 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_status ldns_update_pkt_tsig_add | ( | ldns_pkt * | p,
|  | ldns_resolver * | r
| ) |  |

add tsig credentials to a packet from a resolver

Parameters

  [in] | p | packet to copy to
  [in] | r | resolver to copy from

Returns
  status wether successfull 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_status ldns_update_soa_mname | ( | ldns_rdf * | zone,
|  | ldns_resolver * | r,
|  | ldns_rr_class | c,
|  | ldns_rdf ** | mname
| ) |  |

Definition at line 90 of file update.c.

References ldns_pkt_answer(), ldns_pkt_free(), ldns_pkt_query_new(), ldns_pkt_set_random_id(), LDNS_RD, ldns_rdf_clone(), ldns_resolver_send_pkt(), ldns_rr_get_type(), ldns_rr_list_pop_rr(), ldns_rr_rdf(), LDNS_RR_TYPE_SOA, LDNS_STATUS_ERR, and LDNS_STATUS_OK.

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
| ) |  |

Definition at line 130 of file update.c.

References ldns_dname_new_frm_str(), ldns_pkt_ancount(), ldns_pkt_answer(), ldns_pkt_authority(), ldns_pkt_free(), ldns_pkt_query_new(), ldns_pkt_set_random_id(), LDNS_RD, ldns_rdf_clone(), ldns_rdf_compare(), ldns_resolver_nameserver_count(), ldns_resolver_nameservers(), ldns_resolver_push_nameserver(), ldns_resolver_send_pkt(), ldns_resolver_set_random(), ldns_rr_get_type(), ldns_rr_list_pop_rr(), ldns_rr_owner(), ldns_rr_rdf(), LDNS_RR_TYPE_A, LDNS_RR_TYPE_SOA, LDNS_STATUS_ERR, and LDNS_STATUS_OK.

uint16_t ldns_update_zocount | ( | const ldns_pkt * | p | ) |

Get the zo count.

Parameters

  [in] | p | the packet

Returns
  the zo count

Definition at line 273 of file update.c.

References ldns_pkt_qdcount().

uint16_t ldns_update_prcount | ( | const ldns_pkt * | p | ) |

Get the zo count.

Parameters

  [in] | p | the packet

Returns
  the pr count

Definition at line 279 of file update.c.

References ldns_pkt_ancount().

uint16_t ldns_update_upcount | ( | const ldns_pkt * | p | ) |

Get the zo count.

Parameters

  [in] | p | the packet

Returns
  the up count

Definition at line 285 of file update.c.

References ldns_pkt_nscount().

uint16_t ldns_update_ad | ( | const ldns_pkt * | p | ) |

Get the zo count.

Parameters

  [in] | p | the packet

Returns
  the ad count

Definition at line 291 of file update.c.

References ldns_pkt_arcount().

void ldns_update_set_zo | ( | ldns_pkt * | p,
|  | uint16_t | c
| ) |  |

Set the zo count.

Parameters

  [in] | p | the packet
  [in] | c | the zo count to set

Definition at line 297 of file update.c.

References ldns_pkt_set_qdcount().

void ldns_update_set_prcount | ( | ldns_pkt * | p,
|  | uint16_t | c
| ) |  |

Set the pr count.

Parameters

  [in] | p | the packet
  [in] | c | the pr count to set

Definition at line 303 of file update.c.

References ldns_pkt_set_ancount().

void ldns_update_set_upcount | ( | ldns_pkt * | p,
|  | uint16_t | c
| ) |  |

Set the up count.

Parameters

  [in] | p | the packet
  [in] | c | the up count to set

Definition at line 309 of file update.c.

References ldns_pkt_set_nscount().

void ldns_update_set_adcount | ( | ldns_pkt * | p,
|  | uint16_t | c
| ) |  |

Set the ad count.

Parameters

  [in] | p | the packet
  [in] | c | the ad count to set

Definition at line 315 of file update.c.

References ldns_pkt_set_arcount().