Lines Matching refs:edns
60 #include "util/edns.h"
70 #include "edns-subnet/subnetmod.h"
71 #include "edns-subnet/edns-subnet.h"
426 struct edns_data* edns, struct comm_reply* rep, uint16_t qid,
430 int unique = unique_mesh_state(edns->opt_list_in, mesh->env);
442 edns->cookie_valid, mesh->env->cfg)) {
482 LDNS_RCODE_SERVFAIL, edns, rep, mesh->env->scratch, mesh->env->now_tv))
483 edns->opt_list_inplace_cb_out = NULL;
485 qinfo, qid, qflags, edns);
494 /* copy the edns options we got from the front */
495 if(edns->opt_list_in) {
496 s->s.edns_opts_front_in = edns_opt_copy_region(edns->opt_list_in,
501 NULL, LDNS_RCODE_SERVFAIL, edns, rep, mesh->env->scratch, mesh->env->now_tv))
502 edns->opt_list_inplace_cb_out = NULL;
504 qinfo, qid, qflags, edns);
527 if(!mesh_state_add_reply(s, edns, rep, qid, qflags, qinfo)) {
586 NULL, LDNS_RCODE_SERVFAIL, edns, rep, mesh->env->scratch, mesh->env->now_tv))
587 edns->opt_list_inplace_cb_out = NULL;
589 qinfo, qid, qflags, edns);
600 uint16_t qflags, struct edns_data* edns, sldns_buffer* buf,
604 int unique = unique_mesh_state(edns->opt_list_in, mesh->env);
631 if(edns->opt_list_in) {
632 s->s.edns_opts_front_in = edns_opt_copy_region(edns->opt_list_in,
655 if(!mesh_state_add_cb(s, edns, buf, cb, cb_arg, qid, qflags)) {
1032 /* init edns option lists */
1329 rep, rcode, &r->edns, NULL, m->s.region, start_time))
1330 r->edns.opt_list_inplace_cb_out = NULL;
1333 &r->edns, NULL, m->s.region, start_time))
1334 r->edns.opt_list_inplace_cb_out = NULL;
1340 size_t udp_size = r->edns.udp_size;
1342 r->edns.edns_version = EDNS_ADVERTISED_VERSION;
1343 r->edns.udp_size = EDNS_ADVERTISED_SIZE;
1344 r->edns.ext_rcode = 0;
1345 r->edns.bits &= EDNS_DO;
1346 if(m->s.env->cfg->disable_edns_do && (r->edns.bits&EDNS_DO))
1347 r->edns.edns_present = 0;
1350 LDNS_RCODE_NOERROR, &r->edns, NULL, m->s.region, start_time) ||
1353 m->s.env->scratch, udp_size, &r->edns,
1354 (int)(r->edns.bits & EDNS_DO), secure))
1409 edns_opt_list_append_ede(&r->edns.opt_list_out,
1478 prev->edns.edns_present == r->edns.edns_present &&
1479 prev->edns.bits == r->edns.bits &&
1480 prev->edns.udp_size == r->edns.udp_size &&
1481 edns_opt_list_compare(prev->edns.opt_list_out, r->edns.opt_list_out) == 0 &&
1482 edns_opt_list_compare(prev->edns.opt_list_inplace_cb_out, r->edns.opt_list_inplace_cb_out) == 0
1498 rep, rcode, &r->edns, &r->query_reply, m->s.region, &r->start_time))
1499 r->edns.opt_list_inplace_cb_out = NULL;
1502 &r->edns, &r->query_reply, m->s.region, &r->start_time))
1503 r->edns.opt_list_inplace_cb_out = NULL;
1513 r->qflags, &r->edns);
1518 size_t udp_size = r->edns.udp_size;
1519 r->edns.edns_version = EDNS_ADVERTISED_VERSION;
1520 r->edns.udp_size = EDNS_ADVERTISED_SIZE;
1521 r->edns.ext_rcode = 0;
1522 r->edns.bits &= EDNS_DO;
1523 if(m->s.env->cfg->disable_edns_do && (r->edns.bits&EDNS_DO))
1524 r->edns.edns_present = 0;
1538 LDNS_RCODE_NOERROR, &r->edns, &r->query_reply, m->s.region, &r->start_time) ||
1541 udp_size, &r->edns, (int)(r->edns.bits & EDNS_DO),
1545 rep, LDNS_RCODE_SERVFAIL, &r->edns, &r->query_reply, m->s.region, &r->start_time))
1546 r->edns.opt_list_inplace_cb_out = NULL;
1550 &m->s.qinfo, r->qid, r->qflags, &r->edns);
1911 int mesh_state_add_cb(struct mesh_state* s, struct edns_data* edns,
1923 r->edns = *edns;
1924 if(edns->opt_list_in && !(r->edns.opt_list_in =
1925 edns_opt_copy_region(edns->opt_list_in, s->s.region)))
1927 if(edns->opt_list_out && !(r->edns.opt_list_out =
1928 edns_opt_copy_region(edns->opt_list_out, s->s.region)))
1930 if(edns->opt_list_inplace_cb_out && !(r->edns.opt_list_inplace_cb_out =
1931 edns_opt_copy_region(edns->opt_list_inplace_cb_out, s->s.region)))
1941 int mesh_state_add_reply(struct mesh_state* s, struct edns_data* edns,
1950 r->edns = *edns;
1951 if(edns->opt_list_in && !(r->edns.opt_list_in =
1952 edns_opt_copy_region(edns->opt_list_in, s->s.region)))
1954 if(edns->opt_list_out && !(r->edns.opt_list_out =
1955 edns_opt_copy_region(edns->opt_list_out, s->s.region)))
1957 if(edns->opt_list_inplace_cb_out && !(r->edns.opt_list_inplace_cb_out =
1958 edns_opt_copy_region(edns->opt_list_inplace_cb_out, s->s.region)))
2530 if(r->edns.edns_present &&
2534 edns_opt_list_append_ede(&r->edns.opt_list_out,