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_commit(struct kr_cache *);
+uint32_t packet_ttl(const knot_pkt_t *, _Bool);
typedef struct {
uint8_t bitmap[32];
uint8_t length;
int zs_set_input_file(zs_scanner_t *, const char *);
int zs_set_input_string(zs_scanner_t *, const char *, size_t);
const char *zs_strerror(const int);
-uint32_t packet_ttl(const knot_pkt_t *pkt, bool is_negative);
]]
if true then
local an_records = pkt:section(kres.section.ANSWER)
local is_negative = #an_records <= 0
- -- FIXME: does not work for positive answers
return ffi.C.packet_ttl(pkt, is_negative)
end
end
-- Resolve query
- wire = ffi.cast("void *", input)
+ local wire = ffi.cast("void *", input)
local pkt = ffi.C.knot_pkt_new(wire, #input, nil);
if not pkt then
output = 'shit happened in knot_pkt_new'