diff --git a/doc/man/knot.conf.5in b/doc/man/knot.conf.5in index 678831663cacfce0d83fd9df3056240b509b0d86..ac940dcc0d75b0aabda6c36e0b87e748d151d44f 100644 --- a/doc/man/knot.conf.5in +++ b/doc/man/knot.conf.5in @@ -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 diff --git a/doc/reference.rst b/doc/reference.rst index 8918e9555f347bd6d567758643d38eab3fd3c461..479b60636ef1b15c6998754a47301bc9f95c4ff3 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -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 ------------- diff --git a/src/knot/modules/dnstap.c b/src/knot/modules/dnstap.c index b8af0c884a2315e634b692d522def5b7065db365..057e38e40983d2bf5a79725755a9cf5fb818f856 100644 --- a/src/knot/modules/dnstap.c +++ b/src/knot/modules/dnstap.c @@ -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);