Commit c9843438 authored by Mark Karpilovskij's avatar Mark Karpilovskij Committed by Daniel Salzman

conf: add callbacks for parsing RR type

parent b7ae9804
......@@ -182,6 +182,35 @@ int edns_opt_to_txt(
YP_CHECK_RET;
}
int rrtype_to_bin(
YP_TXT_BIN_PARAMS)
{
YP_CHECK_PARAMS_BIN;
uint16_t type;
int ret = knot_rrtype_from_string((char *)in->position, &type);
if (ret != 0) {
return KNOT_EINVAL;
}
wire_ctx_write_u64(out, type);
YP_CHECK_RET;
}
int rrtype_to_txt(
YP_BIN_TXT_PARAMS)
{
YP_CHECK_PARAMS_TXT;
uint16_t type = (uint16_t)wire_ctx_read_u64(in);
int ret = knot_rrtype_to_string(type, (char *)out->position, out->size);
if (ret != 0) {
return KNOT_EINVAL;
}
YP_CHECK_RET;
}
int check_ref(
knotd_conf_check_args_t *args)
{
......
......@@ -50,6 +50,14 @@ int edns_opt_to_txt(
YP_BIN_TXT_PARAMS
);
int rrtype_to_bin(
YP_TXT_BIN_PARAMS
);
int rrtype_to_txt(
YP_BIN_TXT_PARAMS
);
int check_ref(
knotd_conf_check_args_t *args
);
......
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