|
|
|
@ -386,13 +386,15 @@ static int DNSRRTypeEnabled(uint16_t type, uint64_t flags)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void LogQuery(LogDnsLogThread *aft, json_t *js, DNSTransaction *tx,
|
|
|
|
|
uint64_t tx_id, DNSQueryEntry *entry) __attribute__((nonnull));
|
|
|
|
|
|
|
|
|
|
static void LogQuery(LogDnsLogThread *aft, json_t *js, DNSTransaction *tx,
|
|
|
|
|
uint64_t tx_id, DNSQueryEntry *entry)
|
|
|
|
|
{
|
|
|
|
|
SCLogDebug("got a DNS request and now logging !!");
|
|
|
|
|
|
|
|
|
|
if (entry != NULL &&
|
|
|
|
|
!DNSRRTypeEnabled(entry->type, aft->dnslog_ctx->flags)) {
|
|
|
|
|
if (!DNSRRTypeEnabled(entry->type, aft->dnslog_ctx->flags)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -432,10 +434,13 @@ static void LogQuery(LogDnsLogThread *aft, json_t *js, DNSTransaction *tx,
|
|
|
|
|
json_object_del(js, "dns");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void OutputAnswer(LogDnsLogThread *aft, json_t *djs, DNSTransaction *tx, DNSAnswerEntry *entry)
|
|
|
|
|
static void OutputAnswer(LogDnsLogThread *aft, json_t *djs,
|
|
|
|
|
DNSTransaction *tx, DNSAnswerEntry *entry) __attribute__((nonnull));
|
|
|
|
|
|
|
|
|
|
static void OutputAnswer(LogDnsLogThread *aft, json_t *djs,
|
|
|
|
|
DNSTransaction *tx, DNSAnswerEntry *entry)
|
|
|
|
|
{
|
|
|
|
|
if (entry != NULL &&
|
|
|
|
|
!DNSRRTypeEnabled(entry->type, aft->dnslog_ctx->flags)) {
|
|
|
|
|
if (!DNSRRTypeEnabled(entry->type, aft->dnslog_ctx->flags)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -454,8 +459,6 @@ static void OutputAnswer(LogDnsLogThread *aft, json_t *djs, DNSTransaction *tx,
|
|
|
|
|
DNSCreateRcodeString(tx->rcode, rcode, sizeof(rcode));
|
|
|
|
|
json_object_set_new(js, "rcode", json_string(rcode));
|
|
|
|
|
|
|
|
|
|
/* we are logging an answer RR */
|
|
|
|
|
if (entry != NULL) {
|
|
|
|
|
/* query */
|
|
|
|
|
if (entry->fqdn_len > 0) {
|
|
|
|
|
char *c;
|
|
|
|
@ -532,7 +535,6 @@ static void OutputAnswer(LogDnsLogThread *aft, json_t *djs, DNSTransaction *tx,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* reset */
|
|
|
|
|
MemBufferReset(aft->buffer);
|
|
|
|
@ -543,10 +545,13 @@ static void OutputAnswer(LogDnsLogThread *aft, json_t *djs, DNSTransaction *tx,
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void OutputFailure(LogDnsLogThread *aft, json_t *djs, DNSTransaction *tx, DNSQueryEntry *entry)
|
|
|
|
|
static void OutputFailure(LogDnsLogThread *aft, json_t *djs,
|
|
|
|
|
DNSTransaction *tx, DNSQueryEntry *entry) __attribute__((nonnull));
|
|
|
|
|
|
|
|
|
|
static void OutputFailure(LogDnsLogThread *aft, json_t *djs,
|
|
|
|
|
DNSTransaction *tx, DNSQueryEntry *entry)
|
|
|
|
|
{
|
|
|
|
|
if (entry != NULL &&
|
|
|
|
|
!DNSRRTypeEnabled(entry->type, aft->dnslog_ctx->flags)) {
|
|
|
|
|
if (!DNSRRTypeEnabled(entry->type, aft->dnslog_ctx->flags)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|