40 #include <ldns/ldns.h>
42 static const char* edns_str =
"edns";
58 ods_log_error(
"[%s] unable to create edns rr: allocator_alloc() "
80 data->
ok[1] = (LDNS_RR_TYPE_OPT & 0xff00) >> 8;
81 data->
ok[2] = LDNS_RR_TYPE_OPT & 0x00ff;
83 data->
ok[3] = (max_length & 0xff00) >> 8;
84 data->
ok[4] = max_length & 0x00ff;
86 data->
error[1] = (LDNS_RR_TYPE_OPT & 0xff00) >> 8;
87 data->
error[2] = LDNS_RR_TYPE_OPT & 0x00ff;
88 data->
error[3] = (max_length & 0xff00) >> 8;
89 data->
error[4] = max_length & 0x00ff;
127 if (!err || !buffer) {
128 ods_log_debug(
"[%s] parse: no edns rr or no packet buffer available",
140 if (opt_owner != 0 || opt_type != LDNS_RR_TYPE_OPT) {
142 ods_log_debug(
"[%s] parse: not OPT: owner=%02x, type=%02x", edns_str,
143 opt_owner, opt_type);
153 if (opt_version != 0) {
int edns_rr_parse(edns_rr_type *err, buffer_type *buffer)
void ods_log_debug(const char *format,...)
void * allocator_alloc(allocator_type *allocator, size_t size)
void edns_rr_reset(edns_rr_type *err)
uint16_t buffer_read_u16(buffer_type *buffer)
uint8_t buffer_read_u8(buffer_type *buffer)
void ods_log_error(const char *format,...)
edns_rr_type * edns_rr_create(allocator_type *allocator)
allocator_type * allocator
void buffer_set_position(buffer_type *buffer, size_t pos)
int buffer_available(buffer_type *buffer, size_t count)
void edns_init(edns_data_type *data, uint16_t max_length)
size_t edns_rr_reserved_space(edns_rr_type *err)
size_t buffer_position(buffer_type *buffer)
unsigned char error[OPT_LEN]
unsigned char ok[OPT_LEN]