Skip to content

Commit bf26d12

Browse files
authored
Tcpflow 1.6.0 patch (#227)
* minor upgrade, but keeping be13 on master * update * alpha 1.6.0 to work with update of dfxml module but not yet master of be13_api * removed scan_python from build
1 parent d27c393 commit bf26d12

32 files changed

+1853
-169
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
url = https://github.com/simsong/be13_api.git
44
branch = master
55
[submodule "src/dfxml"]
6-
path = src/dfxml
6+
path = src/dfxml_x
77
url = https://github.com/simsong/dfxml.git
88
branch = master
99
[submodule "src/http-parser"]

bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function usage() {
1111

1212
automake --help 1>/dev/null 2>&1 || usage
1313

14-
for sub in be13_api dfxml http-parser
14+
for sub in be13_api http-parser
1515
do
1616
if [ ! -r src/$sub/.git ] ;
1717
then

configure.ac

Lines changed: 48 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# -*- Autoconf -*-
1+
# -*- Autoconf -*-
22
# tcpflow configure.ac
33
#
4-
# Process this file with autoconf to produce a configure script.
5-
# Order is largely irrevellant, although it must start with AC_INIT and end with AC_OUTPUT
6-
# See http://autotoolset.sourceforge.net/tutorial.html
7-
# and http://www.openismus.com/documents/linux/automake/automake.shtml
4+
# Process this file with autoconf to produce a configure script.
5+
# Order is largely irrevellant, although it must start with AC_INIT and end with AC_OUTPUT
6+
# See http://autotoolset.sourceforge.net/tutorial.html
7+
# and http://www.openismus.com/documents/linux/automake/automake.shtml
88

99
AC_PREREQ(2.57)
10-
AC_INIT(TCPFLOW, 1.5.1, [email protected])
10+
AC_INIT(TCPFLOW, 1.6.0, [email protected])
1111
AC_CONFIG_MACRO_DIR([m4])
1212

1313
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile doc/Makefile])
@@ -32,11 +32,9 @@ AC_PROG_INSTALL
3232
m4_include([m4/slg_searchdirs.m4])
3333
m4_include([m4/slg_gcc_all_warnings.m4])
3434

35-
36-
# use C++11 mode if available; HAVE_CXX11 is defined in config.h if so. Don't
37-
# use the GNU C++11 extensions for portability's sake (noext).
35+
# Must use C++17 mode. (mandatory)
3836
AC_LANG_PUSH(C++)
39-
AX_CXX_COMPILE_STDCXX_11(noext, optional)
37+
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
4038
AC_LANG_POP()
4139

4240

@@ -56,20 +54,20 @@ AC_LANG_POP()
5654

5755
mingw="no"
5856
case $host in
59-
*-*-*linux*-*)
57+
*-*-*linux*-*)
6058
AC_DEFINE([__LINUX__],1,[Linux operating system functions])
6159
;;
6260

63-
*-*-mingw32*)
64-
LIBS="-lpsapi -lws2_32 -lgdi32 $LIBS"
61+
*-*-mingw32*)
62+
LIBS="-lpsapi -lws2_32 -lgdi32 $LIBS"
6563
CPPFLAGS="-DUNICODE -D_UNICODE -D__MSVCRT_VERSION__=0x0601 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -g $CPPFLAGS"
6664
CPPFLAGS="$CPPFLAGS --static"
6765
CFLAGS="$CFLAGS --static -static-libgcc -static-libstdc++"
6866
CXXFLAGS="$CXXFLAGS -Wno-format " # compiler mingw-4.3.0 is broken on I64u formats
6967
CXXFLAGS="$CXXFLAGS --static -static-libgcc -static-libstdc++"
7068
LDFLAGS="$LDFLAGS --static"
7169
mingw="yes"
72-
;;
70+
;;
7371

7472
*)
7573
CXXFLAGS="$CXXFLAGS -Wno-address-of-packed-member"
@@ -88,8 +86,8 @@ if test x"${mingw}" == "xno" ; then
8886
AC_MSG_NOTICE([ *** ADDING ${spfx}/lib to LDFLAGS *** ])
8987
fi
9088
done
91-
AC_MSG_NOTICE([ CPPFLAGS = ${CPPFLAGS} ])
92-
AC_MSG_NOTICE([ LDFLAGS = ${LDFLAGS} ])
89+
AC_MSG_NOTICE([ CPPFLAGS = ${CPPFLAGS} ])
90+
AC_MSG_NOTICE([ LDFLAGS = ${LDFLAGS} ])
9391
fi
9492

9593
if test -r /bin/uname.exe ; then
@@ -105,14 +103,14 @@ fi
105103
# Enable all the compiler debugging we can find
106104
#
107105
# This is originally from PhotoRec, but modified substantially by Simson
108-
# Figure out which flags we can use with the compiler.
106+
# Figure out which flags we can use with the compiler.
109107
#
110108
# These I don't like:
111109
# -Wdeclaration-after-statement -Wconversion
112-
# doesn't work: -Wunreachable-code
113-
# causes configure to crash on gcc-4.2.1: -Wsign-compare-Winline
114-
# causes warnings with unistd.h: -Wnested-externs
115-
# Just causes too much annoyance: -Wmissing-format-attribute
110+
# doesn't work: -Wunreachable-code
111+
# causes configure to crash on gcc-4.2.1: -Wsign-compare-Winline
112+
# causes warnings with unistd.h: -Wnested-externs
113+
# Just causes too much annoyance: -Wmissing-format-attribute
116114
# Check GCC
117115
WARNINGS_TO_TEST="-MD -D_FORTIFY_SOURCE=2 -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes \
118116
-Wshadow -Wwrite-strings -Wcast-align -Waggregate-return \
@@ -150,7 +148,7 @@ unset option
150148
# -Waggregate-return -- aggregate returns are GOOD; they simplify code design
151149
# We can use these warnings after ZLIB gets upgraded:
152150
# -Wundef --- causes problems with zlib
153-
# -Wcast-qual
151+
# -Wcast-qual
154152
# -Wmissing-format-attribute --- Just too annoying
155153
AC_LANG_PUSH(C++)
156154
WARNINGS_TO_TEST="-Wall -MD -D_FORTIFY_SOURCE=2 -Wpointer-arith \
@@ -160,19 +158,18 @@ WARNINGS_TO_TEST="-Wall -MD -D_FORTIFY_SOURCE=2 -Wpointer-arith \
160158
-Woverloaded-virtual -Wsign-promo \
161159
-funit-at-a-time"
162160

161+
add_strict_null_sentinel='yes'
163162
if $CXX -dM -E - < /dev/null | grep -q __clang__ ; then
164163
AC_MSG_RESULT([Using clang])
165-
clang='yes'
166-
else
167-
AC_MSG_RESULT([not using clang])
168-
clang='no'
169-
# -Wstrict-null-sentinel is not supported under clang or under Darwin's gcc
170-
WARNINGS_TO_TEST="$WARNINGS_TO_TEST -Wstrict-null-sentinel"
164+
add_strict_null_sentinel='no'
171165
fi
172166

173-
if test $mingw = "no" ; then
174-
# add the warnings we don't want to do on mingw
175-
WARNINGS_TO_TEST="$WARNINGS_TO_TEST -Weffc++"
167+
if uname -a | grep -q Darwin; then
168+
add_strict_null_sentinel='no'
169+
fi
170+
171+
if [ $add_strict_null_sentinel = 'yes' ]; then
172+
WARNINGS_TO_TEST="$WARNINGS_TO_TEST -Wstrict-null-sentinel"
176173
fi
177174

178175
for option in $WARNINGS_TO_TEST
@@ -188,7 +185,7 @@ do
188185
unset SAVE_CXXFLAGS
189186
done
190187
unset option
191-
AC_LANG_POP()
188+
AC_LANG_POP()
192189

193190
################################################################
194191
##
@@ -214,11 +211,11 @@ AC_CHECK_FUNCS([regcomp tre_regcomp tre_version])
214211

215212

216213
################################################################
217-
## OpenSSL Support (required for AFFLIB and hash_t )
214+
## OpenSSL Support (required for hash_t )
218215
AC_CHECK_HEADERS([openssl/aes.h openssl/bio.h openssl/evp.h openssl/hmac.h openssl/md5.h openssl/pem.h openssl/rand.h openssl/rsa.h openssl/sha.h openssl/pem.h openssl/x509.h])
219216
AC_CHECK_LIB([dl],[dlopen]) dnl apparently OpenSSL now needs -ldl on some Linux
220217
AC_CHECK_LIB([crypto],[EVP_get_digestbyname]) # if crypto is available, get it
221-
AC_CHECK_LIB([md],[MD5]) # if libmd is available, get it
218+
AC_CHECK_LIB([md],[MD5]) # if libmd is available, get it
222219

223220
# Need either SSL_library_init or OPENSSL_init_ssl, depending on openssl version
224221
AC_CHECK_LIB([ssl],[SSL_library_init],,
@@ -230,41 +227,14 @@ AC_CHECK_FUNCS([MD5_Init EVP_get_digestbyname])
230227
################################################################
231228
## Includes
232229

233-
m4_include([src/dfxml/src/dfxml_configure.m4])
234230
m4_include([src/be13_api/be13_configure.m4])
235-
236-
################################################################
237-
# PTHREAD support
238-
# With special nods to compiling under mingw
239-
240-
if test x"$mingw" = x"yes"; then
241-
#AC_DEFINE([HAVE_STRUCT_TIMESPEC],1,[Required for mingw])
242-
CFLAGS="$CFLAGS -mthreads "
243-
CPPFLAGS="-DPTW32_STATIC_LIB $CPPFLAGS"
244-
CXXFLAGS="$CXXFLAGS -mthreads "
245-
AC_DEFINE(HAVE_PTHREAD,1,[Defined to POSIX threads for mingw])
246-
#AC_MSG_NOTICE([pthreads now disabled under mingw])
247-
AC_CHECK_LIB([pthread],[pthread_create])
248-
else
249-
m4_include([m4/ax_pthread.m4])
250-
AX_PTHREAD([
251-
echo Using settings from [AX_PTHREAD]
252-
LIBS="$PTHREAD_LIBS $LIBS"
253-
CFLAGS=" $PTHREAD_CFLAGS $CFLAGS"
254-
CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS "
255-
CPPFLAGS="$PTHREAD_CFLAGS $CPPFLAGS "
256-
CC="$PTHREAD_CC"
257-
])
258-
fi
259-
260-
AC_CHECK_HEADERS([pthread.h])
261-
AC_CHECK_LIB([pthreadGC2],[pthread_create])
231+
m4_include([src/be13_api/dfxml/src/dfxml_configure.m4])
262232

263233
################################################################
264234
# Boost
265235
AC_CHECK_HEADERS([boost/version.hpp],,
266236
AC_MSG_WARN([tcpflow now requires boost interval_map and interval_set.])
267-
if test x"$mingw" = x"yes" ; then
237+
if test x"$mingw" = x"yes" ; then
268238
AC_MSG_ERROR([Please install mingw32-boost and mingw64-boost])
269239
else
270240
AC_MSG_ERROR([Please install boost-devel or libboost-dev.])
@@ -290,7 +260,7 @@ Try these commands:
290260
... and then re-run configure!
291261
])
292262
fi
293-
AC_LANG_POP()
263+
AC_LANG_POP()
294264

295265
################################################################
296266
# drawing support via cairo
@@ -326,13 +296,13 @@ fi
326296
# pcap support. A bit more involved than normal due to the error message
327297
#
328298
AC_CHECK_HEADERS(pcap.h pcap/pcap.h )
329-
if test x"$mingw" = x"yes" ; then
299+
if test x"$mingw" = x"yes" ; then
330300
AC_MSG_WARN([pcap not supported under mingw])
331301
else
332302
AC_CHECK_LIB(pcap, pcap_lookupdev, , [
333303
enable_pcap=no
334304
AC_MSG_WARN([
335-
Can't find the pcap library (libpcap.a).
305+
Can't find the pcap library (libpcap.a).
336306
tcpflow will not live capture or compile rules without pcap!
337307
338308
If you need rules or live capture, you must install the pcap and/or
@@ -341,7 +311,7 @@ pcap-dev library. Please execute this command:
341311
UBUNTU: sudo apt-get install libpcap-dev
342312
DEBIAN: sudo apt-get install libpcap-dev
343313
FEDORA: sudo dnf install libpcap-devel
344-
MINGW: Sorry! libpcap is not currently
314+
MINGW: Sorry! libpcap is not currently
345315
available when cross-compiling.
346316
347317
If your libpcap is installed in a non-standard location, you will need
@@ -360,7 +330,7 @@ AC_ARG_ENABLE([wifi],
360330
[],
361331
[
362332
if test x"no" = x"$mingw"; then
363-
AC_DEFINE(USE_WIFI, 1, [Use WIFI decompression])
333+
AC_DEFINE(USE_WIFI, 1, [Use WIFI decompression])
364334
wifi="yes"
365335
fi
366336
])
@@ -427,7 +397,7 @@ AC_CHECK_HEADERS([\
427397
stdio.h \
428398
stdlib.h \
429399
string.h \
430-
syslog.h \
400+
syslog.h \
431401
sys/cdefs.h \
432402
sys/mman.h \
433403
sys/param.h \
@@ -468,7 +438,7 @@ AC_CHECK_HEADERS([net/if.h], [], [],
468438
#include <sys/socket.h>
469439
#endif
470440
]])
471-
441+
472442
AC_CHECK_HEADERS([netinet/ip_var.h], [], [],
473443
[[
474444
#ifdef HAVE_SYS_TYPES_H
@@ -479,7 +449,7 @@ AC_CHECK_HEADERS([netinet/ip_var.h], [], [],
479449
#include <netinet/in.h>
480450
#endif
481451
]])
482-
452+
483453
AC_CHECK_HEADERS([netinet/ip.h], [], [],
484454
[[
485455
#ifdef HAVE_SYS_TYPES_H
@@ -490,7 +460,7 @@ AC_CHECK_HEADERS([netinet/ip.h], [], [],
490460
#include <netinet/in.h>
491461
#endif
492462
]])
493-
463+
494464
AC_CHECK_HEADERS([netinet/ip_ether.h], [], [],
495465
[[
496466
#ifdef HAVE_SYS_TYPES_H
@@ -501,7 +471,7 @@ AC_CHECK_HEADERS([netinet/ip_ether.h], [], [],
501471
#include <netinet/in.h>
502472
#endif
503473
]])
504-
474+
505475

506476
AC_CHECK_HEADERS([netinet/tcpip.h], [], [],
507477
[[
@@ -521,9 +491,9 @@ AC_CHECK_HEADERS([netinet/tcpip.h], [], [],
521491
#include <netinet/tcp.h>
522492
#endif
523493
]])
524-
494+
525495
AC_CHECK_FUNCS([inet_ntop sigaction sigset strnstr setuid setgid mmap futimes futimens ])
526-
AC_CHECK_TYPES([socklen_t], [], [],
496+
AC_CHECK_TYPES([socklen_t], [], [],
527497
[[
528498
#ifdef HAVE_SYS_TYPES_H
529499
#include <sys/types.h>
@@ -543,7 +513,7 @@ AC_CHECK_TYPES([socklen_t], [], [],
543513
]]
544514
)
545515

546-
AC_CHECK_TYPES([sa_family_t], [], [],
516+
AC_CHECK_TYPES([sa_family_t], [], [],
547517
[[
548518
#ifdef HAVE_SYS_TYPES_H
549519
#include <sys/types.h>
@@ -607,7 +577,7 @@ fi
607577

608578
if test "${with_opt}" = "no" ; then
609579
AC_MSG_NOTICE([Dropping optimization flags])
610-
CFLAGS=`echo "$CFLAGS" | sed s/-O[[0-9]]//` # note the double quoting!
580+
CFLAGS=`echo "$CFLAGS" | sed s/-O[[0-9]]//` # note the double quoting!
611581
CXXFLAGS=`echo "$CXXFLAGS" | sed s/-O[[0-9]]//`
612582

613583
AC_MSG_NOTICE([Removing -D_FORTIFY_SOURCE=2])
@@ -617,7 +587,7 @@ if test "${with_opt}" = "no" ; then
617587
else
618588
# and increase optimizer from -O2 to -O3 if not explicitly forbidden
619589
if test "${with_o3}" != "no" ; then
620-
CFLAGS=`echo -g "$CFLAGS" | sed s/-O2/-O3/` # note the double quoting!
590+
CFLAGS=`echo -g "$CFLAGS" | sed s/-O2/-O3/` # note the double quoting!
621591
CXXFLAGS=`echo -g "$CXXFLAGS" | sed s/-O2/-O3/`
622592
fi
623593
fi
@@ -641,4 +611,3 @@ if test "x${Fmissing_library}" != "x" ; then
641611
AC_MSG_NOTICE([*** Ubuntu: sudo apt-get install $Umissing_library])
642612
AC_MSG_NOTICE([*** MacOS: sudo port install $Mmissing_library])
643613
fi
644-

m4/ac_check_classpath.m4

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
dnl @synopsis AC_CHECK_CLASSPATH
2+
dnl
3+
dnl AC_CHECK_CLASSPATH just displays the CLASSPATH, for the edification
4+
dnl of the user.
5+
dnl
6+
dnl Note: This is part of the set of autoconf M4 macros for Java
7+
dnl programs. It is VERY IMPORTANT that you download the whole set,
8+
dnl some macros depend on other. Unfortunately, the autoconf archive
9+
dnl does not support the concept of set of macros, so I had to break it
10+
dnl for submission. The general documentation, as well as the sample
11+
dnl configure.in, is included in the AC_PROG_JAVA macro.
12+
dnl
13+
dnl @category Java
14+
dnl @author Stephane Bortzmeyer <[email protected]>
15+
dnl @version 2000-07-19
16+
dnl @license GPLWithACException
17+
18+
AC_DEFUN([AC_CHECK_CLASSPATH],[
19+
if test "x$CLASSPATH" = x; then
20+
echo "You have no CLASSPATH, I hope it is good"
21+
else
22+
echo "You have CLASSPATH $CLASSPATH, hope it is correct"
23+
fi
24+
])

0 commit comments

Comments
 (0)