diff options
Diffstat (limited to 'daemon/lua')
-rw-r--r-- | daemon/lua/kres-gen-29.lua | 1 | ||||
-rw-r--r-- | daemon/lua/kres-gen-31.lua | 1 | ||||
-rwxr-xr-x | daemon/lua/kres-gen.sh | 1 | ||||
-rw-r--r-- | daemon/lua/kres.lua | 5 |
4 files changed, 8 insertions, 0 deletions
diff --git a/daemon/lua/kres-gen-29.lua b/daemon/lua/kres-gen-29.lua index 32795f2b..ded49465 100644 --- a/daemon/lua/kres-gen-29.lua +++ b/daemon/lua/kres-gen-29.lua @@ -378,6 +378,7 @@ int knot_pkt_put_rotate(knot_pkt_t *, uint16_t, const knot_rrset_t *, uint16_t, knot_pkt_t *knot_pkt_new(void *, uint16_t, knot_mm_t *); void knot_pkt_free(knot_pkt_t *); int knot_pkt_parse(knot_pkt_t *, unsigned int); +knot_rrset_t *kr_request_ensure_edns(struct kr_request *); knot_pkt_t *kr_request_ensure_answer(struct kr_request *); struct kr_rplan *kr_resolve_plan(struct kr_request *); knot_mm_t *kr_resolve_pool(struct kr_request *); diff --git a/daemon/lua/kres-gen-31.lua b/daemon/lua/kres-gen-31.lua index f540ddf8..dc733472 100644 --- a/daemon/lua/kres-gen-31.lua +++ b/daemon/lua/kres-gen-31.lua @@ -378,6 +378,7 @@ int knot_pkt_put_rotate(knot_pkt_t *, uint16_t, const knot_rrset_t *, uint16_t, knot_pkt_t *knot_pkt_new(void *, uint16_t, knot_mm_t *); void knot_pkt_free(knot_pkt_t *); int knot_pkt_parse(knot_pkt_t *, unsigned int); +knot_rrset_t *kr_request_ensure_edns(struct kr_request *); knot_pkt_t *kr_request_ensure_answer(struct kr_request *); struct kr_rplan *kr_resolve_plan(struct kr_request *); knot_mm_t *kr_resolve_pool(struct kr_request *); diff --git a/daemon/lua/kres-gen.sh b/daemon/lua/kres-gen.sh index eded99ea..b4244505 100755 --- a/daemon/lua/kres-gen.sh +++ b/daemon/lua/kres-gen.sh @@ -201,6 +201,7 @@ EOF ## libkres API ${CDEFS} ${LIBKRES} functions <<-EOF # Resolution request + kr_request_ensure_edns kr_request_ensure_answer kr_resolve_plan kr_resolve_pool diff --git a/daemon/lua/kres.lua b/daemon/lua/kres.lua index ce355639..14042166 100644 --- a/daemon/lua/kres.lua +++ b/daemon/lua/kres.lua @@ -879,6 +879,11 @@ ffi.metatype( kr_request_t, { req.vars_ref = ref return var end, + -- Ensure that answer has EDNS if needed; can't fail. + ensure_edns = function (req) + assert(ffi.istype(kr_request_t, req)) + return C.kr_request_ensure_edns(req) + end, -- Ensure that answer exists and return it; can't fail. ensure_answer = function (req) assert(ffi.istype(kr_request_t, req)) |