Adding upstream version 2.3.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-04-21 09:31:24 +02:00
parent 3e5f1e46ff
commit 27bed00e23
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
101 changed files with 2349 additions and 847 deletions

View file

@ -1,6 +1,6 @@
DNSCAP
Copyright (c) 2016-2024 OARC, Inc.
Copyright (c) 2016-2025 OARC, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without

View file

@ -266,6 +266,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -25,7 +25,6 @@ Issues should be reported here:
General support and discussion:
- Mattermost: https://chat.dns-oarc.net/community/channels/oarc-software
- mailing-list: https://lists.dns-oarc.net/mailman/listinfo/dnscap-users
## Dependencies
@ -125,6 +124,7 @@ $ env CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure
- `anonaes128.so`: Anonymize IP addresses using AES128
- `anonmask.so`: Pseudo-anonymize IP addresses by masking them
- `asudp.so`: Rewrites outgoing packet, takes the DNS and constructs UDP packets, can be used together with layers and reassembling/defrag'ing packets
- `cryptopan.so`: Anonymize IP addresses using an extension to Crypto-PAn (College of Computing, Georgia Tech) made by David Stott (Lucent)
- `cryptopant.so`: Anonymize IP addresses using cryptopANT, a different implementation of Crypto-PAn made by the ANT project at USC/ISI
- `ipcrypt.so`: Anonymize IP addresses using ipcrypt create by Jean-Philippe Aumasson

90
aclocal.m4 vendored
View file

@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
@ -108,7 +108,7 @@ dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl only at the first occurrence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
@ -177,14 +177,14 @@ if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
@ -196,7 +196,7 @@ _PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
@ -206,10 +206,10 @@ _PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
@ -296,6 +296,74 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------
dnl
dnl Prepare a "--with-" configure option using the lowercase
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
dnl PKG_CHECK_MODULES in a single macro.
AC_DEFUN([PKG_WITH_MODULES],
[
m4_pushdef([with_arg], m4_tolower([$1]))
m4_pushdef([description],
[m4_default([$5], [build with ]with_arg[ support])])
m4_pushdef([def_arg], [m4_default([$6], [auto])])
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
m4_case(def_arg,
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
[m4_pushdef([with_without],[--with-]with_arg)])
AC_ARG_WITH(with_arg,
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
[AS_TR_SH([with_]with_arg)=def_arg])
AS_CASE([$AS_TR_SH([with_]with_arg)],
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
[auto],[PKG_CHECK_MODULES([$1],[$2],
[m4_n([def_action_if_found]) $3],
[m4_n([def_action_if_not_found]) $4])])
m4_popdef([with_arg])
m4_popdef([description])
m4_popdef([def_arg])
])dnl PKG_WITH_MODULES
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl -----------------------------------------------
dnl
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
dnl check._[VARIABLE-PREFIX] is exported as make variable.
AC_DEFUN([PKG_HAVE_WITH_MODULES],
[
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
AM_CONDITIONAL([HAVE_][$1],
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
])dnl PKG_HAVE_WITH_MODULES
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------------------
dnl
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
dnl and preprocessor variable.
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
[
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
])dnl PKG_HAVE_DEFINE_WITH_MODULES
# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation

404
configure vendored
View file

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for dnscap 2.2.1.
# Generated by GNU Autoconf 2.71 for dnscap 2.3.0.
#
# Report bugs to <dnscap-users@dns-oarc.net>.
#
@ -621,8 +621,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dnscap'
PACKAGE_TARNAME='dnscap'
PACKAGE_VERSION='2.2.1'
PACKAGE_STRING='dnscap 2.2.1'
PACKAGE_VERSION='2.3.0'
PACKAGE_STRING='dnscap 2.3.0'
PACKAGE_BUGREPORT='dnscap-users@dns-oarc.net'
PACKAGE_URL='https://github.com/DNS-OARC/dnscap/issues'
@ -690,6 +690,7 @@ MANIFEST_TOOL
RANLIB
DLLTOOL
OBJDUMP
FILECMD
LN_S
NM
ac_ct_DUMPBIN
@ -1381,7 +1382,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures dnscap 2.2.1 to adapt to many kinds of systems.
\`configure' configures dnscap 2.3.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1452,7 +1453,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of dnscap 2.2.1:";;
short | recursive ) echo "Configuration of dnscap 2.3.0:";;
esac
cat <<\_ACEOF
@ -1585,7 +1586,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
dnscap configure 2.2.1
dnscap configure 2.3.0
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@ -1898,7 +1899,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by dnscap $as_me 2.2.1, which was
It was created by dnscap $as_me 2.3.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@ -3168,7 +3169,7 @@ fi
# Define the identity of the package.
PACKAGE='dnscap'
VERSION='2.2.1'
VERSION='2.3.0'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@ -4795,8 +4796,8 @@ esac
macro_version='2.4.6'
macro_revision='2.4.6'
macro_version='2.4.7'
macro_revision='2.4.7'
@ -5349,13 +5350,13 @@ else
mingw*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
*$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break 2
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break 2
@ -5493,7 +5494,7 @@ esac
fi
fi
case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols -headers"
;;
@ -5597,7 +5598,7 @@ else $as_nop
lt_cv_sys_max_cmd_len=8192;
;;
bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@ -5640,7 +5641,7 @@ else $as_nop
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
@ -5845,6 +5846,114 @@ esac
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args.
set dummy ${ac_tool_prefix}file; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_FILECMD+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$FILECMD"; then
ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_FILECMD="${ac_tool_prefix}file"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
FILECMD=$ac_cv_prog_FILECMD
if test -n "$FILECMD"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5
printf "%s\n" "$FILECMD" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_FILECMD"; then
ac_ct_FILECMD=$FILECMD
# Extract the first word of "file", so it can be a program name with args.
set dummy file; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_FILECMD+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$ac_ct_FILECMD"; then
ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_FILECMD="file"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD
if test -n "$ac_ct_FILECMD"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5
printf "%s\n" "$ac_ct_FILECMD" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_FILECMD" = x; then
FILECMD=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
FILECMD=$ac_ct_FILECMD
fi
else
FILECMD="$ac_cv_prog_FILECMD"
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; ac_word=$2
@ -5988,7 +6097,7 @@ beos*)
bsdi[45]*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_cmd='$FILECMD -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@ -6022,14 +6131,14 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
freebsd* | dragonfly*)
freebsd* | dragonfly* | midnightbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@ -6043,7 +6152,7 @@ haiku*)
;;
hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_cmd=$FILECMD
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
@ -6090,7 +6199,7 @@ netbsd* | netbsdelf*-gnu)
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
@ -6463,13 +6572,29 @@ esac
fi
: ${AR=ar}
: ${AR_FLAGS=cr}
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
# higher priority because thats what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
lt_ar_flags=$AR_FLAGS
# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
@ -6886,7 +7011,7 @@ esac
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Gets list of data symbols to import.
lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
# Adjust the below global symbol transforms to fixup imported variables.
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
@ -6904,20 +7029,20 @@ fi
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
lt_cv_sys_global_symbol_to_cdecl="sed -n"\
lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
$lt_cdecl_hook\
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
$lt_c_name_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
# Transform an extracted symbol line into symbol name with lib prefix and
# symbol address.
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
$lt_c_name_lib_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
@ -6941,7 +7066,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++,
# Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\
@ -6959,9 +7084,9 @@ for ac_symprfx in "" "_"; do
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx"
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@ -7161,7 +7286,7 @@ case $with_sysroot in #(
fi
;; #(
/*)
lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
@ -7286,7 +7411,7 @@ ia64-*-hpux*)
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE=32
;;
@ -7307,7 +7432,7 @@ ia64-*-hpux*)
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
if test yes = "$lt_cv_prog_gnu_ld"; then
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
@ -7319,7 +7444,7 @@ ia64-*-hpux*)
;;
esac
else
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@ -7345,7 +7470,7 @@ mips64*-*linux*)
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
emul=elf
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*32-bit*)
emul="${emul}32"
;;
@ -7353,7 +7478,7 @@ mips64*-*linux*)
emul="${emul}64"
;;
esac
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*MSB*)
emul="${emul}btsmip"
;;
@ -7361,7 +7486,7 @@ mips64*-*linux*)
emul="${emul}ltsmip"
;;
esac
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*N32*)
emul="${emul}n32"
;;
@ -7385,14 +7510,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
case `/usr/bin/file conftest.o` in
case `$FILECMD conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
case `/usr/bin/file conftest.o` in
case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
;;
@ -7500,7 +7625,7 @@ printf "%s\n" "$lt_cv_cc_needs_belf" >&6; }
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
case `/usr/bin/file conftest.o` in
case `$FILECMD conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*)
@ -8283,8 +8408,8 @@ int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
echo "$AR cr libconftest.a conftest.o" >&5
$AR cr libconftest.a conftest.o 2>&5
echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5
$AR $AR_FLAGS libconftest.a conftest.o 2>&5
echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF
@ -8311,17 +8436,12 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; }
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
darwin*) # darwin 5.x on
# if running on 10.5 or later, the deployment target defaults
# to the OS version, if on x86, and 10.4, the deployment
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[912]*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10.[012][,.]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10.*|11.*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
darwin*)
case $MACOSX_DEPLOYMENT_TARGET,$host in
10.[012],*|,*powerpc*-darwin[5-8]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
@ -8708,8 +8828,8 @@ esac
ofile=libtool
can_build_shared=yes
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
# All known linkers require a '.a' archive for static linking (except MSVC and
# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
@ -9227,7 +9347,7 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
case `$CC -V 2>&1 | $SED 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
lt_prog_compiler_pic='-KPIC'
@ -9650,15 +9770,15 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
openbsd* | bitrig*)
@ -9713,7 +9833,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries
whole_archive_flag_spec=
fi
supports_anon_versioning=no
case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@ -9825,6 +9945,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
file_list_spec='@'
;;
interix[3-9]*)
@ -9839,7 +9960,7 @@ _LT_EOF
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
@ -9882,7 +10003,7 @@ _LT_EOF
compiler_needs_object=yes
;;
esac
case `$CC -V 2>&1 | sed 5q` in
case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*) # Sun C 5.9
whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
compiler_needs_object=yes
@ -9894,13 +10015,14 @@ _LT_EOF
if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
tcc*)
hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
export_dynamic_flag_spec='-rdynamic'
;;
xlf* | bgf* | bgxlf* | mpixlf*)
@ -9910,7 +10032,7 @@ _LT_EOF
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
@ -10042,7 +10164,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@ -10313,12 +10435,12 @@ fi
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
cl*)
# Native MSVC
cl* | icl*)
# Native MSVC or ICC
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
always_export_symbols=yes
@ -10359,7 +10481,7 @@ fi
fi'
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
# Tell ltmain to make .lib files, not .a files.
@ -10400,8 +10522,8 @@ fi
output_verbose_link_cmd=func_echo_all
archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
else
ld_shlibs=no
@ -10435,7 +10557,7 @@ fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
freebsd* | dragonfly* | midnightbsd*)
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@ -10616,6 +10738,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
# Fabrice Bellard et al's Tiny C Compiler
ld_shlibs=yes
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
;;
esac
;;
@ -10687,6 +10810,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
file_list_spec='@'
;;
osf3*)
@ -11379,7 +11503,7 @@ cygwin* | mingw* | pw32* | cegcc*)
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
;;
@ -11389,14 +11513,14 @@ cygwin* | mingw* | pw32* | cegcc*)
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
esac
dynamic_linker='Win32 ld.exe'
;;
*,cl*)
# Native MSVC
*,cl* | *,icl*)
# Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
@ -11415,7 +11539,7 @@ cygwin* | mingw* | pw32* | cegcc*)
done
IFS=$lt_save_ifs
# Convert to MSYS style.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
@ -11452,7 +11576,7 @@ cygwin* | mingw* | pw32* | cegcc*)
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@ -11485,7 +11609,7 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
freebsd* | dragonfly*)
freebsd* | dragonfly* | midnightbsd*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
@ -12650,30 +12774,41 @@ striplib=
old_striplib=
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
printf %s "checking whether stripping libraries is possible... " >&6; }
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
if test -z "$STRIP"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
if test -n "$STRIP"; then
if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
case $host_os in
darwin*)
# FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x"
old_striplib="$STRIP -S"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
;;
freebsd*)
if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
;;
*)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
;;
*)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
;;
esac
;;
esac
fi
fi
@ -14337,14 +14472,14 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
libcrypto_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcrypto" 2>&1`
libcrypto_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcrypto" 2>&1`
else
libcrypto_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcrypto" 2>&1`
libcrypto_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcrypto" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$libcrypto_PKG_ERRORS" >&5
# Put the nasty error message in config.log where it belongs
echo "$libcrypto_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (libcrypto) were not met:
as_fn_error $? "Package requirements (libcrypto) were not met:
$libcrypto_PKG_ERRORS
@ -14357,7 +14492,7 @@ See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
@ -14370,8 +14505,8 @@ See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
else
libcrypto_CFLAGS=$pkg_cv_libcrypto_CFLAGS
libcrypto_LIBS=$pkg_cv_libcrypto_LIBS
libcrypto_CFLAGS=$pkg_cv_libcrypto_CFLAGS
libcrypto_LIBS=$pkg_cv_libcrypto_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
@ -14519,12 +14654,12 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
libldns_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libldns" 2>&1`
libldns_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libldns" 2>&1`
else
libldns_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libldns" 2>&1`
libldns_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libldns" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$libldns_PKG_ERRORS" >&5
# Put the nasty error message in config.log where it belongs
echo "$libldns_PKG_ERRORS" >&5
@ -14579,14 +14714,14 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
libldns_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ldns" 2>&1`
libldns_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ldns" 2>&1`
else
libldns_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ldns" 2>&1`
libldns_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ldns" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$libldns_PKG_ERRORS" >&5
# Put the nasty error message in config.log where it belongs
echo "$libldns_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (ldns) were not met:
as_fn_error $? "Package requirements (ldns) were not met:
$libldns_PKG_ERRORS
@ -14599,7 +14734,7 @@ See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
@ -14612,8 +14747,8 @@ See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
else
libldns_CFLAGS=$pkg_cv_libldns_CFLAGS
libldns_LIBS=$pkg_cv_libldns_LIBS
libldns_CFLAGS=$pkg_cv_libldns_CFLAGS
libldns_LIBS=$pkg_cv_libldns_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
@ -14675,14 +14810,14 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
libldns_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ldns" 2>&1`
libldns_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ldns" 2>&1`
else
libldns_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ldns" 2>&1`
libldns_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ldns" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$libldns_PKG_ERRORS" >&5
# Put the nasty error message in config.log where it belongs
echo "$libldns_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (ldns) were not met:
as_fn_error $? "Package requirements (ldns) were not met:
$libldns_PKG_ERRORS
@ -14695,7 +14830,7 @@ See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
@ -14708,16 +14843,16 @@ See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
else
libldns_CFLAGS=$pkg_cv_libldns_CFLAGS
libldns_LIBS=$pkg_cv_libldns_LIBS
libldns_CFLAGS=$pkg_cv_libldns_CFLAGS
libldns_LIBS=$pkg_cv_libldns_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
fi
else
libldns_CFLAGS=$pkg_cv_libldns_CFLAGS
libldns_LIBS=$pkg_cv_libldns_LIBS
libldns_CFLAGS=$pkg_cv_libldns_CFLAGS
libldns_LIBS=$pkg_cv_libldns_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
@ -15296,7 +15431,7 @@ SECCOMPFLAGS="$SECCOMPFLAGS"
# Output Makefiles
ac_config_files="$ac_config_files Makefile src/Makefile src/test/Makefile plugins/Makefile plugins/pcapdump/Makefile plugins/rssm/Makefile plugins/txtout/Makefile plugins/rzkeychange/Makefile plugins/royparse/Makefile plugins/anonmask/Makefile plugins/ipcrypt/Makefile plugins/anonaes128/Makefile plugins/cryptopan/Makefile plugins/cryptopant/Makefile plugins/eventlog/Makefile"
ac_config_files="$ac_config_files Makefile src/Makefile src/test/Makefile plugins/Makefile plugins/pcapdump/Makefile plugins/rssm/Makefile plugins/txtout/Makefile plugins/rzkeychange/Makefile plugins/royparse/Makefile plugins/anonmask/Makefile plugins/ipcrypt/Makefile plugins/anonaes128/Makefile plugins/cryptopan/Makefile plugins/cryptopant/Makefile plugins/eventlog/Makefile plugins/asudp/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -15829,7 +15964,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by dnscap $as_me 2.2.1, which was
This file was extended by dnscap $as_me 2.3.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -15898,7 +16033,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
dnscap config.status 2.2.1
dnscap config.status 2.3.0
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
@ -16061,6 +16196,7 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q
lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`'
OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
@ -16069,6 +16205,7 @@ want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`'
AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
@ -16189,6 +16326,7 @@ LN_S \
lt_SP2NL \
lt_NL2SP \
reload_flag \
FILECMD \
OBJDUMP \
deplibs_check_method \
file_magic_cmd \
@ -16197,7 +16335,6 @@ want_nocaseglob \
DLLTOOL \
sharedlib_from_linklib_cmd \
AR \
AR_FLAGS \
archiver_list_spec \
STRIP \
RANLIB \
@ -16328,6 +16465,7 @@ do
"plugins/cryptopan/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/cryptopan/Makefile" ;;
"plugins/cryptopant/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/cryptopant/Makefile" ;;
"plugins/eventlog/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/eventlog/Makefile" ;;
"plugins/asudp/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/asudp/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
@ -17153,6 +17291,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd
# convert \$build files to toolchain format.
to_tool_file_cmd=$lt_cv_to_tool_file_cmd
# A file(cmd) program that detects file types.
FILECMD=$lt_FILECMD
# An object symbol dumper.
OBJDUMP=$lt_OBJDUMP
@ -17177,8 +17318,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
# The archiver.
AR=$lt_AR
# Flags to create an archive (by configure).
lt_ar_flags=$lt_ar_flags
# Flags to create an archive.
AR_FLAGS=$lt_AR_FLAGS
AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"}
# How to feed a file listing to the archiver.
archiver_list_spec=$lt_archiver_list_spec
@ -17554,7 +17698,7 @@ ltmain=$ac_aux_dir/ltmain.sh
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
sed '$q' "$ltmain" >> "$cfgfile" \
$SED '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
mv -f "$cfgfile" "$ofile" ||

View file

@ -1,4 +1,4 @@
# Copyright (c) 2016-2024 OARC, Inc.
# Copyright (c) 2016-2025 OARC, Inc.
# Copyright (c) 2007, The Measurement Factory, Inc.
# Copyright (c) 2007, Internet Systems Consortium, Inc.
# All rights reserved.
@ -33,7 +33,7 @@
# POSSIBILITY OF SUCH DAMAGE.
AC_PREREQ(2.61)
AC_INIT([dnscap], [2.2.1], [dnscap-users@dns-oarc.net], [dnscap], [https://github.com/DNS-OARC/dnscap/issues])
AC_INIT([dnscap], [2.3.0], [dnscap-users@dns-oarc.net], [dnscap], [https://github.com/DNS-OARC/dnscap/issues])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CONFIG_SRCDIR([src/dnscap.c])
AC_CONFIG_HEADER([src/config.h])
@ -143,7 +143,7 @@ AC_SUBST(SECCOMPFLAGS, ["$SECCOMPFLAGS"])
AC_CONFIG_FILES([
Makefile
src/Makefile
src/test/Makefile
src/test/Makefile
plugins/Makefile
plugins/pcapdump/Makefile
plugins/rssm/Makefile
@ -152,9 +152,10 @@ AC_CONFIG_FILES([
plugins/royparse/Makefile
plugins/anonmask/Makefile
plugins/ipcrypt/Makefile
plugins/anonaes128/Makefile
plugins/cryptopan/Makefile
plugins/anonaes128/Makefile
plugins/cryptopan/Makefile
plugins/cryptopant/Makefile
plugins/eventlog/Makefile
plugins/asudp/Makefile
])
AC_OUTPUT

855
ltmain.sh

File diff suppressed because it is too large Load diff

229
m4/libtool.m4 vendored
View file

@ -1,6 +1,7 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@ -31,7 +32,7 @@ m4_define([_LT_COPYING], [dnl
# along with this program. If not, see <http://www.gnu.org/licenses/>.
])
# serial 58 LT_INIT
# serial 59 LT_INIT
# LT_PREREQ(VERSION)
@ -181,6 +182,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
m4_require([_LT_CMD_RELOAD])dnl
m4_require([_LT_DECL_FILECMD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
@ -219,8 +221,8 @@ esac
ofile=libtool
can_build_shared=yes
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
# All known linkers require a '.a' archive for static linking (except MSVC and
# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
@ -777,7 +779,7 @@ _LT_EOF
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
sed '$q' "$ltmain" >> "$cfgfile" \
$SED '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
mv -f "$cfgfile" "$ofile" ||
@ -1041,8 +1043,8 @@ int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
echo "$AR cr libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
$AR cr libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
$AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF
@ -1066,17 +1068,12 @@ _LT_EOF
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
darwin*) # darwin 5.x on
# if running on 10.5 or later, the deployment target defaults
# to the OS version, if on x86, and 10.4, the deployment
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[[912]]*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10.[[012]][[,.]]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10.*|11.*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
darwin*)
case $MACOSX_DEPLOYMENT_TARGET,$host in
10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
@ -1125,12 +1122,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
output_verbose_link_cmd=func_echo_all
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
_LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
_LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
m4_if([$1], [CXX],
[ if test yes != "$lt_cv_apple_cc_single_mod"; then
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi
],[])
else
@ -1244,7 +1241,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
# _LT_WITH_SYSROOT
# ----------------
AC_DEFUN([_LT_WITH_SYSROOT],
[AC_MSG_CHECKING([for sysroot])
[m4_require([_LT_DECL_SED])dnl
AC_MSG_CHECKING([for sysroot])
AC_ARG_WITH([sysroot],
[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
[Search for dependent libraries within DIR (or the compiler's sysroot
@ -1261,7 +1259,7 @@ case $with_sysroot in #(
fi
;; #(
/*)
lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
@ -1291,7 +1289,7 @@ ia64-*-hpux*)
# options accordingly.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE=32
;;
@ -1308,7 +1306,7 @@ ia64-*-hpux*)
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
if test yes = "$lt_cv_prog_gnu_ld"; then
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
@ -1320,7 +1318,7 @@ ia64-*-hpux*)
;;
esac
else
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@ -1342,7 +1340,7 @@ mips64*-*linux*)
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
emul=elf
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*32-bit*)
emul="${emul}32"
;;
@ -1350,7 +1348,7 @@ mips64*-*linux*)
emul="${emul}64"
;;
esac
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*MSB*)
emul="${emul}btsmip"
;;
@ -1358,7 +1356,7 @@ mips64*-*linux*)
emul="${emul}ltsmip"
;;
esac
case `/usr/bin/file conftest.$ac_objext` in
case `$FILECMD conftest.$ac_objext` in
*N32*)
emul="${emul}n32"
;;
@ -1378,14 +1376,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# not appear in the list.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
case `$FILECMD conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
case `/usr/bin/file conftest.o` in
case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
;;
@ -1453,7 +1451,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# options accordingly.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
case `$FILECMD conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*)
@ -1492,9 +1490,22 @@ need_locks=$enable_libtool_lock
m4_defun([_LT_PROG_AR],
[AC_CHECK_TOOLS(AR, [ar], false)
: ${AR=ar}
: ${AR_FLAGS=cr}
_LT_DECL([], [AR], [1], [The archiver])
_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
# higher priority because thats what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
lt_ar_flags=$AR_FLAGS
_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
[Flags to create an archive])
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
[lt_cv_ar_at_file=no
@ -1713,7 +1724,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=8192;
;;
bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@ -1756,7 +1767,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
@ -2206,26 +2217,35 @@ m4_defun([_LT_CMD_STRIPLIB],
striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
if test -z "$STRIP"; then
AC_MSG_RESULT([no])
else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
if test -n "$STRIP"; then
if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else
case $host_os in
darwin*)
# FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x"
old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
else
;;
freebsd*)
if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
;;
*)
AC_MSG_RESULT([no])
fi
;;
*)
AC_MSG_RESULT([no])
;;
esac
;;
esac
fi
fi
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
_LT_DECL([], [striplib], [1])
@ -2548,7 +2568,7 @@ cygwin* | mingw* | pw32* | cegcc*)
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;;
@ -2558,14 +2578,14 @@ m4_if([$1], [],[
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
esac
dynamic_linker='Win32 ld.exe'
;;
*,cl*)
# Native MSVC
*,cl* | *,icl*)
# Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
@ -2584,7 +2604,7 @@ m4_if([$1], [],[
done
IFS=$lt_save_ifs
# Convert to MSYS style.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
@ -2621,7 +2641,7 @@ m4_if([$1], [],[
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@ -2654,7 +2674,7 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
freebsd* | dragonfly*)
freebsd* | dragonfly* | midnightbsd*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
@ -3465,7 +3485,7 @@ beos*)
bsdi[[45]]*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_cmd='$FILECMD -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@ -3499,14 +3519,14 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
freebsd* | dragonfly*)
freebsd* | dragonfly* | midnightbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@ -3520,7 +3540,7 @@ haiku*)
;;
hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_cmd=$FILECMD
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
@ -3567,7 +3587,7 @@ netbsd* | netbsdelf*-gnu)
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
@ -3694,13 +3714,13 @@ else
mingw*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
*$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break 2
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break 2
@ -3726,7 +3746,7 @@ else
# Let the user override the test.
else
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols -headers"
;;
@ -3966,7 +3986,7 @@ esac
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Gets list of data symbols to import.
lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
# Adjust the below global symbol transforms to fixup imported variables.
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
@ -3984,20 +4004,20 @@ fi
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
lt_cv_sys_global_symbol_to_cdecl="sed -n"\
lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
$lt_cdecl_hook\
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
$lt_c_name_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
# Transform an extracted symbol line into symbol name with lib prefix and
# symbol address.
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
$lt_c_name_lib_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
@ -4021,7 +4041,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++,
# Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
@ -4039,9 +4059,9 @@ for ac_symprfx in "" "_"; do
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx]"
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@ -4329,7 +4349,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
freebsd* | dragonfly*)
freebsd* | dragonfly* | midnightbsd*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@ -4412,7 +4432,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@ -4754,7 +4774,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
case `$CC -V 2>&1 | $SED 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@ -4937,7 +4957,7 @@ m4_if([$1], [CXX], [
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
@ -4945,7 +4965,7 @@ m4_if([$1], [CXX], [
;;
cygwin* | mingw* | cegcc*)
case $cc_basename in
cl*)
cl* | icl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;;
*)
@ -5005,15 +5025,15 @@ dnl Note also adjust exclude_expsyms for C++ above.
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
openbsd* | bitrig*)
@ -5068,7 +5088,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
supports_anon_versioning=no
case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@ -5180,6 +5200,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
interix[[3-9]]*)
@ -5194,7 +5215,7 @@ _LT_EOF
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
@ -5237,7 +5258,7 @@ _LT_EOF
_LT_TAGVAR(compiler_needs_object, $1)=yes
;;
esac
case `$CC -V 2>&1 | sed 5q` in
case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*) # Sun C 5.9
_LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
@ -5249,13 +5270,14 @@ _LT_EOF
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
tcc*)
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
;;
xlf* | bgf* | bgxlf* | mpixlf*)
@ -5265,7 +5287,7 @@ _LT_EOF
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
@ -5397,7 +5419,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@ -5580,12 +5602,12 @@ _LT_EOF
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
cl*)
# Native MSVC
cl* | icl*)
# Native MSVC or ICC
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
@ -5626,7 +5648,7 @@ _LT_EOF
fi'
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files.
@ -5674,7 +5696,7 @@ _LT_EOF
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
freebsd* | dragonfly* | midnightbsd*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
@ -5815,6 +5837,7 @@ _LT_EOF
# Fabrice Bellard et al's Tiny C Compiler
_LT_TAGVAR(ld_shlibs, $1)=yes
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
esac
;;
@ -5886,6 +5909,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
osf3*)
@ -6656,8 +6680,8 @@ if test yes != "$_lt_caught_CXX_error"; then
cygwin* | mingw* | pw32* | cegcc*)
case $GXX,$cc_basename in
,cl* | no,cl*)
# Native MSVC
,cl* | no,cl* | ,icl* | no,icl*)
# Native MSVC or ICC
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
@ -6755,6 +6779,7 @@ if test yes != "$_lt_caught_CXX_error"; then
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
dgux*)
@ -6785,7 +6810,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
;;
freebsd* | dragonfly*)
freebsd* | dragonfly* | midnightbsd*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
_LT_TAGVAR(ld_shlibs, $1)=yes
@ -6922,7 +6947,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
irix5* | irix6*)
case $cc_basename in
@ -7062,13 +7087,13 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
;;
*)
case `$CC -V 2>&1 | sed 5q` in
case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
@ -8214,6 +8239,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
AC_SUBST([DLLTOOL])
])
# _LT_DECL_FILECMD
# ----------------
# Check for a file(cmd) program that can be used to detect file type and magic
m4_defun([_LT_DECL_FILECMD],
[AC_CHECK_TOOL([FILECMD], [file], [:])
_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
])# _LD_DECL_FILECMD
# _LT_DECL_SED
# ------------
# Check for a fully-functional sed program, that truncates

4
m4/ltoptions.m4 vendored
View file

@ -1,7 +1,7 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
# Foundation, Inc.
# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
# Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives

2
m4/ltsugar.m4 vendored
View file

@ -1,6 +1,6 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#

13
m4/ltversion.m4 vendored
View file

@ -1,6 +1,7 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
# Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
@ -9,15 +10,15 @@
# @configure_input@
# serial 4179 ltversion.m4
# serial 4245 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.6])
m4_define([LT_PACKAGE_REVISION], [2.4.6])
m4_define([LT_PACKAGE_VERSION], [2.4.7])
m4_define([LT_PACKAGE_REVISION], [2.4.7])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.6'
macro_revision='2.4.6'
[macro_version='2.4.7'
macro_revision='2.4.7'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

4
m4/lt~obsolete.m4 vendored
View file

@ -1,7 +1,7 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
# Foundation, Inc.
# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
# Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives

View file

@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
SUBDIRS = pcapdump rssm txtout rzkeychange royparse anonmask ipcrypt \
anonaes128 cryptopan cryptopant eventlog
anonaes128 cryptopan cryptopant eventlog asudp
EXTRA_DIST = template shared

View file

@ -214,6 +214,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@ -319,7 +320,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
SUBDIRS = pcapdump rssm txtout rzkeychange royparse anonmask ipcrypt \
anonaes128 cryptopan cryptopant eventlog
anonaes128 cryptopan cryptopant eventlog asudp
EXTRA_DIST = template shared
all: all-recursive

View file

@ -414,6 +414,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 OARC, Inc.
* Copyright (c) 2018-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -414,6 +414,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 OARC, Inc.
* Copyright (c) 2018-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

21
plugins/asudp/Makefile.am Normal file
View file

@ -0,0 +1,21 @@
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
CLEANFILES = *.gcda *.gcno *.gcov *.pcap-dist test1.out
AM_CFLAGS = -I$(srcdir) \
-I$(top_srcdir)/src \
-I$(top_srcdir)/isc \
$(SECCOMPFLAGS)
pkglib_LTLIBRARIES = asudp.la
asudp_la_SOURCES = asudp.c
asudp_la_LDFLAGS = -module -avoid-version
TESTS = test1.sh
EXTRA_DIST = $(TESTS) test1.gold
if ENABLE_GCOV
gcov-local:
for src in $(asudp_la_SOURCES); do \
gcov -o .libs -l -r -s "$(srcdir)" "$$src"; \
done
endif

1044
plugins/asudp/Makefile.in Normal file

File diff suppressed because it is too large Load diff

173
plugins/asudp/asudp.c Normal file
View file

@ -0,0 +1,173 @@
/*
* Copyright (c) 2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/udp.h>
#include <sys/socket.h>
#include "dnscap_common.h"
enum plugin_type asudp_type()
{
return plugin_filter;
}
void asudp_usage()
{
fprintf(stderr,
"\nasudp.so options:\n"
"\t-T skip packets that would be truncated\n"
"\t-? print these instructions and exit\n");
}
static int skip_truncated = 0;
void asudp_getopt(int* argc, char** argv[])
{
int c;
while ((c = getopt(*argc, *argv, "T?")) != EOF) {
switch (c) {
case 'T':
skip_truncated = 1;
break;
case '?':
asudp_usage();
if (!optopt || optopt == '?') {
exit(0);
}
// fallthrough
default:
exit(1);
}
}
}
static set_output_pkt_t asudp_set_output_pkt = 0;
void asudp_extension(int ext, void* arg)
{
switch (ext) {
case DNSCAP_EXT_SET_OUTPUT_PKT:
asudp_set_output_pkt = (set_output_pkt_t)arg;
break;
}
}
struct _pkt {
union {
struct ip iphdr;
struct ip6_hdr ip6_hdr;
};
struct udphdr updhdr;
uint8_t payload[0xffff];
};
static uint8_t _pkt[sizeof(struct _pkt)];
int asudp_filter(const char* descr, iaddr* from, iaddr* to, uint8_t proto, unsigned flags,
unsigned sport, unsigned dport, my_bpftimeval ts,
u_char* pkt_copy, const unsigned olen,
u_char* payload, const unsigned payloadlen)
{
if (!asudp_set_output_pkt)
return 0;
if (!(flags & DNSCAP_OUTPUT_ISDNS) || !payloadlen) {
return 1;
}
size_t plen = payloadlen;
uint8_t* pkt = _pkt;
switch (from->af) {
case AF_INET: {
if (plen > sizeof(((struct _pkt*)0)->payload) - sizeof(struct ip) - sizeof(struct udphdr)) {
if (skip_truncated)
return 1;
plen = sizeof(((struct _pkt*)0)->payload) - sizeof(struct ip) - sizeof(struct udphdr);
}
struct ip ip = {};
ip.ip_hl = 5;
ip.ip_v = 4;
ip.ip_len = htons(sizeof(struct ip) + sizeof(struct udphdr) + plen);
ip.ip_ttl = 255;
ip.ip_p = IPPROTO_UDP;
ip.ip_src = from->u.a4;
ip.ip_dst = to->u.a4;
memcpy(pkt, &ip, sizeof(struct ip));
pkt += sizeof(struct ip);
break;
}
case AF_INET6: {
if (plen > sizeof(((struct _pkt*)0)->payload) - sizeof(struct ip6_hdr) - sizeof(struct udphdr)) {
if (skip_truncated)
return 1;
plen = sizeof(((struct _pkt*)0)->payload) - sizeof(struct ip6_hdr) - sizeof(struct udphdr);
}
struct ip6_hdr ip6 = {};
ip6.ip6_vfc = 0x60;
ip6.ip6_plen = htons(sizeof(struct udphdr) + plen);
ip6.ip6_nxt = IPPROTO_UDP;
ip6.ip6_src = from->u.a6;
ip6.ip6_dst = to->u.a6;
memcpy(pkt, &ip6, sizeof(struct ip6_hdr));
pkt += sizeof(struct ip6_hdr);
break;
}
default:
return 1;
}
struct udphdr udp = {};
udp.uh_sport = htons(sport);
udp.uh_dport = htons(dport);
udp.uh_ulen = htons(sizeof(struct udphdr) + plen);
memcpy(pkt, &udp, sizeof(struct udphdr));
pkt += sizeof(struct udphdr);
memcpy(pkt, payload, plen);
pkt += plen;
asudp_set_output_pkt(_pkt, pkt - _pkt);
return 0;
}

431
plugins/asudp/test1.gold Normal file
View file

@ -0,0 +1,431 @@
[56] 2018-01-10 11:22:41.552406 [#0 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,59311,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:41.555912 [#1 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,59311,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,58,216.58.211.142 0 0
[73] 2018-01-10 11:22:41.600183 [#2 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,35665,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:41.616460 [#3 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,35665,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:41.659921 [#4 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,5337,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:41.663576 [#5 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,5337,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,58,216.58.211.142 0 0
[56] 2018-01-10 11:22:41.706183 [#6 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,22982,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:41.709680 [#7 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,22982,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,58,216.58.211.142 0 0
[73] 2018-01-10 11:22:41.754101 [#8 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,18718,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:41.757876 [#9 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,18718,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:41.804255 [#10 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,22531,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:41.809483 [#11 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,22531,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,58,216.58.211.142 0 0
[56] 2018-01-10 11:22:41.854113 [#12 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,58510,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:41.857788 [#13 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,58510,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,58,216.58.211.142 0 0
[73] 2018-01-10 11:22:41.902165 [#14 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,45248,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:41.905802 [#15 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,45248,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21599,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:41.950164 [#16 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,49483,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:41.954138 [#17 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,49483,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[56] 2018-01-10 11:22:41.999121 [#18 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,31669,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.002657 [#19 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,31669,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[73] 2018-01-10 11:22:42.047148 [#20 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,25433,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:42.052425 [#21 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,25433,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:42.097899 [#22 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,63798,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.101443 [#23 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,63798,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[73] 2018-01-10 11:22:42.145005 [#24 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,8470,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:42.148639 [#25 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,8470,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:42.192777 [#26 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,60258,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.196256 [#27 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,60258,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[73] 2018-01-10 11:22:42.240395 [#28 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,44985,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:42.245103 [#29 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,44985,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:42.290257 [#30 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,45512,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.293978 [#31 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,45512,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[73] 2018-01-10 11:22:42.337985 [#32 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,22980,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:42.341559 [#33 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,22980,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:42.385009 [#34 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,1834,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.389082 [#35 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,1834,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[73] 2018-01-10 11:22:42.433458 [#36 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,25431,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:42.438748 [#37 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,25431,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:42.484005 [#38 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,48432,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.487697 [#39 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,48432,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[73] 2018-01-10 11:22:42.532414 [#40 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,47411,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:42.537574 [#41 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,47411,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:42.583021 [#42 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,12038,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.586898 [#43 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,12038,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[56] 2018-01-10 11:22:42.630221 [#44 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,11614,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.633808 [#45 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,11614,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[56] 2018-01-10 11:22:42.679168 [#46 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,59173,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.682888 [#47 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,59173,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[56] 2018-01-10 11:22:42.727254 [#48 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,45535,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.732703 [#49 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,45535,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[73] 2018-01-10 11:22:42.777184 [#50 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,60808,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:42.781053 [#51 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,60808,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:42.824222 [#52 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,64325,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.828050 [#53 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,64325,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[73] 2018-01-10 11:22:42.872186 [#54 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,25543,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:42.875911 [#55 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,25543,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21598,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:42.920231 [#56 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,20736,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:42.923917 [#57 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,20736,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,57,216.58.211.142 0 0
[73] 2018-01-10 11:22:42.968961 [#58 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,25911,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:42.972662 [#59 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,25911,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:43.017364 [#60 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,64358,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:43.022591 [#61 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,64358,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,56,216.58.211.142 0 0
[73] 2018-01-10 11:22:43.066765 [#62 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,37698,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:43.070349 [#63 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,37698,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:43.114332 [#64 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,54706,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:43.119538 [#65 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,54706,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,56,216.58.211.142 0 0
[73] 2018-01-10 11:22:43.163857 [#66 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,32142,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:43.167576 [#67 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,32142,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:43.211417 [#68 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,41808,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:43.216686 [#69 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,41808,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,56,216.58.211.142 0 0
[73] 2018-01-10 11:22:43.260995 [#70 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,18886,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:43.265047 [#71 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,18886,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:43.310017 [#72 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,10624,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:43.313596 [#73 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,10624,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,56,216.58.211.142 0 0
[73] 2018-01-10 11:22:43.356802 [#74 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,33139,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:43.360685 [#75 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,33139,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:43.406308 [#76 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,61415,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:43.410191 [#77 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,61415,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,56,216.58.211.142 0 0
[73] 2018-01-10 11:22:43.454193 [#78 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,59258,rd \
1 206.218.58.216.in-addr.arpa.,IN,PTR 0 0 0
[171] 2018-01-10 11:22:43.458191 [#79 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,59258,qr|rd|ra \
1 206.218.58.216.in-addr.arpa.,IN,PTR \
4 206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f206.1e100.net. \
206.218.58.216.in-addr.arpa.,IN,PTR,21597,dfw06s47-in-f14.1e100.net. 0 0
[56] 2018-01-10 11:22:43.503242 [#80 - 4095] \
[172.17.0.8].51388 [8.8.8.8].53 \
dns QUERY,NOERROR,17700,rd \
1 google.com.,IN,A 0 0 0
[72] 2018-01-10 11:22:43.506884 [#81 - 4095] \
[8.8.8.8].53 [172.17.0.8].51388 \
dns QUERY,NOERROR,17700,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,56,216.58.211.142 0 0
[87] 2018-11-27 15:52:00.414188 [#0 - 4095] \
[2a01:3f0:0:57::245].51972 [2001:4860:4860::8888].53 \
dns QUERY,NOERROR,51420,rd|ad \
1 google.com.,IN,A 0 0 \
1 .,4096,4096,0,edns0[len=0,UDP=4096,ver=0,rcode=0,DO=0,z=0]
[103] 2018-11-27 15:52:00.428453 [#1 - 4095] \
[2001:4860:4860::8888].53 [2a01:3f0:0:57::245].51972 \
dns QUERY,NOERROR,51420,qr|rd|ra \
1 google.com.,IN,A \
1 google.com.,IN,A,299,172.217.20.46 0 \
1 .,512,512,0,edns0[len=0,UDP=512,ver=0,rcode=0,DO=0,z=0]

25
plugins/asudp/test1.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh -xe
plugin=`find . -name 'asudp.so' | head -n 1`
if [ -z "$plugin" ]; then
echo "Unable to find the asudp plugin"
exit 1
fi
ln -fs "$srcdir/../../src/test/dns.pcap" dns.pcap-dist
../../src/dnscap -r dns.pcap-dist -g -P "$plugin" -?
#../../src/dnscap -r dns.pcap-dist -g -P "$plugin"
! ../../src/dnscap -r dns.pcap-dist -g -P "$plugin" -X
ln -fs "$srcdir/../../src/test/dnso1tcp.pcap" dnso1tcp.pcap-dist
ln -fs "$srcdir/../../src/test/dns6.pcap" dns6.pcap-dist
../../src/dnscap -T -r dnso1tcp.pcap-dist -w - -P "$plugin" | ../../src/dnscap -r - -g 2>test1.out
../../src/dnscap -T -r dns6.pcap-dist -w - -P "$plugin" | ../../src/dnscap -r - -g 2>>test1.out
mv test1.out test1.out.old
grep -v "^libgcov profiling error:" test1.out.old > test1.out
rm test1.out.old
diff test1.out "$srcdir/test1.gold"

View file

@ -414,6 +414,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 OARC, Inc.
* Copyright (c) 2018-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -414,6 +414,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 OARC, Inc.
* Copyright (c) 2018-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -414,6 +414,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -12,7 +12,7 @@
* Below is the original copyright notice from txtout.c.
*/
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -414,6 +414,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 OARC, Inc.
* Copyright (c) 2018-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -414,6 +414,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -414,6 +414,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,7 +1,7 @@
/*
* Author Roy Arends
*
* Copyright (c) 2017-2024 OARC, Inc.
* Copyright (c) 2017-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -421,6 +421,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
# Copyright (c) 2018-2024 OARC, Inc.
# Copyright (c) 2018-2025 OARC, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without

View file

@ -1,4 +1,4 @@
.\" Copyright (c) 2017-2024 OARC, Inc.
.\" Copyright (c) 2017-2025 OARC, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -415,6 +415,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 OARC, Inc.
* Copyright (c) 2018-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -414,6 +414,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -303,6 +303,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -40,6 +40,7 @@
#include "log.h"
#include "tcpstate.h"
#include "network.h"
#include "dumper.h"
#include <ldns/ldns.h>
@ -504,6 +505,8 @@ void parse_args(int argc, char* argv[])
options.dump_format = cbor;
} else if (!strcmp(optarg, "cds")) {
options.dump_format = cds;
} else if (!strcmp(optarg, "tcpdns")) {
options.dump_format = tcpdns;
} else {
usage("invalid output format for -F");
}
@ -616,11 +619,12 @@ void parse_args(int argc, char* argv[])
snprintf(sn, sizeof(sn), "%s_extension", pl->name);
pl->extension = dlsym(pl->handle, sn);
if (pl->extension) {
(*pl->extension)(DNSCAP_EXT_IS_RESPONDER, (void*)is_responder);
(*pl->extension)(DNSCAP_EXT_IA_STR, (void*)_ia_str);
(*pl->extension)(DNSCAP_EXT_TCPSTATE_GETCURR, (void*)_tcpstate_getcurr);
(*pl->extension)(DNSCAP_EXT_TCPSTATE_RESET, (void*)_tcpstate_reset);
(*pl->extension)(DNSCAP_EXT_SET_IADDR, (void*)set_iaddr);
(*pl->extension)(DNSCAP_EXT_IS_RESPONDER, (is_responder_t)is_responder);
(*pl->extension)(DNSCAP_EXT_IA_STR, (ia_str_t)_ia_str);
(*pl->extension)(DNSCAP_EXT_TCPSTATE_GETCURR, (tcpstate_getcurr_t)_tcpstate_getcurr);
(*pl->extension)(DNSCAP_EXT_TCPSTATE_RESET, (tcpstate_reset_t)_tcpstate_reset);
(*pl->extension)(DNSCAP_EXT_SET_IADDR, (set_iaddr_t)set_iaddr);
(*pl->extension)(DNSCAP_EXT_SET_OUTPUT_PKT, (set_output_pkt_t)set_output_pkt);
}
snprintf(sn, sizeof(sn), "%s_getopt", pl->name);
pl->getopt = dlsym(pl->handle, sn);
@ -692,8 +696,6 @@ void parse_args(int argc, char* argv[])
}
assert(msg_wanted != 0U);
assert(err_wanted != 0U);
if (dump_type != nowhere && options.use_layers)
usage("use_layers is only compatible with -g so far");
if (dump_type == nowhere && !preso && EMPTY(plugins))
usage("without -w or -g, there would be no output");
if (end_hide != 0U && wantfrags)

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,4 +1,4 @@
.\" Copyright (c) 2016-2024 OARC, Inc.
.\" Copyright (c) 2016-2025 OARC, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@ -360,7 +360,7 @@ is used, then
will exit after reaching the limit.
.TP
.BI "\-C " lim
Set a size limit, measured in bytes.
Set a size limit, measured in (uncompressed) bytes.
When writing to a file, the packet dump file will be closed when
.I lim
number of bytes (or larger then) has been written.
@ -734,6 +734,9 @@ Anonymize IP addresses using AES128.
.B anonmask.so
Pseudo\-anonymize IP addresses by masking them.
.TP
.B asudp.so
Rewrites outgoing packet, takes the DNS and constructs UDP packets, can be used together with layers and reassembling/defrag'ing packets.
.TP
.B cryptopan.so
Anonymize IP addresses using an extension to Crypto\-PAn (College of
Computing, Georgia Tech) made by David Stott (Lucent).
@ -785,6 +788,11 @@ for details and below for all extended options related to this format.
.B pcap
This uses the pcap library to output the captured DNS packets. (default)
.TP
.B tcpdns
This format outputs the DNS as a TCP stream, first 16bit size (network order) then the DNS message.
This output is compatible with
.IR "dnsperf -B" .
.TP
.B diagnostic
This is the output produced by
.BR \-g ,
@ -847,6 +855,14 @@ Each DNS record contains the following:
<fqdn>,<class>,<type>[,<ttl>[,<additional information>]]
.EE
Note; comma characters in
.B fqdn
will be quoted with a backslash, for example:
.EX
1 exam\\,ple.com.,IN,A 0 0 0
.EE
Additional information will be displayed for SOA, A, AAAA, MX, NS, PTR,
CNAME and OPT records containing EDNS0.
.SS CBOR

View file

@ -4,7 +4,7 @@
*/
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -85,8 +85,9 @@ unsigned limit_packets = 0U;
size_t limit_pcapfilesize = 0U;
pcap_t* pcap_dead;
pcap_dumper_t* dumper;
FILE* dumper_fp = 0;
time_t dumpstart;
unsigned msgcount;
size_t msgcount = 0;
size_t capturedbytes = 0;
char * dumpname, *dumpnamepart;
char* bpft;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -248,7 +248,7 @@ typedef LIST(struct vlan) vlan_list;
#define MAX_TCP_MSGS 8
#define MAX_TCP_SEGS 8
#define MAX_TCP_HOLES 8
#define MAX_TCP_DNS_MSG 8
#define MAX_TCP_DNS_MSG 200 // based on 1500 MTU / 14 (min-size DNS message) * 2 rounded up
typedef struct tcphole tcphole_t;
typedef struct tcp_msgbuf tcp_msgbuf_t;
@ -412,8 +412,9 @@ extern unsigned limit_packets;
extern size_t limit_pcapfilesize;
extern pcap_t* pcap_dead;
extern pcap_dumper_t* dumper;
extern FILE* dumper_fp;
extern time_t dumpstart;
extern unsigned msgcount;
extern size_t msgcount;
extern size_t capturedbytes;
extern char * dumpname, *dumpnamepart;
extern char* bpft;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -140,6 +140,9 @@ typedef void (*tcpstate_reset_t)(void* tcpstate, const char* msg);
#define DNSCAP_EXT_SET_IADDR 5
typedef void (*set_iaddr_t)(iaddr* from, iaddr* to);
#define DNSCAP_EXT_SET_OUTPUT_PKT 6
typedef void (*set_output_pkt_t)(u_char* pkt, const unsigned olen);
/*
* Flags
*/

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -4,7 +4,7 @@
*/
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -66,7 +66,13 @@ static void dump_dns_rr(ldns_rr* rr, FILE* trace, ldns_buffer* lbuf, bool qsect)
if (ldns_rdf2buffer_str(lbuf, ldns_rr_owner(rr)) != LDNS_STATUS_OK) {
goto error;
}
fprintf(trace, "%s", (char*)ldns_buffer_begin(lbuf));
char* p = (char*)ldns_buffer_begin(lbuf);
for (; *p; p++) {
if (*p == ',') {
fputc('\\', trace);
}
fputc(*p, trace);
}
// class
ldns_buffer_clear(lbuf);

View file

@ -4,7 +4,7 @@
*/
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -38,6 +38,16 @@
#include "iaddr.h"
#include "log.h"
#include "pcaps.h"
#include "args.h"
static u_char* _pkt;
static unsigned _olen;
void set_output_pkt(u_char* pkt, const unsigned olen)
{
_pkt = pkt;
_olen = olen;
}
/*
* when flags & DNSCAP_OUTPUT_ISDNS, payload points to a DNS packet
@ -49,8 +59,11 @@ void output(const char* descr, iaddr from, iaddr to, uint8_t proto, unsigned fla
{
struct plugin* p;
_pkt = pkt_copy;
_olen = olen;
for (p = HEAD(plugins); p != NULL; p = NEXT(p, link)) {
if (p->filter && (*p->filter)(descr, &from, &to, proto, flags, sport, dport, ts, pkt_copy, olen, payload, payloadlen)) {
if (p->filter && (*p->filter)(descr, &from, &to, proto, flags, sport, dport, ts, _pkt, _olen, payload, payloadlen)) {
if (dumptrace >= 3) {
fprintf(stderr, "filtered: capturedbytes=%zu, proto=%d, isfrag=%s, isdns=%s, olen=%u, payloadlen=%u\n",
capturedbytes,
@ -66,6 +79,7 @@ void output(const char* descr, iaddr from, iaddr to, uint8_t proto, unsigned fla
msgcount++;
capturedbytes += olen;
// TODO: += olen is incorrect when receiving multiple DNS messages in a single packet, such as TCP
if (dumptrace >= 3) {
fprintf(stderr, "output: capturedbytes=%zu, proto=%d, isfrag=%s, isdns=%s, olen=%u, payloadlen=%u\n",
@ -93,12 +107,15 @@ void output(const char* descr, iaddr from, iaddr to, uint8_t proto, unsigned fla
}
if (dump_type != nowhere) {
if (options.dump_format == pcap) {
if ((options.use_layers || options.reassemble_tcp) && _pkt == pkt_copy)
usage("use_layers or reassemble_tcp with PCAP output is not supported unless used with plugins that rewrites packets");
struct pcap_pkthdr h;
memset(&h, 0, sizeof h);
h.ts = ts;
h.len = h.caplen = olen;
pcap_dump((u_char*)dumper, &h, pkt_copy);
h.len = h.caplen = _olen;
pcap_dump((u_char*)dumper, &h, _pkt);
if (flush)
pcap_dump_flush(dumper);
} else if (options.dump_format == cbor && (flags & DNSCAP_OUTPUT_ISDNS) && payload) {
@ -118,7 +135,7 @@ void output(const char* descr, iaddr from, iaddr to, uint8_t proto, unsigned fla
exit(1);
}
} else if (options.dump_format == cds) {
int ret = output_cds(from, to, proto, flags, sport, dport, ts, pkt_copy, olen, payload, payloadlen);
int ret = output_cds(from, to, proto, flags, sport, dport, ts, _pkt, _olen, payload, payloadlen);
if (ret == DUMP_CDS_FLUSH) {
if (dumper_close(ts)) {
@ -133,11 +150,27 @@ void output(const char* descr, iaddr from, iaddr to, uint8_t proto, unsigned fla
fprintf(stderr, "%s: output to cds failed [%u]\n", ProgramName, ret);
exit(1);
}
} else if (options.dump_format == tcpdns) {
if ((flags & DNSCAP_OUTPUT_ISDNS) && payload && payloadlen > 0) {
uint16_t len = htons(payloadlen);
if (fwrite(&len, 1, 2, dumper_fp) != 2
|| fwrite(payload, 1, payloadlen, dumper_fp) != payloadlen) {
fprintf(stderr, "%s: output to tcpdns failed: %s\n", ProgramName, strerror(errno));
exit(1);
}
// readjust captured bytes
capturedbytes -= olen;
capturedbytes += 2 + payloadlen;
} else {
// readjust msgcount
msgcount--;
}
}
}
for (p = HEAD(plugins); p != NULL; p = NEXT(p, link))
if (p->output)
(*p->output)(descr, from, to, proto, flags, sport, dport, ts, pkt_copy, olen, payload, payloadlen);
(*p->output)(descr, from, to, proto, flags, sport, dport, ts, _pkt, _olen, payload, payloadlen);
return;
}
@ -165,9 +198,9 @@ int dumper_open(my_bpftimeval ts)
gmtime_r((time_t*)&ts.tv_sec, &tm);
strftime(sbuf, 64, "%Y%m%d.%H%M%S", &tm);
if (asprintf(&dumpname, "%s.%s.%06lu%s",
if (asprintf(&dumpname, "%s.%s.%06ld%s",
dump_base, sbuf,
(u_long)ts.tv_usec, dump_suffix ? dump_suffix : "")
ts.tv_usec, dump_suffix ? dump_suffix : "")
< 0
|| asprintf(&dumpnamepart, "%s.part", dumpname) < 0) {
logerr("asprintf: %s", strerror(errno));
@ -183,6 +216,20 @@ int dumper_open(my_bpftimeval ts)
pcap_geterr(pcap_dead));
return (TRUE);
}
} else if (options.dump_format == tcpdns) {
if (wantgzip) {
dnscap_dump_open_gz(t, &dumper_fp);
} else {
if (!strncmp(t, "-", 1)) {
dumper_fp = fdopen(1, "w");
} else {
dumper_fp = fopen(t, "w");
}
}
if (dumper_fp == NULL) {
logerr("dump fopen: %s", strerror(errno));
return (TRUE);
}
}
}
dumpstart = ts.tv_sec;
@ -284,6 +331,11 @@ int dumper_close(my_bpftimeval ts)
exit(1);
}
}
} else if (options.dump_format == tcpdns) {
if (dumper_fp) {
fclose(dumper_fp);
dumper_fp = 0;
}
}
if (dump_type == to_stdout) {
@ -355,23 +407,22 @@ gzip_cookie_close(void* cookie)
}
#endif /* HAVE_ZLIB_H */
pcap_dumper_t* dnscap_pcap_dump_open(pcap_t* pcap, const char* path)
void dnscap_dump_open_gz(const char* path, FILE** fp)
{
#if HAVE_ZLIB_H
#if HAVE_GZOPEN
if (wantgzip) {
FILE* fp = NULL;
gzFile z = gzopen(path, "w");
gzFile z = gzopen(path, "w");
if (z == NULL) {
perror("gzopen");
return NULL;
return;
}
#if HAVE_FUNOPEN
fp = funopen(z, NULL, gzip_cookie_write, NULL, gzip_cookie_close);
if (fp == NULL) {
*fp = funopen(z, NULL, gzip_cookie_write, NULL, gzip_cookie_close);
if (*fp == NULL) {
perror("funopen");
return NULL;
return;
}
#elif HAVE_FOPENCOOKIE
{
@ -379,17 +430,32 @@ pcap_dumper_t* dnscap_pcap_dump_open(pcap_t* pcap, const char* path)
NULL, gzip_cookie_write, NULL, gzip_cookie_close
};
fp = fopencookie(z, "w", cookiefuncs);
if (fp == NULL) {
*fp = fopencookie(z, "w", cookiefuncs);
if (*fp == NULL) {
perror("fopencookie");
return NULL;
return;
}
}
#endif
return pcap_dump_fopen(pcap, fp);
return;
}
#endif /* HAVE_GZOPEN */
#endif /* HAVE_ZLIB_H */
*fp = 0;
return;
}
pcap_dumper_t* dnscap_pcap_dump_open(pcap_t* pcap, const char* path)
{
if (wantgzip) {
FILE* fp = 0;
dnscap_dump_open_gz(path, &fp);
if (!fp) {
return NULL;
}
return pcap_dump_fopen(pcap, fp);
}
return pcap_dump_open(pcap, path);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -37,6 +37,8 @@
#ifndef __dnscap_dumper_h
#define __dnscap_dumper_h
void set_output_pkt(u_char* pkt, const unsigned olen);
void output(const char* descr, iaddr from, iaddr to, uint8_t proto, unsigned flags,
unsigned sport, unsigned dport, my_bpftimeval ts,
u_char* pkt_copy, const unsigned olen,
@ -45,6 +47,7 @@ void output(const char* descr, iaddr from, iaddr to, uint8_t proto, unsigned fla
int dumper_open(my_bpftimeval ts);
int dumper_close(my_bpftimeval ts);
void dnscap_dump_open_gz(const char* path, FILE** fp);
pcap_dumper_t* dnscap_pcap_dump_open(pcap_t* pcap, const char* path);
#endif /* __dnscap_dumper_h */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -196,21 +196,31 @@ void layer_pkt(u_char* user, const pcap_thread_packet_t* packet, const u_char* p
gmtime_r(&t, &tm);
strftime(when, sizeof(when), "%Y-%m-%d %T", &tm);
if (packet->have_iphdr && !options.defrag_ipv4) {
if (len > packet->iphdr.ip_len) {
len = packet->iphdr.ip_len;
}
} else if (packet->have_ip6hdr && !options.defrag_ipv6) {
if (len > 40 + packet->ip6hdr.ip6_plen) {
len = 40 + packet->ip6hdr.ip6_plen;
}
}
if (vlan != MAX_VLAN) {
snprintf(descr, sizeof(descr), "[%lu] %s.%06lu [#%ld %s (vlan %u) %u] \\\n",
(u_long)len,
snprintf(descr, sizeof(descr), "[%zu] %s.%06ld [#%zd %s (vlan %u) %u] \\\n",
len,
when,
(u_long)firstpkt->pkthdr.ts.tv_usec,
(long)msgcount,
firstpkt->pkthdr.ts.tv_usec,
msgcount,
mypcap->name ? mypcap->name : "\"some interface\"",
vlan,
vlan);
} else {
snprintf(descr, sizeof(descr), "[%lu] %s.%06lu [#%ld %s %u] \\\n",
(u_long)len,
snprintf(descr, sizeof(descr), "[%zu] %s.%06ld [#%zd %s %u] \\\n",
len,
when,
(u_long)firstpkt->pkthdr.ts.tv_usec,
(long)msgcount,
firstpkt->pkthdr.ts.tv_usec,
msgcount,
mypcap->name ? mypcap->name : "\"some interface\"",
vlan);
}
@ -229,7 +239,7 @@ void layer_pkt(u_char* user, const pcap_thread_packet_t* packet, const u_char* p
network_pkt2(descr, firstpkt->pkthdr.ts, packet, payload, length);
if (limit_packets != 0U && msgcount == limit_packets) {
if (limit_packets != 0U && msgcount >= limit_packets) {
if (preso)
goto breakloop;
if (dumper_opened == dump_state && dumper_close(firstpkt->pkthdr.ts))
@ -356,6 +366,16 @@ void dl_pkt(u_char* user, const struct pcap_pkthdr* hdr, const u_char* pkt, cons
len -= 16;
break;
}
#endif
#ifdef DLT_LINUX_SLL2
case DLT_LINUX_SLL2: {
if (len < 20)
return;
etype = _need16(&pkt[0]);
pkt += 20;
len -= 20;
break;
}
#endif
default:
return;
@ -417,8 +437,8 @@ void dl_pkt(u_char* user, const struct pcap_pkthdr* hdr, const u_char* pkt, cons
} else {
viap = "\"some interface\"";
}
snprintf(descr, sizeof(descr), "[%lu] %s.%06lu [#%ld %s %u] \\\n",
(u_long)len, when, (u_long)hdr->ts.tv_usec, (long)msgcount, viap, vlan);
snprintf(descr, sizeof(descr), "[%zu] %s.%06ld [#%zu %s %u] \\\n",
len, when, hdr->ts.tv_usec, msgcount, viap, vlan);
} else {
descr[0] = '\0';
}
@ -436,7 +456,7 @@ void dl_pkt(u_char* user, const struct pcap_pkthdr* hdr, const u_char* pkt, cons
network_pkt(descr, hdr->ts, pf, pkt, len);
if (limit_packets != 0U && msgcount == limit_packets) {
if (limit_packets != 0U && msgcount >= limit_packets) {
if (preso)
goto breakloop;
if (dumper_opened == dump_state && dumper_close(hdr->ts))
@ -705,11 +725,11 @@ void network_pkt2(const char* descr, my_bpftimeval ts, const pcap_thread_packet_
tcpstate = tcpstate_find(from, to, sport, dport, ts.tv_sec);
if (dumptrace >= 3) {
fprintf(stderr, "%s: tcp pkt: %lu.%06lu [%4lu] %15s -> ",
fprintf(stderr, "%s: tcp pkt: %" PRIdMAX ".%06ld [%4zu] %15s -> ",
ProgramName,
(u_long)ts.tv_sec,
(u_long)ts.tv_usec,
(u_long)len,
(intmax_t)ts.tv_sec,
ts.tv_usec,
len,
ia_str(from));
fprintf(stderr, "%15s; ", ia_str(to));
@ -753,7 +773,7 @@ void network_pkt2(const char* descr, my_bpftimeval ts, const pcap_thread_packet_
fprintf(stderr, "warning: recycling state for "
"duplicate tcp stream after only %ld "
"seconds idle\n",
(u_long)(ts.tv_sec - tcpstate->last_use));
ts.tv_sec - tcpstate->last_use);
*/
}
} else {
@ -1089,6 +1109,7 @@ void network_pkt(const char* descr, my_bpftimeval ts, unsigned pf,
struct ip* ip;
size_t len, dnslen = 0;
HEADER dns;
char descr_[512];
if (dumptrace >= 4)
fprintf(stderr, "processing %s packet: len=%zu\n", (pf == PF_INET ? "IPv4" : (pf == PF_INET6 ? "IPv6" : "unknown")), olen);
@ -1118,8 +1139,16 @@ void network_pkt(const char* descr, my_bpftimeval ts, unsigned pf,
to.af = AF_INET;
memcpy(&to.u.a4, &ip->ip_dst, sizeof(struct in_addr));
offset = ip->ip_hl << 2;
if (len > ntohs(ip->ip_len)) /* small IP packets have L2 padding */
if (len > ntohs(ip->ip_len)) {
/* IP packets have L2 padding */
olen -= len - ntohs(ip->ip_len); // remove ether frame padding
if (preso) {
// rewrite descr
snprintf(descr_, sizeof(descr_), "[%zu]%s", olen, strchr(descr, ' '));
descr = descr_;
}
len = ntohs(ip->ip_len);
}
if (len <= (size_t)offset)
goto network_pkt_end;
pkt += offset;
@ -1151,6 +1180,16 @@ void network_pkt(const char* descr, my_bpftimeval ts, unsigned pf,
offset = sizeof(struct ip6_hdr);
payload_len = ntohs(ipv6->ip6_plen);
if (len > sizeof(*ipv6) + payload_len) {
/* IP packets have L2 padding */
olen -= len - sizeof(*ipv6) - payload_len; // remove ether frame padding
if (preso) {
// rewrite descr
snprintf(descr_, sizeof(descr_), "[%zu]%s", olen, strchr(descr, ' '));
descr = descr_;
}
}
memset(&from, 0, sizeof from);
from.af = AF_INET6;
memcpy(&from.u.a6, &ipv6->ip6_src, sizeof(struct in6_addr));
@ -1288,8 +1327,8 @@ void network_pkt(const char* descr, my_bpftimeval ts, unsigned pf,
tcpstate = tcpstate_find(from, to, sport, dport, ts.tv_sec);
if (dumptrace >= 3) {
fprintf(stderr, "%s: tcp pkt: %lu.%06lu [%4lu] ", ProgramName,
(u_long)ts.tv_sec, (u_long)ts.tv_usec, (u_long)len);
fprintf(stderr, "%s: tcp pkt: %" PRIdMAX ".%06ld [%4zu] ", ProgramName,
(intmax_t)ts.tv_sec, ts.tv_usec, len);
fprintf(stderr, "%15s -> ", ia_str(from));
fprintf(stderr, "%15s; ", ia_str(to));
if (tcpstate)
@ -1325,7 +1364,7 @@ void network_pkt(const char* descr, my_bpftimeval ts, unsigned pf,
fprintf(stderr, "warning: recycling state for "
"duplicate tcp stream after only %ld "
"seconds idle\n",
(u_long)(ts.tv_sec - tcpstate->last_use));
ts.tv_sec - tcpstate->last_use);
}
#endif
} else {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -137,6 +137,9 @@ int option_parse(options_t* options, const char* option)
} else if (!strcmp(argument, "cds")) {
options->dump_format = cds;
return 0;
} else if (!strcmp(argument, "tcpdns")) {
options->dump_format = tcpdns;
return 0;
}
} else if (have("user")) {
if (options->user) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -43,7 +43,8 @@ typedef enum dump_format dump_format_t;
enum dump_format {
pcap,
cbor,
cds
cds,
tcpdns
};
/* clang-format off */

View file

@ -1,6 +1,6 @@
/*
* Author Jerry Lundström <jerry@dns-oarc.net>
* Copyright (c) 2016-2017, OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -52,6 +52,7 @@
static void pcap_thread_callback(u_char* user, const struct pcap_pkthdr* pkthdr, const u_char* pkt, const char* name, int dlt);
static void pcap_thread_callback_linux_sll(u_char* user, pcap_thread_packet_t* packet, const u_char* payload, size_t length);
static void pcap_thread_callback_linux_sll2(u_char* user, pcap_thread_packet_t* packet, const u_char* payload, size_t length);
static void pcap_thread_callback_ether(u_char* user, pcap_thread_packet_t* packet, const u_char* payload, size_t length);
static void pcap_thread_callback_null(u_char* user, pcap_thread_packet_t* packet, const u_char* payload, size_t length);
static void pcap_thread_callback_loop(u_char* user, pcap_thread_packet_t* packet, const u_char* payload, size_t length);
@ -719,7 +720,8 @@ int pcap_thread_set_callback_linux_sll(pcap_thread_t* pcap_thread, pcap_thread_l
if (!pcap_thread) {
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_ether
if (pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
|| pcap_thread->callback_ieee802
@ -742,12 +744,42 @@ int pcap_thread_set_callback_linux_sll(pcap_thread_t* pcap_thread, pcap_thread_l
return PCAP_THREAD_OK;
}
int pcap_thread_set_callback_linux_sll2(pcap_thread_t* pcap_thread, pcap_thread_layer_callback_t callback_linux_sll2)
{
if (!pcap_thread) {
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
|| pcap_thread->callback_ieee802
|| pcap_thread->callback_gre
|| pcap_thread->callback_ip
|| pcap_thread->callback_ipv4
|| pcap_thread->callback_ipv6
|| pcap_thread->callback_icmp
|| pcap_thread->callback_icmpv6
|| pcap_thread->callback_udp
|| pcap_thread->callback_tcp) {
return PCAP_THREAD_ELAYERCB;
}
if (pcap_thread->running) {
return PCAP_THREAD_ERUNNING;
}
pcap_thread->callback_linux_sll2 = callback_linux_sll2;
return PCAP_THREAD_OK;
}
int pcap_thread_set_callback_ether(pcap_thread_t* pcap_thread, pcap_thread_layer_callback_t callback_ether)
{
if (!pcap_thread) {
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
|| pcap_thread->callback_ieee802
@ -776,6 +808,7 @@ int pcap_thread_set_callback_null(pcap_thread_t* pcap_thread, pcap_thread_layer_
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_loop
|| pcap_thread->callback_ieee802
@ -804,6 +837,7 @@ int pcap_thread_set_callback_loop(pcap_thread_t* pcap_thread, pcap_thread_layer_
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_ieee802
@ -832,6 +866,7 @@ int pcap_thread_set_callback_ieee802(pcap_thread_t* pcap_thread, pcap_thread_lay
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
@ -860,6 +895,7 @@ int pcap_thread_set_callback_gre(pcap_thread_t* pcap_thread, pcap_thread_layer_c
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
@ -888,6 +924,7 @@ int pcap_thread_set_callback_ip(pcap_thread_t* pcap_thread, pcap_thread_layer_ca
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
@ -916,6 +953,7 @@ int pcap_thread_set_callback_ipv4(pcap_thread_t* pcap_thread, pcap_thread_layer_
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
@ -968,6 +1006,7 @@ int pcap_thread_set_callback_ipv6(pcap_thread_t* pcap_thread, pcap_thread_layer_
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
@ -1020,6 +1059,7 @@ int pcap_thread_set_callback_icmp(pcap_thread_t* pcap_thread, pcap_thread_layer_
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
@ -1045,6 +1085,7 @@ int pcap_thread_set_callback_icmpv6(pcap_thread_t* pcap_thread, pcap_thread_laye
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
@ -1070,6 +1111,7 @@ int pcap_thread_set_callback_udp(pcap_thread_t* pcap_thread, pcap_thread_layer_c
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
@ -1095,6 +1137,7 @@ int pcap_thread_set_callback_tcp(pcap_thread_t* pcap_thread, pcap_thread_layer_c
return PCAP_THREAD_EINVAL;
}
if (pcap_thread->callback_linux_sll
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
@ -1232,9 +1275,9 @@ static void pcap_thread_callback(u_char* user, const struct pcap_pkthdr* pkthdr,
packet.state = PCAP_THREAD_PACKET_OK;
/*
* The header for null is in host byte order but may not be
* in the same endian as host if coming from a savefile
*/
* The header for null is in host byte order but may not be
* in the same endian as host if coming from a savefile
*/
if (pcaplist->is_offline && pcap_is_swapped(pcaplist->pcap)) {
#if __BYTE_ORDER == __LITTLE_ENDIAN
@ -1322,7 +1365,26 @@ static void pcap_thread_callback(u_char* user, const struct pcap_pkthdr* pkthdr,
pcap_thread_callback_linux_sll((void*)pcaplist, &packet, pkt, length);
return;
/* TODO: These might be interesting to implement
case DLT_LINUX_SLL2:
layer_trace("dlt_linux_sll2");
packet.state = PCAP_THREAD_PACKET_INVALID_LINUX_SLL2;
need16(packet.linux_sll2.protocol_type, pkt, length);
need16(packet.linux_sll2.reserved, pkt, length);
need32(packet.linux_sll2.interface_index, pkt, length);
need16(packet.linux_sll2.arphrd_type, pkt, length);
need8(packet.linux_sll2.packet_type, pkt, length);
need8(packet.linux_sll2.link_layer_address_length, pkt, length);
needxb(packet.linux_sll2.link_layer_address, 8, pkt, length);
packet.state = PCAP_THREAD_PACKET_OK;
packet.have_linux_sll2 = 1;
if (pcaplist->pcap_thread->callback_linux_sll2)
pcaplist->pcap_thread->callback_linux_sll2(pcaplist->user, &packet, pkt, length);
else
pcap_thread_callback_linux_sll2((void*)pcaplist, &packet, pkt, length);
return;
/* TODO: These might be interesting to implement
case DLT_IPNET:
case DLT_PKTAP:
*/
@ -1410,6 +1472,77 @@ static void pcap_thread_callback_linux_sll(u_char* user, pcap_thread_packet_t* p
}
}
static void pcap_thread_callback_linux_sll2(u_char* user, pcap_thread_packet_t* packet, const u_char* payload, size_t length)
{
pcap_thread_pcaplist_t* pcaplist = (pcap_thread_pcaplist_t*)user;
const u_char* orig = payload;
size_t origlength = length;
if (!pcaplist) {
return;
}
if (!pcaplist->pcap_thread) {
return;
}
if (!packet) {
return;
}
if (!payload) {
return;
}
if (!length) {
return;
}
if (packet->have_linux_sll2) {
layer_trace("have_linux_sll2");
switch (packet->linux_sll2.protocol_type) {
case 0x8100: /* 802.1q */
case 0x88a8: /* 802.1ad */
case 0x9100: /* 802.1 QinQ non-standard */
if (packet->have_ieee802hdr)
break;
{
uint16_t tci;
packet->state = PCAP_THREAD_PACKET_INVALID_IEEE802;
need16(tci, payload, length);
packet->ieee802hdr.pcp = (tci & 0xe000) >> 13;
packet->ieee802hdr.dei = (tci & 0x1000) >> 12;
packet->ieee802hdr.vid = tci & 0x0fff;
need16(packet->ieee802hdr.ether_type, payload, length);
packet->state = PCAP_THREAD_PACKET_OK;
packet->have_ieee802hdr = 1;
}
if (pcaplist->pcap_thread->callback_ieee802)
pcaplist->pcap_thread->callback_ieee802(pcaplist->user, packet, payload, length);
else
pcap_thread_callback_ieee802((void*)pcaplist, packet, payload, length);
return;
case ETHERTYPE_IP:
case ETHERTYPE_IPV6:
if (pcaplist->pcap_thread->callback_ip)
pcaplist->pcap_thread->callback_ip(pcaplist->user, packet, payload, length);
else
pcap_thread_callback_ip((void*)pcaplist, packet, payload, length);
return;
default:
packet->state = PCAP_THREAD_PACKET_UNSUPPORTED;
break;
}
}
if (pcaplist->pcap_thread->callback_invalid) {
if (packet->state == PCAP_THREAD_PACKET_OK)
packet->state = PCAP_THREAD_PACKET_INVALID;
pcaplist->pcap_thread->callback_invalid(pcaplist->user, packet, orig, origlength);
}
}
static void pcap_thread_callback_ether(u_char* user, pcap_thread_packet_t* packet, const u_char* payload, size_t length)
{
pcap_thread_pcaplist_t* pcaplist = (pcap_thread_pcaplist_t*)user;
@ -3206,7 +3339,7 @@ static void* _thread(void* vp)
while (pcaplist->running) {
pthread_testcancel();
ret = pcap_loop(pcaplist->pcap, -1, _callback, (u_char*)pcaplist);
if (ret == -1) {
if (ret == PCAP_ERROR) {
/* TODO: Store pcap_loop() error */
break;
}
@ -3244,6 +3377,12 @@ static void _callback2(u_char* user, const struct pcap_pkthdr* pkthdr, const u_c
} else {
pcaplist->running = 0;
}
if (pcaplist->timedrun
&& (pkthdr->ts.tv_sec > pcaplist->end.tv_sec
|| (pkthdr->ts.tv_sec == pcaplist->end.tv_sec && (pkthdr->ts.tv_usec * 1000) >= pcaplist->end.tv_nsec))) {
pcap_breakloop(pcaplist->pcap);
}
}
int pcap_thread_run(pcap_thread_t* pcap_thread)
@ -3264,18 +3403,19 @@ int pcap_thread_run(pcap_thread_t* pcap_thread)
}
if (pcap_thread->use_layers
&& !(pcap_thread->callback_linux_sll
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
|| pcap_thread->callback_ieee802
|| pcap_thread->callback_gre
|| pcap_thread->callback_ip
|| pcap_thread->callback_ipv4
|| pcap_thread->callback_ipv6
|| pcap_thread->callback_icmp
|| pcap_thread->callback_icmpv6
|| pcap_thread->callback_udp
|| pcap_thread->callback_tcp)) {
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
|| pcap_thread->callback_ieee802
|| pcap_thread->callback_gre
|| pcap_thread->callback_ip
|| pcap_thread->callback_ipv4
|| pcap_thread->callback_ipv6
|| pcap_thread->callback_icmp
|| pcap_thread->callback_icmpv6
|| pcap_thread->callback_udp
|| pcap_thread->callback_tcp)) {
return PCAP_THREAD_NOCALLBACK;
}
if (pcap_thread->running) {
@ -3529,7 +3669,9 @@ int pcap_thread_run(pcap_thread_t* pcap_thread)
pcaplist->ipv6_frag_ctx = pcap_thread->callback_ipv6_frag.new(pcap_thread->callback_ipv6_frag.conf, pcaplist->user);
pcaplist->have_ipv6_frag_ctx = 1;
}
pcaplist->running = 1;
pcaplist->running = 1;
pcaplist->timedrun = timedrun;
pcaplist->end = end;
}
t1.tv_sec = pcap_thread->timeout / 1000;
@ -3590,12 +3732,13 @@ int pcap_thread_run(pcap_thread_t* pcap_thread)
}
packets = pcap_dispatch(pcaplist->pcap, -1, _callback2, (u_char*)pcaplist);
if (packets == -1) {
if (packets == PCAP_ERROR) {
pcap_thread->status = -1;
PCAP_THREAD_SET_ERRBUF(pcap_thread, "pcap_dispatch()");
pcap_thread->running = 0;
return PCAP_THREAD_EPCAP;
} else if (packets == -2 || (pcaplist->is_offline && !packets)) {
}
if (pcaplist->is_offline && !packets) {
pcaplist->running = 0;
}
}
@ -3620,18 +3763,19 @@ int pcap_thread_next(pcap_thread_t* pcap_thread)
}
if (pcap_thread->use_layers
&& !(pcap_thread->callback_linux_sll
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
|| pcap_thread->callback_ieee802
|| pcap_thread->callback_gre
|| pcap_thread->callback_ip
|| pcap_thread->callback_ipv4
|| pcap_thread->callback_ipv6
|| pcap_thread->callback_icmp
|| pcap_thread->callback_icmpv6
|| pcap_thread->callback_udp
|| pcap_thread->callback_tcp)) {
|| pcap_thread->callback_linux_sll2
|| pcap_thread->callback_ether
|| pcap_thread->callback_null
|| pcap_thread->callback_loop
|| pcap_thread->callback_ieee802
|| pcap_thread->callback_gre
|| pcap_thread->callback_ip
|| pcap_thread->callback_ipv4
|| pcap_thread->callback_ipv6
|| pcap_thread->callback_icmp
|| pcap_thread->callback_icmpv6
|| pcap_thread->callback_udp
|| pcap_thread->callback_tcp)) {
return PCAP_THREAD_NOCALLBACK;
}
if (pcap_thread->running) {

View file

@ -1,6 +1,6 @@
/*
* Author Jerry Lundström <jerry@dns-oarc.net>
* Copyright (c) 2016-2017, OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -105,9 +105,9 @@ extern "C" {
/* clang-format off */
#define PCAP_THREAD_VERSION_STR "4.0.0"
#define PCAP_THREAD_VERSION_STR "4.1.0"
#define PCAP_THREAD_VERSION_MAJOR 4
#define PCAP_THREAD_VERSION_MINOR 0
#define PCAP_THREAD_VERSION_MINOR 1
#define PCAP_THREAD_VERSION_PATCH 0
#define PCAP_THREAD_DEFAULT_TIMEOUT 1000
@ -155,6 +155,15 @@ struct pcap_thread_linux_sll {
uint8_t link_layer_address[8];
uint16_t ether_type;
};
struct pcap_thread_linux_sll2 {
uint16_t protocol_type;
uint16_t reserved;
uint32_t interface_index;
uint16_t arphrd_type;
uint8_t packet_type;
uint8_t link_layer_address_length;
uint8_t link_layer_address[8];
};
struct pcap_thread_null_hdr {
uint32_t family;
};
@ -205,7 +214,8 @@ enum pcap_thread_packet_state {
PCAP_THREAD_PACKET_FRAGMENTED_ICMPHDR,
PCAP_THREAD_PACKET_FRAGMENTED_ICMPV6HDR,
PCAP_THREAD_PACKET_FRAGMENTED_UDPHDR,
PCAP_THREAD_PACKET_FRAGMENTED_TCPHDR
PCAP_THREAD_PACKET_FRAGMENTED_TCPHDR,
PCAP_THREAD_PACKET_INVALID_LINUX_SLL2
};
typedef struct pcap_thread_packet pcap_thread_packet_t;
@ -213,6 +223,7 @@ struct pcap_thread_packet {
unsigned short have_prevpkt : 1;
unsigned short have_pkthdr : 1;
unsigned short have_linux_sll : 1;
unsigned short have_linux_sll2 : 1;
unsigned short have_ethhdr : 1;
unsigned short have_nullhdr : 1;
unsigned short have_loophdr : 1;
@ -236,6 +247,7 @@ struct pcap_thread_packet {
pcap_thread_packet_t* prevpkt;
struct pcap_pkthdr pkthdr;
struct pcap_thread_linux_sll linux_sll;
struct pcap_thread_linux_sll2 linux_sll2;
struct ether_header ethhdr;
struct pcap_thread_null_hdr nullhdr;
struct pcap_thread_loop_hdr loophdr;
@ -410,7 +422,7 @@ struct pcap_thread_layer_callback_frag {
0, "", 0, 0, \
{ 0, 0 }, { 0, 0 }, \
PCAP_THREAD_DEFAULT_ACTIVATE_MODE, \
0, 0, 0, 0, 0, 0, 0, 0, PCAP_THREAD_LAYER_CALLBACK_FRAG_T_INIT, 0, PCAP_THREAD_LAYER_CALLBACK_FRAG_T_INIT, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, PCAP_THREAD_LAYER_CALLBACK_FRAG_T_INIT, 0, PCAP_THREAD_LAYER_CALLBACK_FRAG_T_INIT, 0, 0, 0, 0, \
0 \
}
/* clang-format on */
@ -475,6 +487,7 @@ struct pcap_thread {
pcap_thread_activate_mode_t activate_mode;
pcap_thread_layer_callback_t callback_linux_sll;
pcap_thread_layer_callback_t callback_linux_sll2;
pcap_thread_layer_callback_t callback_ether;
pcap_thread_layer_callback_t callback_null;
pcap_thread_layer_callback_t callback_loop;
@ -509,6 +522,7 @@ struct pcap_thread {
PCAP_THREAD_PCAPLIST_T_INIT_THREAD \
{ 0, 0 }, \
0, \
0, { 0, 0 } \
}
/* clang-format on */
@ -535,6 +549,9 @@ struct pcap_thread_pcaplist {
struct bpf_program bpf;
pcap_thread_callback_t layer_callback;
int timedrun;
struct timespec end;
};
const char* pcap_thread_version_str(void);
@ -544,62 +561,63 @@ int pcap_thread_version_minor(void);
int pcap_thread_version_patch(void);
pcap_thread_t* pcap_thread_create(void);
void pcap_thread_free(pcap_thread_t* pcap_thread);
void pcap_thread_free(pcap_thread_t* pcap_thread);
int pcap_thread_use_threads(const pcap_thread_t* pcap_thread);
int pcap_thread_set_use_threads(pcap_thread_t* pcap_thread, const int use_threads);
int pcap_thread_use_layers(const pcap_thread_t* pcap_thread);
int pcap_thread_set_use_layers(pcap_thread_t* pcap_thread, const int use_layers);
pcap_thread_queue_mode_t pcap_thread_queue_mode(const pcap_thread_t* pcap_thread);
int pcap_thread_set_queue_mode(pcap_thread_t* pcap_thread, const pcap_thread_queue_mode_t queue_mode);
struct timeval pcap_thread_queue_wait(const pcap_thread_t* pcap_thread);
int pcap_thread_set_queue_wait(pcap_thread_t* pcap_thread, const struct timeval queue_wait);
pcap_thread_queue_mode_t pcap_thread_callback_queue_mode(const pcap_thread_t* pcap_thread);
int pcap_thread_set_callback_queue_mode(pcap_thread_t* pcap_thread, const pcap_thread_queue_mode_t callback_queue_mode);
struct timeval pcap_thread_callback_queue_wait(const pcap_thread_t* pcap_thread);
int pcap_thread_set_callback_queue_wait(pcap_thread_t* pcap_thread, const struct timeval callback_queue_wait);
int pcap_thread_snapshot(const pcap_thread_t* pcap_thread);
int pcap_thread_snaplen(const pcap_thread_t* pcap_thread);
int pcap_thread_set_snaplen(pcap_thread_t* pcap_thread, const int snaplen);
int pcap_thread_promiscuous(const pcap_thread_t* pcap_thread);
int pcap_thread_set_promiscuous(pcap_thread_t* pcap_thread, const int promiscuous);
int pcap_thread_monitor(const pcap_thread_t* pcap_thread);
int pcap_thread_set_monitor(pcap_thread_t* pcap_thread, const int monitor);
int pcap_thread_timeout(const pcap_thread_t* pcap_thread);
int pcap_thread_set_timeout(pcap_thread_t* pcap_thread, const int timeout);
int pcap_thread_buffer_size(const pcap_thread_t* pcap_thread);
int pcap_thread_set_buffer_size(pcap_thread_t* pcap_thread, const int buffer_size);
int pcap_thread_timestamp_type(const pcap_thread_t* pcap_thread);
int pcap_thread_set_timestamp_type(pcap_thread_t* pcap_thread, const int timestamp_type);
int pcap_thread_timestamp_precision(const pcap_thread_t* pcap_thread);
int pcap_thread_set_timestamp_precision(pcap_thread_t* pcap_thread, const int timestamp_precision);
int pcap_thread_immediate_mode(const pcap_thread_t* pcap_thread);
int pcap_thread_set_immediate_mode(pcap_thread_t* pcap_thread, const int immediate_mode);
pcap_direction_t pcap_thread_direction(const pcap_thread_t* pcap_thread);
int pcap_thread_set_direction(pcap_thread_t* pcap_thread, const pcap_direction_t direction);
const char* pcap_thread_filter(const pcap_thread_t* pcap_thread);
int pcap_thread_set_filter(pcap_thread_t* pcap_thread, const char* filter, const size_t filter_len);
int pcap_thread_clear_filter(pcap_thread_t* pcap_thread);
int pcap_thread_filter_errno(const pcap_thread_t* pcap_thread);
int pcap_thread_filter_optimize(const pcap_thread_t* pcap_thread);
int pcap_thread_set_filter_optimize(pcap_thread_t* pcap_thread, const int filter_optimize);
bpf_u_int32 pcap_thread_filter_netmask(const pcap_thread_t* pcap_thread);
int pcap_thread_set_filter_netmask(pcap_thread_t* pcap_thread, const bpf_u_int32 filter_netmask);
struct timeval pcap_thread_timedrun(const pcap_thread_t* pcap_thread);
int pcap_thread_set_timedrun(pcap_thread_t* pcap_thread, const struct timeval timedrun);
struct timeval pcap_thread_timedrun_to(const pcap_thread_t* pcap_thread);
int pcap_thread_set_timedrun_to(pcap_thread_t* pcap_thread, const struct timeval timedrun_to);
int pcap_thread_use_threads(const pcap_thread_t* pcap_thread);
int pcap_thread_set_use_threads(pcap_thread_t* pcap_thread, const int use_threads);
int pcap_thread_use_layers(const pcap_thread_t* pcap_thread);
int pcap_thread_set_use_layers(pcap_thread_t* pcap_thread, const int use_layers);
pcap_thread_queue_mode_t pcap_thread_queue_mode(const pcap_thread_t* pcap_thread);
int pcap_thread_set_queue_mode(pcap_thread_t* pcap_thread, const pcap_thread_queue_mode_t queue_mode);
struct timeval pcap_thread_queue_wait(const pcap_thread_t* pcap_thread);
int pcap_thread_set_queue_wait(pcap_thread_t* pcap_thread, const struct timeval queue_wait);
pcap_thread_queue_mode_t pcap_thread_callback_queue_mode(const pcap_thread_t* pcap_thread);
int pcap_thread_set_callback_queue_mode(pcap_thread_t* pcap_thread, const pcap_thread_queue_mode_t callback_queue_mode);
struct timeval pcap_thread_callback_queue_wait(const pcap_thread_t* pcap_thread);
int pcap_thread_set_callback_queue_wait(pcap_thread_t* pcap_thread, const struct timeval callback_queue_wait);
int pcap_thread_snapshot(const pcap_thread_t* pcap_thread);
int pcap_thread_snaplen(const pcap_thread_t* pcap_thread);
int pcap_thread_set_snaplen(pcap_thread_t* pcap_thread, const int snaplen);
int pcap_thread_promiscuous(const pcap_thread_t* pcap_thread);
int pcap_thread_set_promiscuous(pcap_thread_t* pcap_thread, const int promiscuous);
int pcap_thread_monitor(const pcap_thread_t* pcap_thread);
int pcap_thread_set_monitor(pcap_thread_t* pcap_thread, const int monitor);
int pcap_thread_timeout(const pcap_thread_t* pcap_thread);
int pcap_thread_set_timeout(pcap_thread_t* pcap_thread, const int timeout);
int pcap_thread_buffer_size(const pcap_thread_t* pcap_thread);
int pcap_thread_set_buffer_size(pcap_thread_t* pcap_thread, const int buffer_size);
int pcap_thread_timestamp_type(const pcap_thread_t* pcap_thread);
int pcap_thread_set_timestamp_type(pcap_thread_t* pcap_thread, const int timestamp_type);
int pcap_thread_timestamp_precision(const pcap_thread_t* pcap_thread);
int pcap_thread_set_timestamp_precision(pcap_thread_t* pcap_thread, const int timestamp_precision);
int pcap_thread_immediate_mode(const pcap_thread_t* pcap_thread);
int pcap_thread_set_immediate_mode(pcap_thread_t* pcap_thread, const int immediate_mode);
pcap_direction_t pcap_thread_direction(const pcap_thread_t* pcap_thread);
int pcap_thread_set_direction(pcap_thread_t* pcap_thread, const pcap_direction_t direction);
const char* pcap_thread_filter(const pcap_thread_t* pcap_thread);
int pcap_thread_set_filter(pcap_thread_t* pcap_thread, const char* filter, const size_t filter_len);
int pcap_thread_clear_filter(pcap_thread_t* pcap_thread);
int pcap_thread_filter_errno(const pcap_thread_t* pcap_thread);
int pcap_thread_filter_optimize(const pcap_thread_t* pcap_thread);
int pcap_thread_set_filter_optimize(pcap_thread_t* pcap_thread, const int filter_optimize);
bpf_u_int32 pcap_thread_filter_netmask(const pcap_thread_t* pcap_thread);
int pcap_thread_set_filter_netmask(pcap_thread_t* pcap_thread, const bpf_u_int32 filter_netmask);
struct timeval pcap_thread_timedrun(const pcap_thread_t* pcap_thread);
int pcap_thread_set_timedrun(pcap_thread_t* pcap_thread, const struct timeval timedrun);
struct timeval pcap_thread_timedrun_to(const pcap_thread_t* pcap_thread);
int pcap_thread_set_timedrun_to(pcap_thread_t* pcap_thread, const struct timeval timedrun_to);
pcap_thread_activate_mode_t pcap_thread_activate_mode(const pcap_thread_t* pcap_thread);
int pcap_thread_set_activate_mode(pcap_thread_t* pcap_thread, const pcap_thread_activate_mode_t activate_mode);
int pcap_thread_was_stopped(const pcap_thread_t* pcap_thread);
int pcap_thread_set_activate_mode(pcap_thread_t* pcap_thread, const pcap_thread_activate_mode_t activate_mode);
int pcap_thread_was_stopped(const pcap_thread_t* pcap_thread);
size_t pcap_thread_queue_size(const pcap_thread_t* pcap_thread);
int pcap_thread_set_queue_size(pcap_thread_t* pcap_thread, const size_t queue_size);
int pcap_thread_set_queue_size(pcap_thread_t* pcap_thread, const size_t queue_size);
int pcap_thread_set_callback(pcap_thread_t* pcap_thread, pcap_thread_callback_t callback);
int pcap_thread_set_dropback(pcap_thread_t* pcap_thread, pcap_thread_callback_t dropback);
int pcap_thread_set_callback_linux_sll(pcap_thread_t* pcap_thread, pcap_thread_layer_callback_t callback_linux_sll);
int pcap_thread_set_callback_linux_sll2(pcap_thread_t* pcap_thread, pcap_thread_layer_callback_t callback_linux_sll2);
int pcap_thread_set_callback_ether(pcap_thread_t* pcap_thread, pcap_thread_layer_callback_t callback_ether);
int pcap_thread_set_callback_null(pcap_thread_t* pcap_thread, pcap_thread_layer_callback_t callback_null);
int pcap_thread_set_callback_loop(pcap_thread_t* pcap_thread, pcap_thread_layer_callback_t callback_loop);
@ -629,7 +647,7 @@ int pcap_thread_stop(pcap_thread_t* pcap_thread);
int pcap_thread_stats(pcap_thread_t* pcap_thread, pcap_thread_stats_callback_t callback, u_char* user);
int pcap_thread_status(const pcap_thread_t* pcap_thread);
int pcap_thread_status(const pcap_thread_t* pcap_thread);
const char* pcap_thread_errbuf(const pcap_thread_t* pcap_thread);
const char* pcap_thread_strerr(int error);

View file

@ -1,6 +1,6 @@
/*
* Author Jerry Lundström <jerry@dns-oarc.net>
* Copyright (c) 2016-2017, OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -51,10 +51,10 @@
* Forward declares for callbacks
*/
static void* pcap_thread_layer_callback_frag_new(void* conf, u_char* user);
static void pcap_thread_layer_callback_frag_free(void* _ctx);
static void* pcap_thread_layer_callback_frag_new(void* conf, u_char* user);
static void pcap_thread_layer_callback_frag_free(void* _ctx);
static pcap_thread_packet_state_t pcap_thread_layer_callback_frag_reassemble(void* _ctx, const pcap_thread_packet_t* packet, const u_char* payload, size_t length, pcap_thread_packet_t** whole_packet, const u_char** whole_payload, size_t* whole_length);
static void pcap_thread_layer_callback_frag_release(void* _ctx, const pcap_thread_packet_t* packet, const u_char* payload, size_t length);
static void pcap_thread_layer_callback_frag_release(void* _ctx, const pcap_thread_packet_t* packet, const u_char* payload, size_t length);
/*
* Create/Free
@ -509,7 +509,7 @@ static pcap_thread_packet_state_t reassemble(_ctx_t* ctx, const pcap_thread_pack
break;
case PCAP_THREAD_EXT_FRAG_REASSEMBLE_RFC815:
/* TODO:
*/
*/
break;
case PCAP_THREAD_EXT_FRAG_REASSEMBLE_BSD:
for (f_prev = 0, f = frags->fragments; f; f_prev = f, f = f->next) {
@ -599,7 +599,7 @@ static pcap_thread_packet_state_t reassemble_ipv4(_ctx_t* ctx, const pcap_thread
ts.tv_usec %= 1000000;
if (packet->pkthdr.ts.tv_sec > ts.tv_sec
|| (packet->pkthdr.ts.tv_sec == ts.tv_sec
&& packet->pkthdr.ts.tv_usec > ts.tv_usec)) {
&& packet->pkthdr.ts.tv_usec > ts.tv_usec)) {
pcap_thread_ext_frag_fragment_t* f;
@ -695,7 +695,7 @@ static pcap_thread_packet_state_t reassemble_ipv6(_ctx_t* ctx, const pcap_thread
&& packet->ip6frag.ip6f_ident == frags->packet.ip6frag.ip6f_ident
&& !memcmp(&(packet->ip6hdr.ip6_src), &(frags->packet.ip6hdr.ip6_src), sizeof(struct in6_addr))
&& ((!packet->have_ip6rtdst && !memcmp(&(packet->ip6hdr.ip6_dst), &(frags->packet.ip6hdr.ip6_dst), sizeof(struct in6_addr)))
|| (packet->have_ip6rtdst && !memcmp(&(packet->ip6rtdst), &(frags->packet.ip6hdr.ip6_dst), sizeof(struct in6_addr))))) {
|| (packet->have_ip6rtdst && !memcmp(&(packet->ip6rtdst), &(frags->packet.ip6hdr.ip6_dst), sizeof(struct in6_addr))))) {
layer_tracef("frags %x found", packet->ip6frag.ip6f_ident);
@ -721,7 +721,7 @@ static pcap_thread_packet_state_t reassemble_ipv6(_ctx_t* ctx, const pcap_thread
ts.tv_usec %= 1000000;
if (packet->pkthdr.ts.tv_sec > ts.tv_sec
|| (packet->pkthdr.ts.tv_sec == ts.tv_sec
&& packet->pkthdr.ts.tv_usec > ts.tv_usec)) {
&& packet->pkthdr.ts.tv_usec > ts.tv_usec)) {
pcap_thread_ext_frag_fragment_t* f;
@ -836,7 +836,7 @@ static void _release(_ctx_t* ctx, const pcap_thread_packet_t* packet)
&& packet->ip6frag.ip6f_ident == frags->packet.ip6frag.ip6f_ident
&& !memcmp(&(packet->ip6hdr.ip6_src), &(frags->packet.ip6hdr.ip6_src), sizeof(struct in6_addr))
&& ((!packet->have_ip6rtdst && !memcmp(&(packet->ip6hdr.ip6_dst), &(frags->packet.ip6hdr.ip6_dst), sizeof(struct in6_addr)))
|| (packet->have_ip6rtdst && !memcmp(&(packet->ip6rtdst), &(frags->packet.ip6hdr.ip6_dst), sizeof(struct in6_addr))))) {
|| (packet->have_ip6rtdst && !memcmp(&(packet->ip6rtdst), &(frags->packet.ip6hdr.ip6_dst), sizeof(struct in6_addr))))) {
layer_tracef("release frags %x", packet->ip6frag.ip6f_ident);
break;
@ -971,10 +971,10 @@ static void pcap_thread_layer_callback_frag_release(void* _ctx, const pcap_threa
&& packet->iphdr.ip_src.s_addr == frags->packet.iphdr.ip_src.s_addr
&& packet->iphdr.ip_dst.s_addr == frags->packet.iphdr.ip_dst.s_addr)
|| (frags->packet.have_ip6hdr
&& packet->ip6frag.ip6f_ident == frags->packet.ip6frag.ip6f_ident
&& !memcmp(&(packet->ip6hdr.ip6_src), &(frags->packet.ip6hdr.ip6_src), sizeof(struct in6_addr))
&& ((!packet->have_ip6rtdst && !memcmp(&(packet->ip6hdr.ip6_dst), &(frags->packet.ip6hdr.ip6_dst), sizeof(struct in6_addr)))
|| (packet->have_ip6rtdst && !memcmp(&(packet->ip6rtdst), &(frags->packet.ip6hdr.ip6_dst), sizeof(struct in6_addr)))))) {
&& packet->ip6frag.ip6f_ident == frags->packet.ip6frag.ip6f_ident
&& !memcmp(&(packet->ip6hdr.ip6_src), &(frags->packet.ip6hdr.ip6_src), sizeof(struct in6_addr))
&& ((!packet->have_ip6rtdst && !memcmp(&(packet->ip6hdr.ip6_dst), &(frags->packet.ip6hdr.ip6_dst), sizeof(struct in6_addr)))
|| (packet->have_ip6rtdst && !memcmp(&(packet->ip6rtdst), &(frags->packet.ip6hdr.ip6_dst), sizeof(struct in6_addr)))))) {
/* Found it, remove from list */
if (frags_prev) {

View file

@ -1,6 +1,6 @@
/*
* Author Jerry Lundström <jerry@dns-oarc.net>
* Copyright (c) 2016-2017, OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -103,24 +103,24 @@ struct pcap_thread_ext_frag_conf {
};
pcap_thread_ext_frag_conf_t* pcap_thread_ext_frag_conf_new(void);
void pcap_thread_ext_frag_conf_free(pcap_thread_ext_frag_conf_t* conf);
void pcap_thread_ext_frag_conf_free(pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_reject_overlap(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_reject_overlap(pcap_thread_ext_frag_conf_t* conf, const int reject_overlap);
int pcap_thread_ext_frag_conf_check_timeout(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_check_timeout(pcap_thread_ext_frag_conf_t* conf, const int check_timeout);
int pcap_thread_ext_frag_conf_reject_overlap(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_reject_overlap(pcap_thread_ext_frag_conf_t* conf, const int reject_overlap);
int pcap_thread_ext_frag_conf_check_timeout(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_check_timeout(pcap_thread_ext_frag_conf_t* conf, const int check_timeout);
pcap_thread_ext_frag_reassemble_mode_t pcap_thread_ext_frag_conf_reassemble_mode(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_reassemble_mode(pcap_thread_ext_frag_conf_t* conf, const pcap_thread_ext_frag_reassemble_mode_t reassemble_mode);
size_t pcap_thread_ext_frag_conf_fragments(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_fragments(pcap_thread_ext_frag_conf_t* conf, const size_t fragments);
size_t pcap_thread_ext_frag_conf_per_packet(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_per_packet(pcap_thread_ext_frag_conf_t* conf, const size_t per_packet);
struct timeval pcap_thread_ext_frag_conf_timeout(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_timeout(pcap_thread_ext_frag_conf_t* conf, const struct timeval timeout);
pcap_thread_ext_frag_callback_t pcap_thread_ext_frag_conf_overlap_callback(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_overlap_callback(pcap_thread_ext_frag_conf_t* conf, pcap_thread_ext_frag_callback_t overlap_callback);
pcap_thread_ext_frag_callback_t pcap_thread_ext_frag_conf_timeout_callback(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_timeout_callback(pcap_thread_ext_frag_conf_t* conf, pcap_thread_ext_frag_callback_t timeout_callback);
int pcap_thread_ext_frag_conf_set_reassemble_mode(pcap_thread_ext_frag_conf_t* conf, const pcap_thread_ext_frag_reassemble_mode_t reassemble_mode);
size_t pcap_thread_ext_frag_conf_fragments(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_fragments(pcap_thread_ext_frag_conf_t* conf, const size_t fragments);
size_t pcap_thread_ext_frag_conf_per_packet(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_per_packet(pcap_thread_ext_frag_conf_t* conf, const size_t per_packet);
struct timeval pcap_thread_ext_frag_conf_timeout(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_timeout(pcap_thread_ext_frag_conf_t* conf, const struct timeval timeout);
pcap_thread_ext_frag_callback_t pcap_thread_ext_frag_conf_overlap_callback(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_overlap_callback(pcap_thread_ext_frag_conf_t* conf, pcap_thread_ext_frag_callback_t overlap_callback);
pcap_thread_ext_frag_callback_t pcap_thread_ext_frag_conf_timeout_callback(const pcap_thread_ext_frag_conf_t* conf);
int pcap_thread_ext_frag_conf_set_timeout_callback(pcap_thread_ext_frag_conf_t* conf, pcap_thread_ext_frag_callback_t timeout_callback);
pcap_thread_layer_callback_frag_t pcap_thread_ext_frag_layer_callback(pcap_thread_ext_frag_conf_t* conf);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2024 OARC, Inc.
* Copyright (c) 2016-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 OARC, Inc.
* Copyright (c) 2018-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 OARC, Inc.
* Copyright (c) 2018-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 OARC, Inc.
* Copyright (c) 2018-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 OARC, Inc.
* Copyright (c) 2018-2025 OARC, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View file

@ -17,11 +17,15 @@ CLEANFILES = test*.log test*.trs \
test14.out \
test_regex_match.out \
edns.out \
test_icmp.out
test_icmp.out \
ether_padd.out \
tcpdns.out \
sll2.out
TESTS = test1.sh test2.sh test3.sh test4.sh test5.sh test6.sh test7.sh \
test8.sh test9.sh test10.sh test11.sh test12.sh test13.sh test14.sh \
test_regex_match.sh test_edns.sh test_icmp.sh
test_regex_match.sh test_edns.sh test_icmp.sh test_ether_padd.sh \
test_tcpdns.sh test_sll2.sh
EXTRA_DIST = $(TESTS) \
dns.gold dns.pcap \
@ -38,4 +42,6 @@ EXTRA_DIST = $(TESTS) \
test14.gold \
test_regex_match.gold \
edns.pcap edns.gold \
gen_icmp.py icmp.pcap icmp.gold
gen_icmp.py icmp.pcap icmp.gold \
ether_padd.pcap ipv6-with-ethernet-padding.pcap ether_padd.gold \
sll2.pcap sll2.gold

View file

@ -361,6 +361,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@ -482,11 +483,15 @@ CLEANFILES = test*.log test*.trs \
test14.out \
test_regex_match.out \
edns.out \
test_icmp.out
test_icmp.out \
ether_padd.out \
tcpdns.out \
sll2.out
TESTS = test1.sh test2.sh test3.sh test4.sh test5.sh test6.sh test7.sh \
test8.sh test9.sh test10.sh test11.sh test12.sh test13.sh test14.sh \
test_regex_match.sh test_edns.sh test_icmp.sh
test_regex_match.sh test_edns.sh test_icmp.sh test_ether_padd.sh \
test_tcpdns.sh test_sll2.sh
EXTRA_DIST = $(TESTS) \
dns.gold dns.pcap \
@ -503,7 +508,9 @@ EXTRA_DIST = $(TESTS) \
test14.gold \
test_regex_match.gold \
edns.pcap edns.gold \
gen_icmp.py icmp.pcap icmp.gold
gen_icmp.py icmp.pcap icmp.gold \
ether_padd.pcap ipv6-with-ethernet-padding.pcap ether_padd.gold \
sll2.pcap sll2.gold
all: all-am
@ -812,6 +819,27 @@ test_icmp.sh.log: test_icmp.sh
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
test_ether_padd.sh.log: test_ether_padd.sh
@p='test_ether_padd.sh'; \
b='test_ether_padd.sh'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
test_tcpdns.sh.log: test_tcpdns.sh
@p='test_tcpdns.sh'; \
b='test_tcpdns.sh'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
test_sll2.sh.log: test_sll2.sh
@p='test_sll2.sh'; \
b='test_sll2.sh'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
.test.log:
@p='$<'; \
$(am__set_b); \

6
src/test/ether_padd.gold Normal file
View file

@ -0,0 +1,6 @@
[40] 2025-03-11 08:29:43.753115 [#0 ether_padd.pcap 4095] \
[192.0.2.1].443 [192.0.2.2].44442
[65] 2025-03-10 15:43:11.446327 [#0 ipv6-with-ethernet-padding.pcap 4095] \
[::1].37083 [::1].53 \
dns QUERY,NOERROR,36580,rd|ad \
1 .,IN,NS 0 0 0

BIN
src/test/ether_padd.pcap Normal file

Binary file not shown.

Binary file not shown.

14
src/test/sll2.gold Normal file
View file

@ -0,0 +1,14 @@
[71] 2025-03-07 12:44:52.219938 [#0 sll2.pcap 4095] \
[238.0.0.1].37273 [238.0.0.2].53 \
dns QUERY,NOERROR,20793,rd|ad \
1 \,\..,IN,A 0 0 \
1 .,1232,1232,0,edns0[len=12,UDP=1232,ver=0,rcode=0,DO=1,z=32768],edns0opt[code=10,codelen=8]
[760] 2025-03-07 12:44:52.234317 [#1 sll2.pcap 4095] \
[238.0.0.2].53 [238.0.0.1].37273 \
dns QUERY,NXDOMAIN,20793,qr|rd|ra \
1 \,\..,IN,A 0 \
4 .,IN,SOA,5,a.root-servers.net.,nstld.verisign-grs.com.,2025030700,1800,900,604800,86400 \
.,IN,RRSIG,5,[275] \
.,IN,RRSIG,5,[275] \
.,IN,NSEC,5,[15] \
1 .,1220,1220,0,edns0[len=28,UDP=1220,ver=0,rcode=0,DO=1,z=32768],edns0opt[code=10,codelen=24]

BIN
src/test/sll2.pcap Normal file

Binary file not shown.

22
src/test/test_ether_padd.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/sh -xe
test -e ether_padd.pcap || ln -s "$srcdir/ether_padd.pcap" ether_padd.pcap
test -e ipv6-with-ethernet-padding.pcap || ln -s "$srcdir/ipv6-with-ethernet-padding.pcap" ipv6-with-ethernet-padding.pcap
../dnscap -T -u 443 -g -r ether_padd.pcap 2>ether_padd.out
../dnscap -T -g -r ipv6-with-ethernet-padding.pcap 2>>ether_padd.out
mv ether_padd.out ether_padd.out.old
grep -v "^libgcov profiling error:" ether_padd.out.old > ether_padd.out
rm ether_padd.out.old
diff ether_padd.out "$srcdir/ether_padd.gold"
../dnscap -o use_layers=yes -T -u 443 -g -r ether_padd.pcap 2>ether_padd.out
../dnscap -o use_layers=yes -T -g -r ipv6-with-ethernet-padding.pcap 2>>ether_padd.out
mv ether_padd.out ether_padd.out.old
grep -v "^libgcov profiling error:" ether_padd.out.old > ether_padd.out
rm ether_padd.out.old
diff ether_padd.out "$srcdir/ether_padd.gold"

19
src/test/test_sll2.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh -xe
test -e sll2.pcap || ln -s "$srcdir/sll2.pcap" sll2.pcap
../dnscap -g -r sll2.pcap 2>sll2.out
mv sll2.out sll2.out.old
grep -v "^libgcov profiling error:" sll2.out.old > sll2.out
rm sll2.out.old
diff sll2.out "$srcdir/sll2.gold"
../dnscap -o use_layers=yes -g -r sll2.pcap 2>sll2.out
mv sll2.out sll2.out.old
grep -v "^libgcov profiling error:" sll2.out.old > sll2.out
rm sll2.out.old
diff sll2.out "$srcdir/sll2.gold"

Some files were not shown because too many files have changed in this diff Show more