Go to the source code of this file.
typedef struct ldns_struct_hdr ldns_hdr |
typedef struct ldns_struct_pkt ldns_pkt |
typedef enum ldns_enum_pkt_opcode ldns_pkt_opcode |
typedef enum ldns_enum_pkt_section ldns_pkt_section |
typedef enum ldns_enum_pkt_type ldns_pkt_type |
enum ldns_enum_pkt_opcode |
enum ldns_enum_pkt_type |
ldns_rr_list* ldns_pkt_additional | ( | const ldns_pkt * | p | ) |
uint16_t ldns_pkt_ancount | ( | const ldns_pkt * | p | ) |
ldns_rr_list* ldns_pkt_answer | ( | const ldns_pkt * | p | ) |
uint16_t ldns_pkt_arcount | ( | const ldns_pkt * | p | ) |
ldns_rr_list* ldns_pkt_authority | ( | const ldns_pkt * | p | ) |
clones the given packet, creating a fully allocated copy
[in] | pkt | the packet to clone |
returns true if this packet needs and EDNS rr to be sent.
At the moment the only reason is an expected packet size larger than 512 bytes, but for instance dnssec would be a good reason too.
[in] | packet | the packet to check |
uint8_t ldns_pkt_edns_extended_rcode | ( | const ldns_pkt * | packet | ) |
uint16_t ldns_pkt_edns_udp_size | ( | const ldns_pkt * | packet | ) |
uint8_t ldns_pkt_edns_version | ( | const ldns_pkt * | packet | ) |
uint16_t ldns_pkt_edns_z | ( | const ldns_pkt * | packet | ) |
void ldns_pkt_free | ( | ldns_pkt * | packet | ) |
frees the packet structure and all data that it contains.
[in] | packet | The packet structure to free |
ldns_pkt_opcode ldns_pkt_get_opcode | ( | const ldns_pkt * | p | ) |
ldns_rr_list* ldns_pkt_get_section_clone | ( | ldns_pkt * | p, | |
ldns_pkt_section | s | |||
) |
return all the rr_list's in the packet.
Clone the lists, instead of returning pointers.
[in] | p | the packet to look in |
[in] | s | what section(s) to return |
uint16_t ldns_pkt_id | ( | const ldns_pkt * | p | ) |
ldns_pkt* ldns_pkt_new | ( | ) |
allocates and initializes a ldns_pkt structure.
uint16_t ldns_pkt_nscount | ( | const ldns_pkt * | p | ) |
uint16_t ldns_pkt_qdcount | ( | const ldns_pkt * | p | ) |
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.
[in] | rr_name | the name to query for |
[in] | rr_type | the type to query for |
[in] | rr_class | the class to query for |
[in] | flags | packet flags |
ldns_pkt* ldns_pkt_query_new_frm_str | ( | const char * | rr_name, | |
ldns_rr_type | rr_type, | |||
ldns_rr_class | rr_class, | |||
uint16_t | flags | |||
) |
creates a query packet for the given name, type, class.
[in] | rr_name | the name to query for (as string) |
[in] | rr_type | the type to query for |
[in] | rr_class | the class to query for |
[in] | flags | packet flags |
uint32_t ldns_pkt_querytime | ( | const ldns_pkt * | p | ) |
ldns_rr_list* ldns_pkt_question | ( | const ldns_pkt * | p | ) |
uint8_t ldns_pkt_rcode | ( | const ldns_pkt * | p | ) |
ldns_pkt_type ldns_pkt_reply_type | ( | ldns_pkt * | p | ) |
looks inside the packet to determine what kind of packet it is, AUTH, NXDOMAIN, REFERRAL, etc.
[in] | p | the packet to examine |
ldns_rr_list* ldns_pkt_rr_list_by_name | ( | ldns_pkt * | p, | |
ldns_rdf * | r, | |||
ldns_pkt_section | s | |||
) |
ldns_rr_list* ldns_pkt_rr_list_by_name_and_type | ( | ldns_pkt * | packet, | |
ldns_rdf * | ownername, | |||
ldns_rr_type | type, | |||
ldns_pkt_section | sec | |||
) |
ldns_rr_list* ldns_pkt_rr_list_by_type | ( | ldns_pkt * | p, | |
ldns_rr_type | t, | |||
ldns_pkt_section | s | |||
) |
void ldns_pkt_set_ancount | ( | ldns_pkt * | p, | |
uint16_t | c | |||
) |
void ldns_pkt_set_arcount | ( | ldns_pkt * | p, | |
uint16_t | c | |||
) |
void ldns_pkt_set_edns_extended_rcode | ( | ldns_pkt * | packet, | |
uint8_t | c | |||
) |
void ldns_pkt_set_edns_udp_size | ( | ldns_pkt * | packet, | |
uint16_t | s | |||
) |
void ldns_pkt_set_edns_version | ( | ldns_pkt * | packet, | |
uint8_t | v | |||
) |
void ldns_pkt_set_edns_z | ( | ldns_pkt * | packet, | |
uint16_t | z | |||
) |
sets the flags in a packet.
[in] | pkt | the packet to operate on |
[in] | flags | ORed values: LDNS_QR| LDNS_AR for instance |
void ldns_pkt_set_id | ( | ldns_pkt * | p, | |
uint16_t | id | |||
) |
void ldns_pkt_set_nscount | ( | ldns_pkt * | p, | |
uint16_t | c | |||
) |
void ldns_pkt_set_opcode | ( | ldns_pkt * | p, | |
ldns_pkt_opcode | c | |||
) |
void ldns_pkt_set_qdcount | ( | ldns_pkt * | p, | |
uint16_t | c | |||
) |
void ldns_pkt_set_querytime | ( | ldns_pkt * | p, | |
uint32_t | t | |||
) |
void ldns_pkt_set_random_id | ( | ldns_pkt * | p | ) |
void ldns_pkt_set_rcode | ( | ldns_pkt * | p, | |
uint8_t | c | |||
) |
void ldns_pkt_set_section_count | ( | ldns_pkt * | p, | |
ldns_pkt_section | s, | |||
uint16_t | x | |||
) |
void ldns_pkt_set_size | ( | ldns_pkt * | p, | |
size_t | s | |||
) |
void ldns_pkt_set_when | ( | ldns_pkt * | p, | |
char * | w | |||
) |
size_t ldns_pkt_size | ( | const ldns_pkt * | p | ) |
char* ldns_pkt_when | ( | const ldns_pkt * | p | ) |