32 return ldns_buffer_status(buffer);
41 return ldns_buffer_status(buffer);
54 ldns_buffer_write_u8(buffer,
61 ldns_buffer_write(buffer,
66 return ldns_buffer_status(buffer);
77 for(i = 0; i < rr_count; i++) {
81 return ldns_buffer_status(buffer);
92 bool pre_rfc3597 =
false;
137 rdl_pos = ldns_buffer_position(buffer);
138 ldns_buffer_write_u16(buffer, 0);
150 ldns_buffer_write_u16_at(buffer, rdl_pos,
151 ldns_buffer_position(buffer)
155 return ldns_buffer_status(buffer);
162 uint16_t rdl_pos = 0;
177 rdl_pos = ldns_buffer_position(buffer);
178 ldns_buffer_write_u16(buffer, 0);
185 ldns_buffer_write_u16_at(buffer, rdl_pos,
186 ldns_buffer_position(buffer)
190 return ldns_buffer_status(buffer);
210 return ldns_buffer_status(buffer);
221 return ldns_buffer_status(buffer);
234 ldns_buffer_write_u16(buffer,
ldns_pkt_id(packet));
240 ldns_buffer_write_u8(buffer, flags);
247 ldns_buffer_write_u8(buffer, flags);
260 ldns_buffer_write_u16(buffer, arcount);
263 return ldns_buffer_status(buffer);
276 (void) ldns_hdr2buffer_wire(buffer, packet);
349 *result_size = ldns_buffer_position(buffer);
367 *result_size = ldns_buffer_position(buffer);
385 *result_size = ldns_buffer_position(buffer);
ldns_rdf * ldns_rr_rdf(const ldns_rr *rr, size_t nr)
returns the rdata field member counter.
implementation of buffers to ease operations
mailbox or mail list information
uint16_t ldns_pkt_arcount(const ldns_pkt *packet)
Return the packet's ar count.
ldns_rdf * _edns_data
Arbitrary EDNS rdata.
void * ldns_buffer_export(ldns_buffer *buffer)
Makes the buffer fixed and returns a pointer to the data.
void ldns_rr_set_type(ldns_rr *rr, ldns_rr_type rr_type)
sets the type in the rr.
the canonical name for an alias
ldns_rr_list * ldns_pkt_question(const ldns_pkt *packet)
Return the packet's question section.
ldns_status ldns_pkt2wire(uint8_t **dest, const ldns_pkt *packet, size_t *result_size)
Allocates an array of uint8_t at dest, and puts the wireformat of the given packet in that array...
List or Set of Resource Records.
bool ldns_pkt_tc(const ldns_pkt *packet)
Read the packet's tc bit.
ldns_pkt_rcode ldns_pkt_get_rcode(const ldns_pkt *packet)
Return the packet's respons code.
uint16_t ldns_pkt_qdcount(const ldns_pkt *packet)
Return the packet's qd count.
uint8_t ldns_pkt_edns_extended_rcode(const ldns_pkt *packet)
return the packet's edns extended rcode
ldns_status ldns_rr_list2buffer_wire(ldns_buffer *buffer, const ldns_rr_list *rr_list)
Copies the rr_list data to the buffer in wire format.
uint16_t ldns_pkt_id(const ldns_pkt *packet)
Read the packet id.
bool ldns_pkt_edns(const ldns_pkt *pkt)
returns true if this packet needs and EDNS rr to be sent.
size_t ldns_rdf_size(const ldns_rdf *rd)
returns the size of the rdf.
ldns_pkt_opcode ldns_pkt_get_opcode(const ldns_pkt *packet)
Read the packet's code.
bool ldns_pkt_aa(const ldns_pkt *packet)
Read the packet's aa bit.
void ldns_buffer_free(ldns_buffer *buffer)
frees the buffer.
size_t ldns_rr_rd_count(const ldns_rr *rr)
returns the rd_count of an rr structure.
#define LDNS_MAX_PACKETLEN
void ldns_rr_free(ldns_rr *rr)
frees an RR structure
ldns_status ldns_rdf2buffer_wire(ldns_buffer *buffer, const ldns_rdf *rdf)
Copies the rdata data to the buffer in wire format.
a mailbox domain name (EXPERIMENTAL)
Including this file will include all ldns files, and define some lookup tables.
marks the start of a zone of authority
uint16_t ldns_pkt_nscount(const ldns_pkt *packet)
Return the packet's ns count.
uint8_t * ldns_rdf_data(const ldns_rdf *rd)
returns the data of the rdf.
ldns_rr * ldns_rr_list_rr(const ldns_rr_list *rr_list, size_t nr)
returns a specific rr of an rrlist.
void ldns_rr_set_class(ldns_rr *rr, ldns_rr_class rr_class)
sets the class in the rr.
ldns_status ldns_pkt2buffer_wire(ldns_buffer *buffer, const ldns_pkt *packet)
Copies the packet data to the buffer in wire format.
bogus section, if not interested
uint16_t ldns_pkt_ancount(const ldns_pkt *packet)
Return the packet's an count.
bool ldns_pkt_cd(const ldns_pkt *packet)
Read the packet's cd bit.
bool ldns_pkt_ra(const ldns_pkt *packet)
Read the packet's ra bit.
ldns_rdf * ldns_rr_pop_rdf(ldns_rr *rr)
removes a rd_field member, it will be popped from the last position.
ldns_status ldns_rr2buffer_wire_canonical(ldns_buffer *buffer, const ldns_rr *rr, int section)
Copies the rr data to the buffer in wire format, in canonical format according to RFC3597 (every dnam...
ldns_status ldns_dname2buffer_wire(ldns_buffer *buffer, const ldns_rdf *name)
Copies the dname data to the buffer in wire format.
ldns_rdf * ldns_rdf_new_frm_str(ldns_rdf_type type, const char *str)
creates a new rdf from a string.
ldns_status ldns_rr_rdata2buffer_wire(ldns_buffer *buffer, const ldns_rr *rr)
Converts an rr's rdata to wireformat, while excluding the ownername and all the stuff before the rdat...
ldns_status ldns_rr2buffer_wire(ldns_buffer *buffer, const ldns_rr *rr, int section)
Copies the rr data to the buffer in wire format.
bool ldns_pkt_rd(const ldns_pkt *packet)
Read the packet's rd bit.
uint8_t ldns_pkt_edns_version(const ldns_pkt *packet)
return the packet's edns version
ldns_status ldns_rdf2wire(uint8_t **dest, const ldns_rdf *rdf, size_t *result_size)
Allocates an array of uint8_t at dest, and puts the wireformat of the given rdf in that array...
ldns_rdf_type ldns_rdf_get_type(const ldns_rdf *rd)
returns the type of the rdf.
void ldns_rr_set_owner(ldns_rr *rr, ldns_rdf *owner)
sets the owner in the rr structure.
ldns_rr_type ldns_rr_get_type(const ldns_rr *rr)
returns the type of the rr.
a mail group member (EXPERIMENTAL)
void ldns_rr_set_ttl(ldns_rr *rr, uint32_t ttl)
sets the ttl in the rr structure.
enum ldns_enum_status ldns_status
ldns_status ldns_rr2wire(uint8_t **dest, const ldns_rr *rr, int section, size_t *result_size)
Allocates an array of uint8_t at dest, and puts the wireformat of the given rr in that array...
a mail destination (Obsolete - use MX)
ldns_buffer * ldns_buffer_new(size_t capacity)
creates a new buffer with the specified capacity.
bool ldns_buffer_reserve(ldns_buffer *buffer, size_t amount)
ensures BUFFER can contain at least AMOUNT more bytes.
uint16_t ldns_pkt_edns_udp_size(const ldns_pkt *packet)
return the packet's edns udp size
bool ldns_rr_push_rdf(ldns_rr *rr, const ldns_rdf *f)
sets rd_field member, it will be placed in the next available spot.
a mail rename domain name (EXPERIMENTAL)
bool ldns_pkt_qr(const ldns_pkt *packet)
Read the packet's qr bit.
Resource record data field.
ldns_rr * ldns_pkt_tsig(const ldns_pkt *pkt)
Return the packet's tsig pseudo rr's.
ldns_rdf * ldns_rr_owner(const ldns_rr *rr)
returns the owner name of an rr structure.
ldns_rr * ldns_rr_new(void)
creates a new rr structure.
size_t ldns_rr_list_rr_count(const ldns_rr_list *rr_list)
returns the number of rr's in an rr_list.
bool ldns_pkt_ad(const ldns_pkt *packet)
Read the packet's ad bit.
ldns_rr_list * ldns_pkt_authority(const ldns_pkt *packet)
Return the packet's authority section.
an authoritative name server
ldns_status ldns_rrsig2buffer_wire(ldns_buffer *buffer, const ldns_rr *rr)
Converts a rrsig to wireformat BUT EXCLUDE the rrsig rdata This is needed in DNSSEC verification...
uint32_t ldns_rr_ttl(const ldns_rr *rr)
returns the ttl of an rr structure.
ldns_rr_class ldns_rr_get_class(const ldns_rr *rr)
returns the class of the rr.
ldns_status ldns_rdf2buffer_wire_canonical(ldns_buffer *buffer, const ldns_rdf *rdf)
Copies the rdata data to the buffer in wire format If the rdata is a dname, the letters will be lower...
ldns_rr_list * ldns_pkt_additional(const ldns_pkt *packet)
Return the packet's additional section.
ldns_rr_list * ldns_pkt_answer(const ldns_pkt *packet)
Return the packet's answer section.
uint16_t ldns_pkt_edns_z(const ldns_pkt *packet)
return the packet's edns z value
#define LDNS_DNAME_NORMALIZE
a mail forwarder (Obsolete - use MX)