Commit 9f59520a authored by Vladimír Čunát's avatar Vladimír Čunát

lua: rrsig_type_covered

parent 802f6b44
......@@ -292,6 +292,7 @@ uint16_t kr_pkt_qclass(const knot_pkt_t *);
uint16_t kr_pkt_qtype(const knot_pkt_t *);
uint32_t kr_rrsig_sig_inception(const knot_rdata_t *);
uint32_t kr_rrsig_sig_expiration(const knot_rdata_t *);
uint16_t kr_rrsig_type_covered(const knot_rdata_t *);
const char *kr_inaddr(const struct sockaddr *);
int kr_inaddr_family(const struct sockaddr *);
int kr_inaddr_len(const struct sockaddr *);
......
......@@ -148,6 +148,7 @@ EOF
kr_pkt_qtype
kr_rrsig_sig_inception
kr_rrsig_sig_expiration
kr_rrsig_type_covered
kr_inaddr
kr_inaddr_family
kr_inaddr_len
......
......@@ -436,10 +436,11 @@ ffi.metatype( knot_rrset_t, {
return true
end,
-- Return type covered by this RRSIG
type_covered = function(rr, pos)
assert(ffi.istype(knot_rrset_t, rr))
type_covered = function(rr, i)
i = i or 0
assert(ffi.istype(knot_rrset_t, rr) and i >= 0 and i < rr:rdcount())
if rr.type ~= const_type.RRSIG then return end
return tonumber(knot.knot_rrsig_type_covered(rr.rrs, pos or 0))
return tonumber(C.kr_rrsig_type_covered(knot.knot_rdataset_at(rr.rrs, i)))
end,
-- Check whether a RRSIG is covering current RR set
is_covered_by = function(rr, rrsig)
......
......@@ -1033,3 +1033,7 @@ uint32_t kr_rrsig_sig_expiration(const knot_rdata_t *rdata)
{
return knot_rrsig_sig_expiration(rdata);
}
uint16_t kr_rrsig_type_covered(const knot_rdata_t *rdata)
{
return knot_rrsig_type_covered(rdata);
}
......@@ -444,3 +444,4 @@ KR_EXPORT uint16_t kr_pkt_qclass(const knot_pkt_t *pkt);
KR_EXPORT uint16_t kr_pkt_qtype(const knot_pkt_t *pkt);
KR_EXPORT uint32_t kr_rrsig_sig_inception(const knot_rdata_t *rdata);
KR_EXPORT uint32_t kr_rrsig_sig_expiration(const knot_rdata_t *rdata);
KR_EXPORT uint16_t kr_rrsig_type_covered(const knot_rdata_t *rdata);
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