42 #include <ldns/ldns.h>
44 static const char* edns_str =
"edns";
60 ods_log_error(
"[%s] unable to create edns rr: allocator_alloc() "
82 data->
ok[1] = (LDNS_RR_TYPE_OPT & 0xff00) >> 8;
83 data->
ok[2] = LDNS_RR_TYPE_OPT & 0x00ff;
85 data->
ok[3] = (max_length & 0xff00) >> 8;
86 data->
ok[4] = max_length & 0x00ff;
88 data->
error[1] = (LDNS_RR_TYPE_OPT & 0xff00) >> 8;
89 data->
error[2] = LDNS_RR_TYPE_OPT & 0x00ff;
90 data->
error[3] = (max_length & 0xff00) >> 8;
91 data->
error[4] = max_length & 0x00ff;
129 if (!err || !buffer) {
130 ods_log_debug(
"[%s] parse: no edns rr or no packet buffer available",
142 if (opt_owner != 0 || opt_type != LDNS_RR_TYPE_OPT) {
144 ods_log_debug(
"[%s] parse: not OPT: owner=%02x, type=%02x", edns_str,
145 opt_owner, opt_type);
155 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]