Go to the documentation of this file.
40 #include <ldns/ldns.h>
42 static const char* edns_str =
"edns";
71 data->
ok[1] = (LDNS_RR_TYPE_OPT & 0xff00) >> 8;
72 data->
ok[2] = LDNS_RR_TYPE_OPT & 0x00ff;
74 data->
ok[3] = (max_length & 0xff00) >> 8;
75 data->
ok[4] = max_length & 0x00ff;
77 data->
error[1] = (LDNS_RR_TYPE_OPT & 0xff00) >> 8;
78 data->
error[2] = LDNS_RR_TYPE_OPT & 0x00ff;
79 data->
error[3] = (max_length & 0xff00) >> 8;
80 data->
error[4] = max_length & 0x00ff;
117 if (!err || !buffer) {
118 ods_log_debug(
"[%s] parse: no edns rr or no packet buffer available",
125 ods_log_debug(
"[%s] parse: edns rr too small", edns_str);
130 if (opt_owner != 0 || opt_type != LDNS_RR_TYPE_OPT) {
132 ods_log_debug(
"[%s] parse: not OPT: owner=%02x, type=%02x", edns_str,
133 opt_owner, opt_type);
144 if (opt_version != 0) {
146 ods_log_debug(
"[%s] parse: wrong edns version", edns_str);
edns_rr_type * edns_rr_create()
unsigned char ok[OPT_LEN]
size_t buffer_position(buffer_type *buffer)
void edns_init(edns_data_type *data, uint16_t max_length)
size_t edns_rr_reserved_space(edns_rr_type *err)
int edns_rr_parse(edns_rr_type *err, buffer_type *buffer)
void buffer_set_position(buffer_type *buffer, size_t pos)
void edns_rr_cleanup(edns_rr_type *err)
void buffer_skip(buffer_type *buffer, ssize_t count)
unsigned char error[OPT_LEN]
void edns_rr_reset(edns_rr_type *err)
uint16_t buffer_read_u16(buffer_type *buffer)
uint8_t buffer_read_u8(buffer_type *buffer)
int buffer_available(buffer_type *buffer, size_t count)