Commit 5060f153 authored by Daniel Salzman's avatar Daniel Salzman

libknot/rrtype: simplify API (rdataset, index) -> (rdata)

parent 6d2a6fed
......@@ -198,17 +198,4 @@ int knot_rdataset_intersect(const knot_rdataset_t *rrs1, const knot_rdataset_t *
int knot_rdataset_subtract(knot_rdataset_t *from, const knot_rdataset_t *what,
knot_mm_t *mm);
/*! \brief Check helper. */
#define KNOT_RDATASET_CHECK(rrs, pos) \
assert(rrs && rrs->rdata && rrs->count > 0 && pos < rrs->count);
/*! \brief Access helper. */
static inline
uint8_t *knot_rdata_offset(const knot_rdataset_t *rrs, uint16_t pos, uint16_t offset)
{
knot_rdata_t *rr = knot_rdataset_at(rrs, pos);
assert(rr);
return rr->data + offset;
}
/*! @} */
......@@ -22,40 +22,44 @@
#pragma once
#include "libknot/rdataset.h"
#include "libknot/rdata.h"
#include "libknot/wire.h"
#define KNOT_RDATA_DNSKEY_FLAG_KSK 1
#define KNOT_DNSKEY_FLAG_KSK 1
static inline
uint16_t knot_dnskey_flags(const knot_rdataset_t *rrs, size_t pos)
uint16_t knot_dnskey_flags(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_wire_read_u16(knot_rdata_offset(rrs, pos, 0));
assert(rdata);
return knot_wire_read_u16(rdata->data);
}
static inline
uint8_t knot_dnskey_proto(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_dnskey_proto(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 2);
assert(rdata);
return *(rdata->data + 2);
}
static inline
uint8_t knot_dnskey_alg(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_dnskey_alg(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 3);
assert(rdata);
return *(rdata->data + 3);
}
static inline
void knot_dnskey_key(const knot_rdataset_t *rrs, size_t pos, uint8_t **key,
uint16_t *key_size)
uint16_t knot_dnskey_key_len(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
*key = knot_rdata_offset(rrs, pos, 4);
const knot_rdata_t *rr = knot_rdataset_at(rrs, pos);
*key_size = rr->len - 4;
assert(rdata);
return rdata->len - 4;
}
static inline
const uint8_t *knot_dnskey_key(const knot_rdata_t *rdata)
{
assert(rdata);
return rdata->data + 4;
}
/*! @} */
......@@ -22,38 +22,42 @@
#pragma once
#include "libknot/rdataset.h"
#include "libknot/rdata.h"
#include "libknot/wire.h"
static inline
uint16_t knot_ds_key_tag(const knot_rdataset_t *rrs, size_t pos)
uint16_t knot_ds_key_tag(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_wire_read_u16(knot_rdata_offset(rrs, pos, 0));
assert(rdata);
return knot_wire_read_u16(rdata->data);
}
static inline
uint8_t knot_ds_alg(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_ds_alg(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 2);
assert(rdata);
return *(rdata->data + 2);
}
static inline
uint8_t knot_ds_digest_type(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_ds_digest_type(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 3);
assert(rdata);
return *(rdata->data + 3);
}
static inline
void knot_ds_digest(const knot_rdataset_t *rrs, size_t pos,
uint8_t **digest, uint16_t *digest_size)
uint16_t knot_ds_digest_len(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
*digest = knot_rdata_offset(rrs, pos, 4);
const knot_rdata_t *rr = knot_rdataset_at(rrs, pos);
*digest_size = rr->len - 4;
assert(rdata);
return rdata->len - 4;
}
static inline
const uint8_t *knot_ds_digest(const knot_rdata_t *rdata)
{
assert(rdata);
return rdata->data + 4;
}
/*! @} */
......@@ -23,25 +23,27 @@
#pragma once
#include "libknot/dname.h"
#include "libknot/rdataset.h"
#include "libknot/rdata.h"
static inline
const knot_dname_t *knot_nsec_next(const knot_rdataset_t *rrs)
const knot_dname_t *knot_nsec_next(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_rdata_offset(rrs, 0, 0);
assert(rdata);
return rdata->data;
}
static inline
void knot_nsec_bitmap(const knot_rdataset_t *rrs,
uint8_t **bitmap, uint16_t *size)
uint16_t knot_nsec_bitmap_len(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
knot_rdata_t *rr = knot_rdataset_at(rrs, 0);
int next_size = knot_dname_size(knot_nsec_next(rrs));
assert(rdata);
return rdata->len - knot_dname_size(knot_nsec_next(rdata));
}
*bitmap = rr->data + next_size;
*size = rr->len - next_size;
static inline
const uint8_t *knot_nsec_bitmap(const knot_rdata_t *rdata)
{
assert(rdata);
return rdata->data + knot_dname_size(knot_nsec_next(rdata));
}
/*! @} */
......@@ -22,7 +22,7 @@
#pragma once
#include "libknot/rdataset.h"
#include "libknot/rdata.h"
#include "libknot/wire.h"
/*!
......@@ -32,68 +32,66 @@
#define KNOT_NSEC3_FLAG_OPT_OUT 1
static inline
uint8_t knot_nsec3_algorithm(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_nsec3_alg(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 0);
assert(rdata);
return *(rdata->data);
}
static inline
uint8_t knot_nsec3_flags(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_nsec3_flags(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 1);
assert(rdata);
return *(rdata->data + 1);
}
static inline
uint16_t knot_nsec3_iterations(const knot_rdataset_t *rrs, size_t pos)
uint16_t knot_nsec3_iters(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_wire_read_u16(knot_rdata_offset(rrs, pos, 2));
assert(rdata);
return knot_wire_read_u16(rdata->data + 2);
}
static inline
uint8_t knot_nsec3_salt_length(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_nsec3_salt_len(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *(knot_rdata_offset(rrs, pos, 0) + 4);
assert(rdata);
return *(rdata->data + 4);
}
static inline
const uint8_t *knot_nsec3_salt(const knot_rdataset_t *rrs, size_t pos)
const uint8_t *knot_nsec3_salt(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_rdata_offset(rrs, pos, 5);
assert(rdata);
return rdata->data + 5;
}
static inline
void knot_nsec3_next_hashed(const knot_rdataset_t *rrs, size_t pos,
uint8_t **name, uint8_t *name_size)
uint8_t knot_nsec3_next_len(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
uint8_t salt_size = knot_nsec3_salt_length(rrs, pos);
*name_size = *knot_rdata_offset(rrs, pos, 4 + salt_size + 1);
*name = knot_rdata_offset(rrs, pos, 4 + salt_size + 2);
assert(rdata);
return *(rdata->data + 5 + knot_nsec3_salt_len(rdata));
}
static inline
void knot_nsec3_bitmap(const knot_rdataset_t *rrs, size_t pos,
uint8_t **bitmap, uint16_t *size)
const uint8_t *knot_nsec3_next(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
/* Bitmap is last, skip all the items. */
size_t offset = 6; //hash alg., flags, iterations, salt len., hash len.
offset += knot_nsec3_salt_length(rrs, pos); //salt
assert(rdata);
return rdata->data + 6 + knot_nsec3_salt_len(rdata);
}
uint8_t *next_hashed = NULL;
uint8_t next_hashed_size = 0;
knot_nsec3_next_hashed(rrs, pos, &next_hashed, &next_hashed_size);
offset += next_hashed_size; //hash
static inline
uint16_t knot_nsec3_bitmap_len(const knot_rdata_t *rdata)
{
assert(rdata);
return rdata->len - 6 - knot_nsec3_salt_len(rdata) - knot_nsec3_next_len(rdata);
}
*bitmap = knot_rdata_offset(rrs, pos, offset);
const knot_rdata_t *rr = knot_rdataset_at(rrs, pos);
*size = rr->len - offset;
static inline
const uint8_t *knot_nsec3_bitmap(const knot_rdata_t *rdata)
{
assert(rdata);
return rdata->data + 6 + knot_nsec3_salt_len(rdata) + knot_nsec3_next_len(rdata);
}
/*! @} */
......@@ -22,42 +22,42 @@
#pragma once
#include "libknot/rdataset.h"
#include "libknot/rdata.h"
#include "libknot/wire.h"
static inline
uint8_t knot_nsec3param_algorithm(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_nsec3param_alg(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 0);
assert(rdata);
return *(rdata->data);
}
static inline
uint8_t knot_nsec3param_flags(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_nsec3param_flags(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 1);
assert(rdata);
return *(rdata->data + 1);
}
static inline
uint16_t knot_nsec3param_iterations(const knot_rdataset_t *rrs, size_t pos)
uint16_t knot_nsec3param_iters(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_wire_read_u16(knot_rdata_offset(rrs, pos, 2));
assert(rdata);
return knot_wire_read_u16(rdata->data + 2);
}
static inline
uint8_t knot_nsec3param_salt_length(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_nsec3param_salt_len(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 4);
assert(rdata);
return *(rdata->data + 4);
}
static inline
const uint8_t *knot_nsec3param_salt(const knot_rdataset_t *rrs, size_t pos)
const uint8_t *knot_nsec3param_salt(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_rdata_offset(rrs, pos, 5);
assert(rdata);
return rdata->data + 5;
}
/*! @} */
......@@ -143,9 +143,8 @@ static uint8_t *edns_add(knot_rrset_t *opt, uint16_t code, uint16_t size,
// extract old RDATA
knot_rdata_t *old_rdata = knot_rdataset_at(&opt->rrs, 0);
uint8_t *old_data = old_rdata->data;
uint16_t old_data_len = old_rdata->len;
uint8_t *old_data = opt->rrs.rdata->data;
uint16_t old_data_len = opt->rrs.rdata->len;
// construct new RDATA
......@@ -172,7 +171,7 @@ static uint8_t *edns_add(knot_rrset_t *opt, uint16_t code, uint16_t size,
return NULL;
}
return knot_rdataset_at(&opt->rrs, 0)->data + offset;
return opt->rrs.rdata->data + offset;
}
_public_
......@@ -220,7 +219,7 @@ uint8_t *knot_edns_get_option(const knot_rrset_t *opt_rr, uint16_t code)
return NULL;
}
knot_rdata_t *rdata = knot_rdataset_at(&opt_rr->rrs, 0);
knot_rdata_t *rdata = opt_rr->rrs.rdata;
if (rdata == NULL || rdata->len == 0) {
return NULL;
}
......@@ -248,7 +247,7 @@ int knot_edns_get_options(knot_rrset_t *opt_rr, knot_edns_options_t **out,
return KNOT_EINVAL;
}
knot_rdata_t *rdata = knot_rdataset_at(&opt_rr->rrs, 0);
knot_rdata_t *rdata = opt_rr->rrs.rdata;
if (rdata == NULL || rdata->len == 0) {
return KNOT_EOK;
}
......
......@@ -117,8 +117,7 @@ static inline
size_t knot_edns_wire_size(knot_rrset_t *opt_rr)
{
assert(opt_rr != NULL);
knot_rdata_t *rdata = knot_rdataset_at(&opt_rr->rrs, 0);
return KNOT_EDNS_MIN_SIZE + rdata->len;
return KNOT_EDNS_MIN_SIZE + opt_rr->rrs.rdata->len;
}
/*!
......
......@@ -24,55 +24,58 @@
#include "libknot/descriptor.h"
#include "libknot/dname.h"
#include "libknot/rdataset.h"
#include "libknot/rdata.h"
static inline
const knot_dname_t *knot_cname_name(const knot_rdataset_t *rrs)
const knot_dname_t *knot_cname_name(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_rdata_offset(rrs, 0, 0);
assert(rdata);
return rdata->data;
}
static inline
const knot_dname_t *knot_dname_target(const knot_rdataset_t *rrs)
const knot_dname_t *knot_dname_target(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_rdata_offset(rrs, 0, 0);
assert(rdata);
return rdata->data;
}
static inline
const knot_dname_t *knot_ns_name(const knot_rdataset_t *rrs, size_t pos)
const knot_dname_t *knot_ns_name(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_rdata_offset(rrs, pos, 0);
assert(rdata);
return rdata->data;
}
static inline
const knot_dname_t *knot_mx_name(const knot_rdataset_t *rrs, size_t pos)
const knot_dname_t *knot_mx_name(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_rdata_offset(rrs, pos, 2);
assert(rdata);
return rdata->data + 2;
}
static inline
const knot_dname_t *knot_srv_name(const knot_rdataset_t *rrs, size_t pos)
const knot_dname_t *knot_srv_name(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_rdata_offset(rrs, pos, 6);
assert(rdata);
return rdata->data + 6;
}
static inline
const knot_dname_t *knot_rdata_name(const knot_rdataset_t *rrs, size_t pos, uint16_t type)
const knot_dname_t *knot_rdata_name(const knot_rdata_t *rdata, uint16_t type)
{
assert(rdata);
switch (type) {
case KNOT_RRTYPE_NS:
return knot_ns_name(rrs, pos);
return knot_ns_name(rdata);
case KNOT_RRTYPE_MX:
return knot_mx_name(rrs, pos);
return knot_mx_name(rdata);
case KNOT_RRTYPE_SRV:
return knot_srv_name(rrs, pos);
return knot_srv_name(rdata);
case KNOT_RRTYPE_CNAME:
return knot_cname_name(rrs);
return knot_cname_name(rdata);
case KNOT_RRTYPE_DNAME:
return knot_dname_target(rdata);
}
return NULL;
......
......@@ -23,87 +23,77 @@
#pragma once
#include "libknot/dname.h"
#include "libknot/rdataset.h"
#include "libknot/rdata.h"
#include "libknot/wire.h"
static inline
uint16_t knot_rrsig_type_covered(const knot_rdataset_t *rrs, size_t pos)
uint16_t knot_rrsig_type_covered(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_wire_read_u16(knot_rdata_offset(rrs, pos, 0));
assert(rdata);
return knot_wire_read_u16(rdata->data);
}
static inline
uint8_t knot_rrsig_algorithm(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_rrsig_alg(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 2);
assert(rdata);
return *(rdata->data + 2);
}
static inline
uint8_t knot_rrsig_labels(const knot_rdataset_t *rrs, size_t pos)
uint8_t knot_rrsig_labels(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return *knot_rdata_offset(rrs, pos, 3);
assert(rdata);
return *(rdata->data + 3);
}
static inline
uint32_t knot_rrsig_original_ttl(const knot_rdataset_t *rrs, size_t pos)
uint32_t knot_rrsig_original_ttl(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_wire_read_u32(knot_rdata_offset(rrs, pos, 4));
assert(rdata);
return knot_wire_read_u32(rdata->data + 4);
}
static inline
uint32_t knot_rrsig_sig_expiration(const knot_rdataset_t *rrs, size_t pos)
uint32_t knot_rrsig_sig_expiration(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_wire_read_u32(knot_rdata_offset(rrs, pos, 8));
assert(rdata);
return knot_wire_read_u32(rdata->data + 8);
}
static inline
uint32_t knot_rrsig_sig_inception(const knot_rdataset_t *rrs, size_t pos)
uint32_t knot_rrsig_sig_inception(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_wire_read_u32(knot_rdata_offset(rrs, pos, 12));
assert(rdata);
return knot_wire_read_u32(rdata->data + 12);
}
static inline
uint16_t knot_rrsig_key_tag(const knot_rdataset_t *rrs, size_t pos)
uint16_t knot_rrsig_key_tag(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_wire_read_u16(knot_rdata_offset(rrs, pos, 16));
assert(rdata);
return knot_wire_read_u16(rdata->data + 16);
}
static inline
const knot_dname_t *knot_rrsig_signer_name(const knot_rdataset_t *rrs,
size_t pos)
const knot_dname_t *knot_rrsig_signer_name(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, pos);
return knot_rdata_offset(rrs, pos, 18);
assert(rdata);
return rdata->data + 18;
}
static inline
void knot_rrsig_signature(const knot_rdataset_t *rrs, size_t pos,
uint8_t **signature, size_t *signature_size)
uint16_t knot_rrsig_signature_len(const knot_rdata_t *rdata)
{
if (!signature || !signature_size) {
return;
}
if (rrs == NULL || pos >= rrs->count) {
*signature = NULL;
*signature_size = 0;
return;
}
uint8_t *rdata = knot_rdata_offset(rrs, pos, 0);
uint8_t *signer = rdata + 18;
size_t total_size = knot_rdataset_at(rrs, pos)->len;
size_t header_size = 18 + knot_dname_size(signer);
*signature = rdata + header_size;
*signature_size = total_size - header_size;
assert(rdata);
return rdata->len - 18 - knot_dname_size(knot_rrsig_signer_name(rdata));
}
static inline
const uint8_t *knot_rrsig_signature(const knot_rdata_t *rdata)
{
assert(rdata);
return rdata->data + 18 + knot_dname_size(knot_rrsig_signer_name(rdata));
}
/*! @} */
......@@ -23,71 +23,71 @@
#pragma once
#include "libknot/dname.h"
#include "libknot/rdataset.h"
#include "libknot/rdata.h"
#include "libknot/wire.h"
static inline
const knot_dname_t *knot_soa_primary_ns(const knot_rdataset_t *rrs)
const knot_dname_t *knot_soa_primary(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_rdata_offset(rrs, 0, 0);
assert(rdata);
return rdata->data;
}
static inline
const knot_dname_t *knot_soa_mailbox(const knot_rdataset_t *rrs)
const knot_dname_t *knot_soa_mailbox(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_rdata_offset(rrs, 0, knot_dname_size(knot_soa_primary_ns(rrs)));
assert(rdata);
return rdata->data + knot_dname_size(knot_soa_primary(rdata));
}
static inline
size_t knot_soa_names_len(const knot_rdataset_t *rrs)
size_t knot_soa_names_len(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_dname_size(knot_soa_primary_ns(rrs))
+ knot_dname_size(knot_soa_mailbox(rrs));
assert(rdata);
return knot_dname_size(knot_soa_primary(rdata)) +
knot_dname_size(knot_soa_mailbox(rdata));
}
static inline
uint32_t knot_soa_serial(const knot_rdataset_t *rrs)
uint32_t knot_soa_serial(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_wire_read_u32(knot_rdata_offset(rrs, 0, knot_soa_names_len(rrs)));
assert(rdata);
return knot_wire_read_u32(rdata->data + knot_soa_names_len(rdata));
}
static inline
void knot_soa_serial_set(knot_rdataset_t *rrs, uint32_t serial)
void knot_soa_serial_set(knot_rdata_t *rdata, uint32_t serial)
{
KNOT_RDATASET_CHECK(rrs, 0);
knot_wire_write_u32(knot_rdata_offset(rrs, 0, knot_soa_names_len(rrs)), serial);
assert(rdata);
knot_wire_write_u32(rdata->data + knot_soa_names_len(rdata), serial);
}
static inline
uint32_t knot_soa_refresh(const knot_rdataset_t *rrs)
uint32_t knot_soa_refresh(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_wire_read_u32(knot_rdata_offset(rrs, 0, knot_soa_names_len(rrs) + 4));
assert(rdata);
return knot_wire_read_u32(rdata->data + knot_soa_names_len(rdata) + 4);
}
static inline
uint32_t knot_soa_retry(const knot_rdataset_t *rrs)
uint32_t knot_soa_retry(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_wire_read_u32(knot_rdata_offset(rrs, 0, knot_soa_names_len(rrs) + 8));
assert(rdata);
return knot_wire_read_u32(rdata->data + knot_soa_names_len(rdata) + 8);
}
static inline
uint32_t knot_soa_expire(const knot_rdataset_t *rrs)
uint32_t knot_soa_expire(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_wire_read_u32(knot_rdata_offset(rrs, 0, knot_soa_names_len(rrs) + 12));
assert(rdata);
return knot_wire_read_u32(rdata->data + knot_soa_names_len(rdata) + 12);
}
static inline
uint32_t knot_soa_minimum(const knot_rdataset_t *rrs)
uint32_t knot_soa_minimum(const knot_rdata_t *rdata)
{
KNOT_RDATASET_CHECK(rrs, 0);
return knot_wire_read_u32(knot_rdata_offset(rrs, 0, knot_soa_names_len(rrs) + 16));
assert(rdata);
return knot_wire_read_u32(rdata->data + knot_soa_names_len(rdata) + 16);
}