diff --git a/Makefile.in b/Makefile.in index 5cccbdd..bebe6b8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -9,7 +9,7 @@ CC= gcc AR=/usr/bin/ar RANLIB=/usr/bin/ranlib -CCOPT= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@ +CCOPT= -O2 -Wall @PCAP_INCLUDE@ @USE_PCAP_BPF@ @TCL_INC@ @USE_TCL@ DEBUG= -g #uncomment the following if you need libpcap based build under linux #(not raccomanded) diff --git a/apd.c b/apd.c index 66584fa..8239b6b 100644 --- a/apd.c +++ b/apd.c @@ -893,6 +893,7 @@ int ars_d_set_data(struct ars_packet *pkt, int layer, char *f, char *v) return -ARS_ERROR; err = ars_push_data(pkt, layer, binary, blen); free(binary); + return err; } else if (strcasecmp(f, "uint32") == 0) { int err; __u32 t, nt; diff --git a/configure b/configure index dab04ab..b68773f 100755 --- a/configure +++ b/configure @@ -6,6 +6,7 @@ show_help() echo "--help show this help" echo "--no-tcl disable TCL scripting support" echo " even if uid != euid" + echo "--no-pcap-bpf use net/bpf.h instead of pcap/bpf.h" } if [ "$1" = "--help" ]; then @@ -44,11 +45,11 @@ if [ ! "$CONFIGOSTYPE" ]; then fi # for BSD/OS use the historical name as it doesn't include '/' -if [ $CONFIGOSTYPE = "BSD/OS" ]; then +if [ "$CONFIGOSTYPE" = "BSD/OS" ]; then CONFIGOSTYPE=BSDI fi -case $CONFIGOSTYPE in +case "$CONFIGOSTYPE" in SUNOS) SOLARISLIB="-lsocket -lresolv -lnsl" BUG='/* #define STUPID_SOLARIS_CHECKSUM_BUG */' @@ -63,31 +64,31 @@ esac # for TCLPATH_TRY in "/usr/bin/" "/usr/local/bin/" "/bin/" do - for TCLVER_TRY in "8.4" "8.3" "8.2" "8.1" "8.0" + for TCLVER_TRY in "8.6" "8.5" "8.4" "8.3" "8.2" "8.1" "8.0" do - if [ -z $TCLSH ] + if [ -z "$TCLSH" ] then - TCLSH_TRY=${TCLPATH_TRY}tclsh${TCLVER_TRY} - if [ -f $TCLSH_TRY ] + TCLSH_TRY="${TCLPATH_TRY}tclsh${TCLVER_TRY}" + if [ -f "$TCLSH_TRY" ] then - TCLSH=$TCLSH_TRY + TCLSH="$TCLSH_TRY" echo "===> Found Tclsh in: $TCLSH" fi fi done done -if [ -f $TCLSH ] +if [ -f "$TCLSH" ] then TCL_VER=`echo puts \\$tcl_version | $TCLSH -` - USE_TCL='-DUSE_TCL' + USE_TCL="-DUSE_TCL" TCL_LIB="-ltcl${TCL_VER}" - if [ -e /usr/include/tcl${TCL_VER} ] + if [ -e "/usr/include/tcl${TCL_VER}" ] then TCL_INC="-I/usr/include/tcl${TCL_VER}" - elif [ -e /usr/include/tcl.h ] + elif [ -e "/usr/include/tcl.h" ] then TCL_INC="" - elif [ -e /usr/local/include/tcl${TCL_VER} ] + elif [ -e "/usr/local/include/tcl${TCL_VER}" ] then TCL_INC="-I/usr/local/include/tcl${TCL_VER}" else @@ -107,6 +108,7 @@ fi # PCAP="PCAP=-lpcap" PCAP_INCLUDE="" +USE_PCAP_BPF="-DUSE_PCAP_BPF" for ARG in $*; do case "$ARG" in @@ -116,6 +118,9 @@ for ARG in $*; do TCL_INC="" TCL_LIB="" ;; + *"--no-pcap-bpf") + USE_PCAP_BPF="" + ;; esac done @@ -123,6 +128,7 @@ echo -------------------------------------- echo system type: $CONFIGOSTYPE echo echo "LIBPCAP : $PCAP" +echo "USE_PCAP_BPF : $USE_PCAP_BPF" echo "PCAP_INCLUDE : $PCAP_INCLUDE" echo "MANPATH : $INSTALL_MANPATH" echo "USE_TCL : $USE_TCL" @@ -136,6 +142,7 @@ echo -------------------------------------- echo creating Makefile... sed -e "s^@PCAP@^$PCAP^g" \ + -e "s^@USE_PCAP_BPF@^$USE_PCAP_BPF^g" \ -e "s^@PCAP_INCLUDE@^$PCAP_INCLUDE^g" \ -e "s^@MANPATH@^$INSTALL_MANPATH^g" \ -e "s^@SOLARISLIB@^$SOLARISLIB^g" \ diff --git a/libpcap_stuff.c b/libpcap_stuff.c index 26f9993..d93fba5 100644 --- a/libpcap_stuff.c +++ b/libpcap_stuff.c @@ -16,7 +16,11 @@ #include #include #include +#ifdef USE_PCAP_BPF +#include +#else #include +#endif #include #include "globals.h" diff --git a/script.c b/script.c index 124370c..1fc21ef 100644 --- a/script.c +++ b/script.c @@ -23,7 +23,11 @@ #include #include +#ifdef USE_PCAP_BPF +#include +#else #include +#endif #include #include "release.h"