]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
updated cache:insert_rr() interface with cache scope changes
authorMarek Vavruša <mvavrusa@cloudflare.com>
Thu, 12 Apr 2018 08:31:46 +0000 (01:31 -0700)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 7 Sep 2018 17:45:21 +0000 (10:45 -0700)
daemon/lua/kres-gen.lua
daemon/lua/kres-gen.sh
daemon/lua/kres.lua

index b2596f605e5346f1311c9a2a5c86445120f9c33f..7827e78090018ab1b1b086107e1a1e1d1a9efa00 100644 (file)
@@ -284,6 +284,7 @@ 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);
 int knot_pkt_reserve(knot_pkt_t *pkt, uint16_t size);
+int knot_pkt_reclaim(knot_pkt_t *pkt, uint16_t size);
 uint8_t knot_edns_get_version(const knot_rrset_t *);
 uint16_t knot_edns_get_payload(const knot_rrset_t *);
 bool knot_edns_has_option(const knot_rrset_t *, uint16_t);
@@ -344,6 +345,7 @@ int kr_cache_closest_apex(struct kr_cache *, const knot_dname_t *, _Bool, knot_d
 int kr_cache_insert_rr(struct kr_cache *, const knot_rrset_t *, const knot_rrset_t *, uint8_t, uint32_t);
 int kr_cache_remove(struct kr_cache *, const knot_dname_t *, uint16_t);
 int kr_cache_remove_subtree(struct kr_cache *, const knot_dname_t *, _Bool, int);
+int kr_cache_insert_rr(struct kr_cache *, const knot_rrset_t *, const knot_rrset_t *, uint8_t, uint32_t, const uint8_t *, int);
 int kr_cache_sync(struct kr_cache *);
 typedef struct {
        uint8_t bitmap[32];
index a03729c761a6c69c6c7d0e98f5f474162582357b..a7161904610b2b5ecda81d3659cc1df37538c28d 100755 (executable)
@@ -125,6 +125,7 @@ printf "\tchar _stub[];\n};\n"
        knot_pkt_free
        knot_pkt_parse
        knot_pkt_reserve
+       knot_pkt_reclaim
 # OPT
        knot_edns_get_version
        knot_edns_get_payload
index 0ee9b5c42687e9518c7170d49c6a780bf529d4ba..fdb0d771599cf669505f6ac9484eb9f81d3f9a65 100644 (file)
@@ -816,7 +816,7 @@ ffi.metatype(ranked_rr_array_t, {
 local kr_cache_t = ffi.typeof('struct kr_cache')
 ffi.metatype( kr_cache_t, {
        __index = {
-               insert = function (self, rr, rrsig, rank, timestamp)
+               insert = function (self, rr, rrsig, rank, timestamp, scope, scope_bits)
                        assert(ffi.istype(kr_cache_t, self))
                        assert(ffi.istype(knot_rrset_t, rr), 'RR must be a rrset type')
                        assert(not rrsig or ffi.istype(knot_rrset_t, rrsig), 'RRSIG must be nil or of the rrset type')
@@ -827,7 +827,7 @@ ffi.metatype( kr_cache_t, {
                                timestamp = tonumber(now.tv_sec)
                        end
                        -- Insert record into cache
-                       local ret = C.kr_cache_insert_rr(self, rr, rrsig, tonumber(rank or 0), timestamp)
+                       local ret = C.kr_cache_insert_rr(self, rr, rrsig, tonumber(rank or 0), timestamp, scope, scope_bits or 0)
                        if ret ~= 0 then return nil, knot_error_t(ret) end
                        return true
                end,