Commit 92606af5 authored by vendemiat's avatar vendemiat Committed by Ondřej Surý

Adding dnstap module

parent 3db1e627
......@@ -35,6 +35,8 @@ $(eval $(call find_lib,socket_wrapper))
$(eval $(call find_lib,libsystemd,227))
$(eval $(call find_lib,gnutls))
$(eval $(call find_lib,libedit))
$(eval $(call find_lib,libprotobuf-c,1.2.1))
$(eval $(call find_lib,libfstrm,0.2))
# Lookup SONAME
$(eval $(call find_soname,libknot))
......@@ -71,6 +73,12 @@ endif
endif
endif
# check for fstrm and protobuf for dnstap
ifeq ($(HAS_libfstrm)&$(HAS_libprotobuf-c),yes&yes)
BUILD_CFLAGS += -DENABLE_DNSTAP
ENABLE_DNSTAP := yes
endif
# Overview
info:
$(info Target: Knot DNS Resolver $(VERSION)-$(PLATFORM))
......@@ -112,6 +120,8 @@ info:
$(info [$(HAS_ltn12)] Lua socket ltn12 (trust anchor bootstrapping))
$(info [$(HAS_ssl.https)] Lua ssl.https (trust anchor bootstrapping))
$(info [$(HAS_libedit)] libedit (client))
$(info [$(HAS_libfstrm)] libfstrm (modules/dnstap))
$(info [$(HAS_libprotobuf-c)] libprotobuf-c (modules/dnstap))
$(info )
# Verify required dependencies are met, as listed above
......
......@@ -6,7 +6,8 @@ contrib_SOURCES := \
contrib/ucw/mempool.c \
contrib/murmurhash3/murmurhash3.c \
contrib/base32hex.c \
contrib/base64.c
contrib/base64.c \
contrib/dnstap/dnstap.pb-c.c
contrib_CFLAGS := -fPIC
contrib_TARGET := $(abspath contrib)/contrib$(AREXT)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -303,10 +303,12 @@ static struct qr_task *qr_task_create(struct worker_ctx *worker, uv_handle_t *ha
if (uv_udp_getsockname((uv_udp_t *)handle, dst_addr, &addr_len) == 0) {
task->req.qsource.dst_addr = dst_addr;
}
task->req.qsource.tcp = false;
} else if (handle->type == UV_TCP) {
if (uv_tcp_getsockname((uv_tcp_t *)handle, dst_addr, &addr_len) == 0) {
task->req.qsource.dst_addr = dst_addr;
}
task->req.qsource.tcp = true;
}
}
worker->stats.concurrent += 1;
......
......@@ -133,6 +133,7 @@ struct kr_request {
const struct sockaddr *dst_addr;
const knot_pkt_t *packet;
const knot_rrset_t *opt;
bool tcp; /* true if the query is on tcp */
} qsource;
struct {
unsigned rtt; /**< Current upstream RTT */
......
This diff is collapsed.
dnstap_CFLAGS := -fvisibility=hidden -fPIC
dnstap_SOURCES := modules/dnstap/dnstap.c
dnstap_DEPEND := $(libkres)
dnstap_LIBS := $(contrib_TARGET) $(libkres_TARGET) $(libkres_LIBS) $(libprotobuf-c_LIBS) $(libfstrm_LIBS)
$(call make_c_module,dnstap)
......@@ -7,6 +7,10 @@ ifeq ($(ENABLE_COOKIES),yes)
modules_TARGETS += cookies
endif
ifeq ($(ENABLE_DNSTAP),yes)
modules_TARGETS += dnstap
endif
# Memcached
ifeq ($(HAS_libmemcached),yes)
modules_TARGETS += kmemcached
......
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