Skip to content
Snippets Groups Projects
Commit 8e90439f authored by Daniel Salzman's avatar Daniel Salzman
Browse files

dnstap: code unification

parent 6cd4670f
Branches
Tags
No related merge requests found
......@@ -1028,6 +1028,8 @@ mod\-dnstap:
sink: STR
identity: STR
version: STR
log\-queries: BOOL
log\-responses: BOOL
.ft P
.fi
.UNINDENT
......@@ -1051,6 +1053,16 @@ A DNS server identity. Set empty value to disable.
A DNS server version. Set empty value to disable.
.sp
\fIDefault:\fP server version
.SS log\-queries
.sp
If enabled, query messages will be logged.
.sp
\fIDefault:\fP on
.SS log\-responses
.sp
If enabled, response messages will be logged.
.sp
\fIDefault:\fP on
.SH MODULE SYNTH-RECORD
.sp
This module is able to synthesize either forward or reverse records for the
......
......@@ -1250,6 +1250,8 @@ A DNS server version. Set empty value to disable.
*Default:* server version
.. _mod-dnstap_log-queries:
log-queries
-----------
......@@ -1257,6 +1259,8 @@ If enabled, query messages will be logged.
*Default:* on
.. _mod-dnstap_log-responses:
log-responses
-------------
......
......@@ -34,13 +34,13 @@
#define MOD_RESPONSES "\x0D""log-responses"
const yp_item_t scheme_mod_dnstap[] = {
{ C_ID, YP_TSTR, YP_VNONE },
{ MOD_SINK, YP_TSTR, YP_VNONE },
{ MOD_IDENTITY, YP_TSTR, YP_VNONE },
{ MOD_VERSION, YP_TSTR, YP_VSTR = { "Knot DNS " PACKAGE_VERSION } },
{ MOD_QUERIES, YP_TBOOL, YP_VBOOL = true },
{ MOD_RESPONSES,YP_TBOOL, YP_VBOOL = true },
{ C_COMMENT, YP_TSTR, YP_VNONE },
{ C_ID, YP_TSTR, YP_VNONE },
{ MOD_SINK, YP_TSTR, YP_VNONE },
{ MOD_IDENTITY, YP_TSTR, YP_VNONE },
{ MOD_VERSION, YP_TSTR, YP_VSTR = { "Knot DNS " PACKAGE_VERSION } },
{ MOD_QUERIES, YP_TBOOL, YP_VBOOL = { true } },
{ MOD_RESPONSES, YP_TBOOL, YP_VBOOL = { true } },
{ C_COMMENT, YP_TSTR, YP_VNONE },
{ NULL }
};
......@@ -238,7 +238,7 @@ int dnstap_load(struct query_plan *plan, struct query_module *self,
conf_val_t val;
// Set identity.
/* Set identity. */
val = conf_mod_get(self->config, MOD_IDENTITY, self->id);
if (val.code == KNOT_EOK) {
ctx->identity = strdup(conf_str(&val));
......@@ -247,7 +247,7 @@ int dnstap_load(struct query_plan *plan, struct query_module *self,
}
ctx->identity_len = (ctx->identity != NULL) ? strlen(ctx->identity) : 0;
// Set version.
/* Set version. */
val = conf_mod_get(self->config, MOD_VERSION, self->id);
ctx->version = strdup(conf_str(&val));
ctx->version_len = strlen(ctx->version);
......
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