Commit 7d262a36 authored by Mark Andrews's avatar Mark Andrews

4394. [func] Add rndc command "dnstap-reopen" to close and

                        reopen dnstap output filed. [RT #41803]
parent e8300d72
4394. [func] Add rndc command "dnstap-reopen" to close and
reopen dnstap output filed. [RT #41803]
4393. [bug] Address potential NULL pointer dereferences in
dnstap code.
......
......@@ -281,6 +281,8 @@ ns_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
result = ns_server_testgen(lex, text);
} else if (command_compare(command, NS_COMMAND_MKEYS)) {
result = ns_server_mkeys(ns_g_server, lex, text);
} else if (command_compare(command, NS_COMMAND_DNSTAPREOPEN)) {
result = ns_server_dnstap_reopen(ns_g_server);
} else {
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_CONTROL, ISC_LOG_WARNING,
......
......@@ -72,6 +72,7 @@
#define NS_COMMAND_NTA "nta"
#define NS_COMMAND_TESTGEN "testgen"
#define NS_COMMAND_MKEYS "managed-keys"
#define NS_COMMAND_DNSTAPREOPEN "dnstap-reopen"
isc_result_t
ns_controls_create(ns_server_t *server, ns_controls_t **ctrlsp);
......
......@@ -745,4 +745,10 @@ ns_server_testgen(isc_lex_t *lex, isc_buffer_t **text);
isc_result_t
ns_server_mkeys(ns_server_t *server, isc_lex_t *lex, isc_buffer_t **text);
/*%
* Close and reopen DNSTAP output file.
*/
isc_result_t
ns_server_dnstap_reopen(ns_server_t *server);
#endif /* NAMED_SERVER_H */
......@@ -12189,3 +12189,16 @@ ns_server_mkeys(ns_server_t *server, isc_lex_t *lex, isc_buffer_t **text) {
return (result);
}
isc_result_t
ns_server_dnstap_reopen(ns_server_t *server) {
#if HAVE_DNSTAP
if (server->dtenv != NULL)
return(dns_dt_reopen(server->dtenv));
return (ISC_R_NOTFOUND);
#else
UNUSED(server);
return (ISC_R_NOTIMPLEMENTED);
#endif
}
......@@ -44,6 +44,7 @@
<year>2013</year>
<year>2014</year>
<year>2015</year>
<year>2016</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
<copyright>
......@@ -313,6 +314,16 @@
</listitem>
</varlistentry>
<varlistentry>
<term><userinput>dnstap-reopen</userinput></term>
<listitem>
<para>
Close and re-open DNSTAP output files. This allows the files
to be renamed externally then to be re-opened.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><userinput>dumpdb <optional>-all|-cache|-zone|-adb|-bad|-fail</optional> <optional><replaceable>view ...</replaceable></optional></userinput></term>
<listitem>
......
......@@ -20,3 +20,4 @@ rm -f */named.stats
rm -f dig.out*
rm -f ns*/named.lock
rm -f ns*/dnstap.out
rm -f ns*/dnstap.out.save
......@@ -21,6 +21,18 @@ RNDCCMD="$RNDC -p 9953 -c ../common/rndc.conf"
status=0
$DIG +short @10.53.0.3 -p 5300 a.example > dig.out
mv ns1/dnstap.out ns1/dnstap.out.save
mv ns2/dnstap.out ns2/dnstap.out.save
mv ns3/dnstap.out ns3/dnstap.out.save
sleep 2
$RNDCCMD -s 10.53.0.1 dnstap-reopen | sed 's/^/I:ns1 /'
$RNDCCMD -s 10.53.0.2 dnstap-reopen | sed 's/^/I:ns2 /'
$RNDCCMD -s 10.53.0.3 dnstap-reopen | sed 's/^/I:ns3 /'
$DIG +short @10.53.0.3 -p 5300 a.example > dig.out
sleep 1
......@@ -34,34 +46,35 @@ $RNDCCMD -s 10.53.0.2 stop | sed 's/^/I:ns2 /'
$RNDCCMD -s 10.53.0.3 stop | sed 's/^/I:ns3 /'
sleep 1
udp1=`$DNSTAPREAD ns1/dnstap.out | grep "UDP " | wc -l`
tcp1=`$DNSTAPREAD ns1/dnstap.out | grep "TCP " | wc -l`
aq1=`$DNSTAPREAD ns1/dnstap.out | grep "AQ " | wc -l`
ar1=`$DNSTAPREAD ns1/dnstap.out | grep "AR " | wc -l`
cq1=`$DNSTAPREAD ns1/dnstap.out | grep "CQ " | wc -l`
cr1=`$DNSTAPREAD ns1/dnstap.out | grep "CR " | wc -l`
rq1=`$DNSTAPREAD ns1/dnstap.out | grep "RQ " | wc -l`
rr1=`$DNSTAPREAD ns1/dnstap.out | grep "RR " | wc -l`
udp1=`$DNSTAPREAD ns1/dnstap.out.save | grep "UDP " | wc -l`
tcp1=`$DNSTAPREAD ns1/dnstap.out.save | grep "TCP " | wc -l`
aq1=`$DNSTAPREAD ns1/dnstap.out.save | grep "AQ " | wc -l`
ar1=`$DNSTAPREAD ns1/dnstap.out.save | grep "AR " | wc -l`
cq1=`$DNSTAPREAD ns1/dnstap.out.save | grep "CQ " | wc -l`
cr1=`$DNSTAPREAD ns1/dnstap.out.save | grep "CR " | wc -l`
rq1=`$DNSTAPREAD ns1/dnstap.out.save | grep "RQ " | wc -l`
rr1=`$DNSTAPREAD ns1/dnstap.out.save | grep "RR " | wc -l`
udp2=`$DNSTAPREAD ns2/dnstap.out | grep "UDP " | wc -l`
tcp2=`$DNSTAPREAD ns2/dnstap.out | grep "TCP " | wc -l`
aq2=`$DNSTAPREAD ns2/dnstap.out | grep "AQ " | wc -l`
ar2=`$DNSTAPREAD ns2/dnstap.out | grep "AR " | wc -l`
cq2=`$DNSTAPREAD ns2/dnstap.out | grep "CQ " | wc -l`
cr2=`$DNSTAPREAD ns2/dnstap.out | grep "CR " | wc -l`
rq2=`$DNSTAPREAD ns2/dnstap.out | grep "RQ " | wc -l`
rr2=`$DNSTAPREAD ns2/dnstap.out | grep "RR " | wc -l`
udp2=`$DNSTAPREAD ns2/dnstap.out.save | grep "UDP " | wc -l`
tcp2=`$DNSTAPREAD ns2/dnstap.out.save | grep "TCP " | wc -l`
aq2=`$DNSTAPREAD ns2/dnstap.out.save | grep "AQ " | wc -l`
ar2=`$DNSTAPREAD ns2/dnstap.out.save | grep "AR " | wc -l`
cq2=`$DNSTAPREAD ns2/dnstap.out.save | grep "CQ " | wc -l`
cr2=`$DNSTAPREAD ns2/dnstap.out.save | grep "CR " | wc -l`
rq2=`$DNSTAPREAD ns2/dnstap.out.save | grep "RQ " | wc -l`
rr2=`$DNSTAPREAD ns2/dnstap.out.save | grep "RR " | wc -l`
udp3=`$DNSTAPREAD ns3/dnstap.out | grep "UDP " | wc -l`
tcp3=`$DNSTAPREAD ns3/dnstap.out | grep "TCP " | wc -l`
aq3=`$DNSTAPREAD ns3/dnstap.out | grep "AQ " | wc -l`
ar3=`$DNSTAPREAD ns3/dnstap.out | grep "AR " | wc -l`
cq3=`$DNSTAPREAD ns3/dnstap.out | grep "CQ " | wc -l`
cr3=`$DNSTAPREAD ns3/dnstap.out | grep "CR " | wc -l`
rq3=`$DNSTAPREAD ns3/dnstap.out | grep "RQ " | wc -l`
rr3=`$DNSTAPREAD ns3/dnstap.out | grep "RR " | wc -l`
udp3=`$DNSTAPREAD ns3/dnstap.out.save | grep "UDP " | wc -l`
tcp3=`$DNSTAPREAD ns3/dnstap.out.save | grep "TCP " | wc -l`
aq3=`$DNSTAPREAD ns3/dnstap.out.save | grep "AQ " | wc -l`
ar3=`$DNSTAPREAD ns3/dnstap.out.save | grep "AR " | wc -l`
cq3=`$DNSTAPREAD ns3/dnstap.out.save | grep "CQ " | wc -l`
cr3=`$DNSTAPREAD ns3/dnstap.out.save | grep "CR " | wc -l`
rq3=`$DNSTAPREAD ns3/dnstap.out.save | grep "RQ " | wc -l`
rr3=`$DNSTAPREAD ns3/dnstap.out.save | grep "RR " | wc -l`
echo "I:checking UDP message counts"
echo "I:checking initial message counts"
echo "I: checking UDP message counts"
ret=0
[ $udp1 -eq 0 ] || {
echo "ns1 $udp1 expected 0" ; ret=1
......@@ -72,10 +85,10 @@ ret=0
[ $udp3 -eq 4 ] || {
echo "ns3 $udp3 expected 4" ; ret=1
}
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I:checking TCP message counts"
echo "I: checking TCP message counts"
ret=0
[ $tcp1 -eq 6 ] || {
echo "ns1 $tcp1 expected 6" ; ret=1
......@@ -86,10 +99,10 @@ ret=0
[ $tcp3 -eq 6 ] || {
echo "ns3 $tcp3 expected 6" ; ret=1
}
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I:checking AUTH_QUERY message counts"
echo "I: checking AUTH_QUERY message counts"
ret=0
[ $aq1 -eq 2 ] || {
echo "ns1 $aq1 exepcted 2" ; ret=1
......@@ -100,10 +113,10 @@ ret=0
[ $aq3 -eq 0 ] || {
echo "ns3 $aq3 expected 0" ; ret=1
}
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I:checking AUTH_RESPONSE message counts"
echo "I: checking AUTH_RESPONSE message counts"
ret=0
[ $ar1 -eq 2 ] || {
echo "ns1 $ar1 expected 2" ; ret=1
......@@ -114,10 +127,10 @@ ret=0
[ $ar3 -eq 0 ] || {
echo "ns3 $ar3 expected 0" ; ret=1
}
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I:checking CLIENT_QUERY message counts"
echo "I: checking CLIENT_QUERY message counts"
ret=0
[ $cq1 -eq 1 ] || {
echo "ns1 $cq1 expected 1" ; ret=1
......@@ -128,10 +141,10 @@ ret=0
[ $cq3 -eq 2 ] || {
echo "ns3 $cq3 expected 2" ; ret=1
}
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I:checking CLIENT_RESPONSE message counts"
echo "I: checking CLIENT_RESPONSE message counts"
ret=0
[ $cr1 -eq 1 ] || {
echo "ns1 $cr1 expected 1" ; ret=1
......@@ -142,10 +155,10 @@ ret=0
[ $cr3 -eq 2 ] || {
echo "ns3 $cr3 expected 2" ; ret=1
}
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I:checking RESOLVER_QUERY message counts"
echo "I: checking RESOLVER_QUERY message counts"
ret=0
[ $rq1 -eq 0 ] || {
echo "ns1 $rq1 expected 0" ; ret=1
......@@ -156,10 +169,10 @@ ret=0
[ $rq3 -eq 3 ] || {
echo "ns3 $rq3 expected 3" ; ret=1
}
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I:checking RESOLVER_RESPONSE message counts"
echo "I: checking RESOLVER_RESPONSE message counts"
ret=0
[ $rr1 -eq 0 ] || {
echo "ns1 $rr1 expected 0" ; ret=1
......@@ -170,7 +183,148 @@ ret=0
[ $rr3 -eq 3 ] || {
echo "ns3 $rr3 expected 3" ; ret=1
}
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
udp1=`$DNSTAPREAD ns1/dnstap.out | grep "UDP " | wc -l`
tcp1=`$DNSTAPREAD ns1/dnstap.out | grep "TCP " | wc -l`
aq1=`$DNSTAPREAD ns1/dnstap.out | grep "AQ " | wc -l`
ar1=`$DNSTAPREAD ns1/dnstap.out | grep "AR " | wc -l`
cq1=`$DNSTAPREAD ns1/dnstap.out | grep "CQ " | wc -l`
cr1=`$DNSTAPREAD ns1/dnstap.out | grep "CR " | wc -l`
rq1=`$DNSTAPREAD ns1/dnstap.out | grep "RQ " | wc -l`
rr1=`$DNSTAPREAD ns1/dnstap.out | grep "RR " | wc -l`
udp2=`$DNSTAPREAD ns2/dnstap.out | grep "UDP " | wc -l`
tcp2=`$DNSTAPREAD ns2/dnstap.out | grep "TCP " | wc -l`
aq2=`$DNSTAPREAD ns2/dnstap.out | grep "AQ " | wc -l`
ar2=`$DNSTAPREAD ns2/dnstap.out | grep "AR " | wc -l`
cq2=`$DNSTAPREAD ns2/dnstap.out | grep "CQ " | wc -l`
cr2=`$DNSTAPREAD ns2/dnstap.out | grep "CR " | wc -l`
rq2=`$DNSTAPREAD ns2/dnstap.out | grep "RQ " | wc -l`
rr2=`$DNSTAPREAD ns2/dnstap.out | grep "RR " | wc -l`
udp3=`$DNSTAPREAD ns3/dnstap.out | grep "UDP " | wc -l`
tcp3=`$DNSTAPREAD ns3/dnstap.out | grep "TCP " | wc -l`
aq3=`$DNSTAPREAD ns3/dnstap.out | grep "AQ " | wc -l`
ar3=`$DNSTAPREAD ns3/dnstap.out | grep "AR " | wc -l`
cq3=`$DNSTAPREAD ns3/dnstap.out | grep "CQ " | wc -l`
cr3=`$DNSTAPREAD ns3/dnstap.out | grep "CR " | wc -l`
rq3=`$DNSTAPREAD ns3/dnstap.out | grep "RQ " | wc -l`
rr3=`$DNSTAPREAD ns3/dnstap.out | grep "RR " | wc -l`
echo "I:checking reopened message counts"
echo "I: checking UDP message counts"
ret=0
[ $udp1 -eq 0 ] || {
echo "ns1 $udp1 expected 0" ; ret=1
}
[ $udp2 -eq 0 ] || {
echo "ns2 $udp2 expected 0" ; ret=1
}
[ $udp3 -eq 2 ] || {
echo "ns3 $udp3 expected 2" ; ret=1
}
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I: checking TCP message counts"
ret=0
[ $tcp1 -eq 0 ] || {
echo "ns1 $tcp1 expected 0" ; ret=1
}
[ $tcp2 -eq 0 ] || {
echo "ns2 $tcp2 expected 0" ; ret=1
}
[ $tcp3 -eq 0 ] || {
echo "ns3 $tcp3 expected 0" ; ret=1
}
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I: checking AUTH_QUERY message counts"
ret=0
[ $aq1 -eq 0 ] || {
echo "ns1 $aq1 exepcted 0" ; ret=1
}
[ $aq2 -eq 0 ] || {
echo "ns2 $aq2 expected 0" ; ret=1
}
[ $aq3 -eq 0 ] || {
echo "ns3 $aq3 expected 0" ; ret=1
}
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I: checking AUTH_RESPONSE message counts"
ret=0
[ $ar1 -eq 0 ] || {
echo "ns1 $ar1 expected 0" ; ret=1
}
[ $ar2 -eq 0 ] || {
echo "ns2 $ar2 expected 0" ; ret=1
}
[ $ar3 -eq 0 ] || {
echo "ns3 $ar3 expected 0" ; ret=1
}
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I: checking CLIENT_QUERY message counts"
ret=0
[ $cq1 -eq 0 ] || {
echo "ns1 $cq1 expected 0" ; ret=1
}
[ $cq2 -eq 0 ] || {
echo "ns2 $cq2 expected 0" ; ret=1
}
[ $cq3 -eq 1 ] || {
echo "ns3 $cq3 expected 1" ; ret=1
}
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I: checking CLIENT_RESPONSE message counts"
ret=0
[ $cr1 -eq 0 ] || {
echo "ns1 $cr1 expected 0" ; ret=1
}
[ $cr2 -eq 0 ] || {
echo "ns2 $cr2 expected 0" ; ret=1
}
[ $cr3 -eq 1 ] || {
echo "ns3 $cr3 expected 1" ; ret=1
}
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I: checking RESOLVER_QUERY message counts"
ret=0
[ $rq1 -eq 0 ] || {
echo "ns1 $rq1 expected 0" ; ret=1
}
[ $rq2 -eq 0 ] || {
echo "ns2 $rq2 expected 0" ; ret=1
}
[ $rq3 -eq 0 ] || {
echo "ns3 $rq3 expected 0" ; ret=1
}
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I: checking RESOLVER_RESPONSE message counts"
ret=0
[ $rr1 -eq 0 ] || {
echo "ns1 $rr1 expected 0" ; ret=1
}
[ $rr2 -eq 0 ] || {
echo "ns2 $rr2 expected 0" ; ret=1
}
[ $rr3 -eq 0 ] || {
echo "ns3 $rr3 expected 0" ; ret=1
}
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
......
......@@ -705,6 +705,7 @@ W3M
DBLATEX
PDFLATEX
LATEX
DNSTAP_PB_C_H
DNSTAPHTML
DNSTAPMAN
DNSTAPTARGETS
......@@ -20263,11 +20264,12 @@ DNSTAPOBJS=
DNSTAPTARGETS=
DNSTAPMAN=
DNSTAPHTML=
DNSTAP_PB_C_H=
if test "x$use_dnstap" != "xno"; then
if ! $use_threads; then
as_fn_error $? "Dnstap requires threads." "$LINENO" 5
fi
# Extract the first word of "protoc-c", so it can be a program name with args.
if ! $use_threads; then
as_fn_error $? "Dnstap requires threads." "$LINENO" 5
fi
# Extract the first word of "protoc-c", so it can be a program name with args.
set dummy protoc-c; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
......@@ -20307,38 +20309,38 @@ $as_echo "no" >&6; }
fi
if test -z "$PROTOC_C"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The protoc-c program was not found." >&5
if test -z "$PROTOC_C"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The protoc-c program was not found." >&5
$as_echo "$as_me: WARNING: The protoc-c program was not found." >&2;}
fi
fi
# Check whether --with-protobuf-c was given.
if test "${with_protobuf_c+set}" = set; then :
withval=$with_protobuf_c;
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f $withval/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I$withval/include/google"
else
CFLAGS="$CFLAGS -I$withval/include"
fi
LDFLAGS="$LDFLAGS -L$withval/lib"
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f $withval/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I$withval/include/google"
else
CFLAGS="$CFLAGS -I$withval/include"
fi
LDFLAGS="$LDFLAGS -L$withval/lib"
else
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f /usr/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/include/google"
else
if test -f /usr/local/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/local/include/google"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
fi
fi
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f /usr/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/include/google"
else
if test -f /usr/local/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/local/include/google"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
fi
fi
fi
......@@ -20346,13 +20348,13 @@ fi
# Check whether --with-libfstrm was given.
if test "${with_libfstrm+set}" = set; then :
withval=$with_libfstrm;
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fstrm_iothr_init" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fstrm_iothr_init" >&5
$as_echo_n "checking for library containing fstrm_iothr_init... " >&6; }
if ${ac_cv_search_fstrm_iothr_init+:} false; then :
$as_echo_n "(cached) " >&6
......@@ -20410,7 +20412,7 @@ else
as_fn_error $? "The fstrm library was not found. Please install fstrm!" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing protobuf_c_message_pack" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing protobuf_c_message_pack" >&5
$as_echo_n "checking for library containing protobuf_c_message_pack... " >&6; }
if ${ac_cv_search_protobuf_c_message_pack+:} false; then :
$as_echo_n "(cached) " >&6
......@@ -20472,12 +20474,13 @@ fi
$as_echo "#define HAVE_DNSTAP 1" >>confdefs.h
DNSTAP=dnstap
DNSTAPSRCS='${DNSTAPSRCS}'
DNSTAPOBJS='${DNSTAPOBJS}'
DNSTAPTARGETS='${DNSTAPTARGETS}'
DNSTAPMAN='${DNSTAPMAN}'
DNSTAPHTML='${DNSTAPHTML}'
DNSTAP=dnstap
DNSTAPSRCS='${DNSTAPSRCS}'
DNSTAPOBJS='${DNSTAPOBJS}'
DNSTAPTARGETS='${DNSTAPTARGETS}'
DNSTAPMAN='${DNSTAPMAN}'
DNSTAPHTML='${DNSTAPHTML}'
DNSTAP_PB_C_H="dnstap.pb-c.h"
fi
......@@ -20486,6 +20489,7 @@ fi
#
# The following sets up how non-blocking i/o is established.
# Sunos, cygwin and solaris 2.x (x<5) require special handling.
......
......@@ -4099,58 +4099,60 @@ DNSTAPOBJS=
DNSTAPTARGETS=
DNSTAPMAN=
DNSTAPHTML=
DNSTAP_PB_C_H=
if test "x$use_dnstap" != "xno"; then
if ! $use_threads; then
AC_MSG_ERROR([Dnstap requires threads.])
fi
AC_PATH_PROG([PROTOC_C], [protoc-c])
if test -z "$PROTOC_C"; then
AC_MSG_WARN([The protoc-c program was not found.])
fi
AC_ARG_WITH([protobuf-c],
AC_HELP_STRING([--with-protobuf-c=path],
[Path where protobuf-c is installed, for dnstap]), [
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f $withval/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I$withval/include/google"
else
CFLAGS="$CFLAGS -I$withval/include"
fi
LDFLAGS="$LDFLAGS -L$withval/lib"
], [
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f /usr/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/include/google"
else
if test -f /usr/local/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/local/include/google"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
fi
fi
])
AC_ARG_WITH([libfstrm], AC_HELP_STRING([--with-libfstrm=path],
[Path where libfstrm is installed, for dnstap]), [
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
])
AC_SEARCH_LIBS([fstrm_iothr_init], [fstrm], [],
AC_MSG_ERROR([The fstrm library was not found. Please install fstrm!]))
AC_SEARCH_LIBS([protobuf_c_message_pack], [protobuf-c], [],
AC_MSG_ERROR([The protobuf-c library was not found. Please install protobuf-c!]))
AC_DEFINE(HAVE_DNSTAP, 1, [Define to 1 to enable dnstap support])
DNSTAP=dnstap
DNSTAPSRCS='${DNSTAPSRCS}'
DNSTAPOBJS='${DNSTAPOBJS}'
DNSTAPTARGETS='${DNSTAPTARGETS}'
DNSTAPMAN='${DNSTAPMAN}'
DNSTAPHTML='${DNSTAPHTML}'
if ! $use_threads; then
AC_MSG_ERROR([Dnstap requires threads.])
fi
AC_PATH_PROG([PROTOC_C], [protoc-c])
if test -z "$PROTOC_C"; then
AC_MSG_WARN([The protoc-c program was not found.])
fi
AC_ARG_WITH([protobuf-c],
AC_HELP_STRING([--with-protobuf-c=path],
[Path where protobuf-c is installed, for dnstap]), [
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f $withval/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I$withval/include/google"
else
CFLAGS="$CFLAGS -I$withval/include"
fi
LDFLAGS="$LDFLAGS -L$withval/lib"
], [
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f /usr/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/include/google"
else
if test -f /usr/local/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/local/include/google"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
fi
fi
])
AC_ARG_WITH([libfstrm], AC_HELP_STRING([--with-libfstrm=path],
[Path where libfstrm is installed, for dnstap]), [
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
])
AC_SEARCH_LIBS([fstrm_iothr_init], [fstrm], [],
AC_MSG_ERROR([The fstrm library was not found. Please install fstrm!]))
AC_SEARCH_LIBS([protobuf_c_message_pack], [protobuf-c], [],
AC_MSG_ERROR([The protobuf-c library was not found. Please install protobuf-c!]))
AC_DEFINE(HAVE_DNSTAP, 1, [Define to 1 to enable dnstap support])
DNSTAP=dnstap
DNSTAPSRCS='${DNSTAPSRCS}'
DNSTAPOBJS='${DNSTAPOBJS}'
DNSTAPTARGETS='${DNSTAPTARGETS}'
DNSTAPMAN='${DNSTAPMAN}'
DNSTAPHTML='${DNSTAPHTML}'