Commit 3d31a919 authored by Daniel Salzman's avatar Daniel Salzman

libknot: remove lookup_table_t from the API

parent 46fad461
......@@ -28,7 +28,7 @@ const lookup_table_t opcode_names[] = {
{ 0, NULL }
};
_public_
const lookup_table_t *knot_opcode_names = opcode_names;
const void *knot_opcode_names = opcode_names;
const lookup_table_t rcode_names[] = {
{ KNOT_RCODE_NOERROR, "NOERROR" },
......@@ -46,7 +46,7 @@ const lookup_table_t rcode_names[] = {
{ 0, NULL }
};
_public_
const lookup_table_t *knot_rcode_names = rcode_names;
const void *knot_rcode_names = rcode_names;
const lookup_table_t tsig_err_names[] = {
{ KNOT_TSIG_ERR_BADSIG, "BADSIG" },
......@@ -56,7 +56,7 @@ const lookup_table_t tsig_err_names[] = {
{ 0, NULL }
};
_public_
const lookup_table_t *knot_tsig_err_names = tsig_err_names;
const void *knot_tsig_err_names = tsig_err_names;
const lookup_table_t tkey_err_names[] = {
{ KNOT_TKEY_ERR_BADMODE, "BADMODE" },
......@@ -65,7 +65,7 @@ const lookup_table_t tkey_err_names[] = {
{ 0, NULL }
};
_public_
const lookup_table_t *knot_tkey_err_names = tkey_err_names;
const void *knot_tkey_err_names = tkey_err_names;
const lookup_table_t dnssec_alg_names[] = {
{ KNOT_DNSSEC_ALG_RSAMD5, "RSAMD5" },
......@@ -82,4 +82,4 @@ const lookup_table_t dnssec_alg_names[] = {
{ 0, NULL }
};
_public_
const lookup_table_t *knot_dnssec_alg_names = dnssec_alg_names;
const void *knot_dnssec_alg_names = dnssec_alg_names;
......@@ -24,31 +24,29 @@
#pragma once
struct lookup_table;
/*!
* \brief DNS operation code names.
*/
extern const struct lookup_table *knot_opcode_names;
extern const void *knot_opcode_names;
/*!
* \brief DNS reply code names.
*/
extern const struct lookup_table *knot_rcode_names;
extern const void *knot_rcode_names;
/*!
* \brief TSIG error names.
*/
extern const struct lookup_table *knot_tsig_err_names;
extern const void *knot_tsig_err_names;
/*!
* \brief TKEY error names.
*/
extern const struct lookup_table *knot_tkey_err_names;
extern const void *knot_tkey_err_names;
/*!
* \brief DNSSEC algorithm names.
*/
extern const struct lookup_table *knot_dnssec_alg_names;
extern const void *knot_dnssec_alg_names;
/*! @} */
......@@ -1191,7 +1191,7 @@ static void wire_tsig_rcode_to_str(rrset_dump_params_t *p)
// Find RCODE name.
const lookup_table_t *rcode = NULL;
rcode = lookup_by_id((data >= knot_tsig_err_names->id) ?
rcode = lookup_by_id((data >= ((lookup_table_t *)knot_tsig_err_names)->id) ?
knot_tsig_err_names : knot_rcode_names,
data);
if (rcode != NULL) {
......
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