Commit 721ebd9d authored by Jan Včelák's avatar Jan Včelák 🚀

noudp module

parent 3eb56b35
......@@ -276,6 +276,8 @@ libknotd_la_SOURCES = \
knot/events/replan.h \
knot/modules/dnsproxy.c \
knot/modules/dnsproxy.h \
knot/modules/noudp.c \
knot/modules/noudp.h \
knot/modules/online_sign/module.c \
knot/modules/online_sign/module.h \
knot/modules/online_sign/nsec_next.c \
......
......@@ -38,6 +38,7 @@
#include "knot/modules/dnstap.h"
#endif
#include "knot/modules/whoami.h"
#include "knot/modules/noudp.h"
#define HOURS(x) ((x) * 3600)
#define DAYS(x) ((x) * HOURS(24))
......@@ -262,6 +263,7 @@ const yp_item_t conf_scheme[] = {
#endif
{ C_MOD_ONLINE_SIGN, YP_TGRP, YP_VGRP = { scheme_mod_online_sign }, YP_FMULTI },
{ C_MOD_WHOAMI, YP_TGRP, YP_VGRP = { scheme_mod_whoami }, YP_FMULTI },
{ C_MOD_NOUDP, YP_TGRP, YP_VGRP = { scheme_mod_noudp }, YP_FMULTI },
/***********/
{ C_TPL, YP_TGRP, YP_VGRP = { desc_template }, YP_FMULTI, { check_template } },
{ C_ZONE, YP_TGRP, YP_VGRP = { desc_zone }, YP_FMULTI, { check_zone } },
......
/* Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "knot/modules/noudp.h"
#include "knot/nameserver/process_query.h"
const yp_item_t scheme_mod_noudp[] = {
{ C_ID, YP_TSTR, YP_VNONE },
{ NULL }
};
static bool is_udp(struct query_data *qdata)
{
return qdata->param->proc_flags & NS_QUERY_LIMIT_SIZE;
}
int noudp_begin(int state, knot_pkt_t *pkt, struct query_data *qdata, void *ctx)
{
if (is_udp(qdata)) {
knot_wire_set_tc(pkt->wire);
KNOT_STATE_DONE;
}
return state;
}
int noudp_load(struct query_plan *plan, struct query_module *self,
const knot_dname_t *zone)
{
query_plan_step(plan, QPLAN_BEGIN, noudp_begin, NULL);
return KNOT_EOK;
}
int noudp_unload(struct query_module *self)
{
return KNOT_EOK;
}
/* Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "knot/nameserver/query_module.h"
#define C_MOD_NOUDP "\x9""mod-noudp"
extern const yp_item_t scheme_mod_noudp[];
int noudp_load(struct query_plan *plan, struct query_module *self,
const knot_dname_t *zone);
int noudp_unload(struct query_module *self);
......@@ -30,6 +30,7 @@
#include "knot/modules/dnstap.h"
#endif
#include "knot/modules/whoami.h"
#include "knot/modules/noudp.h"
typedef struct static_module {
const yp_name_t *name;
......@@ -50,6 +51,7 @@ static_module_t MODULES[] = {
{ C_MOD_DNSTAP, &dnstap_load, &dnstap_unload, MOD_SCOPE_ANY },
#endif
{ C_MOD_WHOAMI, &whoami_load, &whoami_unload, MOD_SCOPE_ANY },
{ C_MOD_NOUDP, &noudp_load, &noudp_unload, MOD_SCOPE_ANY },
{ NULL }
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment