diff options
-rw-r--r-- | INSTALL | 11 | ||||
-rw-r--r-- | README | 22 | ||||
-rw-r--r-- | acconfig.h | 1 | ||||
-rw-r--r-- | capture.c | 8 | ||||
-rw-r--r-- | capture.h | 9 | ||||
-rwxr-xr-x | configure | 253 | ||||
-rw-r--r-- | configure.in | 58 | ||||
-rw-r--r-- | display.c | 3 | ||||
-rw-r--r-- | ethereal.c | 23 | ||||
-rw-r--r-- | file.c | 4 | ||||
-rw-r--r-- | file.h | 13 | ||||
-rw-r--r-- | menu.c | 18 | ||||
-rw-r--r-- | summary.c | 6 | ||||
-rw-r--r-- | util.c | 4 |
14 files changed, 247 insertions, 186 deletions
@@ -9,8 +9,7 @@ Installation Checklist http://www.gtk.org . - Ethereal should work with the latest 1.0.x version, as well as - the latest 1.2.x version. + Ethereal needs gtk+-1.2.0 or above. If you installed GTK+ from a binary package, you may have to install a "development" package; there may be separate "user's" @@ -18,8 +17,8 @@ Installation Checklist header files and the like. For example, Red Hat users will need to install a "gtk-devel" .rpm. - [ ] 2. Make sure you have libpcap installed. The latest version can be - found at + [ ] 2. If you want to capture packets, make sure you have libpcap + installed. The latest version can be found at ftp://ftp.ee.lbl.gov . @@ -44,6 +43,10 @@ Installation Checklist default. You can change this location with the --sysconfdir option. + The --disable-pcap option allows you to compile without libpcap. + You won't be able to capture packets, but you can read traces + that have already been captured to disk by other programs. + [ ] 4. Run 'make'. Hopefully, you won't run into any problems. [ ] 5. Run './ethereal', and make sure things are working. You must @@ -57,22 +57,12 @@ Multiple File Types The wiretap library is a packet-capture library currently under development parallel to ethereal. In the future it is hoped that wiretap will have more features than libpcap, but wiretap is still in -its infancy. You can compile ethereal with the wiretap library by using -'./configure --with-wiretap'. Using wiretap will allow you to read -libpcap, Sniffer, NetXray (and Sniffer Pro), Sun "snoop", LANalyzer, -Microsoft Network Monitor, and AIX "iptrace" 2.0 trace files. Some minimal -display filters now work. But because "Follow TCP Stream" relies on IP and TCP -display filtering, and those aren't yet available in wiretap's display filter -system, "Follow TCP Stream" is turned off when you compile --with-wiretap. - -You can still capture packets from within ethereal using libpcap, and therefore -use libpcap-style capture filters, however. - -If you want to add support for other packet-capture file formats, please -look at the wiretap source code in the wiretap directory. - -Please report any problems that are wiretap related to -Gilbert Ramirez <gram@verdict.uthscsa.edu>. +its infancy. However, wiretap is used in ethereal for its ability +to read mulitiple file types. You can read the following file +formats, and create display filtes for them as well: + +libpcap, Sniffer (uncompresed), NetXray, Sniffer Pro, snoop, +Shomiti, LANalyzer, Network Monitor, and iptrace 2.0 (AIX) IPv6 diff --git a/acconfig.h b/acconfig.h index f08f72e3ec..ff7afbe74b 100644 --- a/acconfig.h +++ b/acconfig.h @@ -9,4 +9,3 @@ #undef NEED_SNPRINTF_H #undef NEED_STRERROR_H - @@ -1,7 +1,7 @@ /* capture.c * Routines for packet capture windows * - * $Id: capture.c,v 1.29 1999/06/22 22:02:09 gram Exp $ + * $Id: capture.c,v 1.30 1999/07/09 04:18:32 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -28,13 +28,13 @@ # include "config.h" #endif +#ifdef HAVE_LIBPCAP + #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #include <gtk/gtk.h> -#include <pcap.h> - #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -638,3 +638,5 @@ capture_pcap_cb(u_char *user, const struct pcap_pkthdr *phdr, } } + +#endif /* HAVE_LIBPCAP */ @@ -1,7 +1,7 @@ /* capture.h * Definitions for packet capture windows * - * $Id: capture.h,v 1.7 1999/06/19 01:14:49 guy Exp $ + * $Id: capture.h,v 1.8 1999/07/09 04:18:33 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -26,6 +26,12 @@ #ifndef __CAPTURE_H__ #define __CAPTURE_H__ +#ifdef HAVE_LIBPCAP + +#ifndef lib_pcap_h +#include <pcap.h> +#endif + typedef struct _loop_data { gint go; gint max; @@ -39,4 +45,5 @@ typedef struct _loop_data { void capture_prep_cb(GtkWidget *, gpointer); void capture(void); +#endif /* HAVE_LIBPCAP */ #endif /* capture.h */ @@ -18,6 +18,8 @@ ac_help="$ac_help ac_help="$ac_help --disable-gtktest Do not try to compile and run a test GTK program" ac_help="$ac_help + --enable-pcap use libpcap for packet capturing. [default=yes]" +ac_help="$ac_help --enable-ipv6 use ipv6 name resolution, if available. [default=yes]" ac_help="$ac_help --enable-snmp use SNMP library, if available. [default=yes]" @@ -563,7 +565,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:567: checking for a BSD compatible install" >&5 +echo "configure:569: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -616,7 +618,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:620: checking whether build environment is sane" >&5 +echo "configure:622: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -673,7 +675,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:677: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:679: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -720,7 +722,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:724: checking for working aclocal" >&5 +echo "configure:726: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -733,7 +735,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:737: checking for working autoconf" >&5 +echo "configure:739: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -746,7 +748,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:750: checking for working automake" >&5 +echo "configure:752: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -759,7 +761,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:763: checking for working autoheader" >&5 +echo "configure:765: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -772,7 +774,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:776: checking for working makeinfo" >&5 +echo "configure:778: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -793,7 +795,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:797: checking host system type" >&5 +echo "configure:799: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -817,7 +819,7 @@ echo "$ac_t""$host" 1>&6 # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:821: checking for $ac_word" >&5 +echo "configure:823: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -847,7 +849,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:851: checking for $ac_word" >&5 +echo "configure:853: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -898,7 +900,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:902: checking for $ac_word" >&5 +echo "configure:904: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -930,7 +932,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:934: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:936: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -941,12 +943,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 945 "configure" +#line 947 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -972,12 +974,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:976: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:978: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:981: checking whether we are using GNU C" >&5 +echo "configure:983: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -986,7 +988,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1005,7 +1007,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1009: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1011: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1039,7 +1041,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1043: checking for $ac_word" >&5 +echo "configure:1045: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1071,7 +1073,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1075: checking for $ac_word" >&5 +echo "configure:1077: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1104,7 +1106,7 @@ test -n "$YACC" || YACC="yacc" # If we're running gcc, add '-Wall' to CFLAGS. echo $ac_n "checking to see if we can add '-Wall' to CFLAGS""... $ac_c" 1>&6 -echo "configure:1108: checking to see if we can add '-Wall' to CFLAGS" >&5 +echo "configure:1110: checking to see if we can add '-Wall' to CFLAGS" >&5 if test x$GCC != x ; then CFLAGS="-Wall $CFLAGS" echo "$ac_t""yes" 1>&6 @@ -1132,7 +1134,7 @@ EOF case "$host_os" in solaris*) echo $ac_n "checking for LD_LIBRARY_PATH""... $ac_c" 1>&6 -echo "configure:1136: checking for LD_LIBRARY_PATH" >&5 +echo "configure:1138: checking for LD_LIBRARY_PATH" >&5 if test x$LD_LIBRARY_PATH != x ; then LIBS="$LIBS -R$LD_LIBRARY_PATH" echo "$ac_t""yes -- added LD_LIBRARY_PATH to run-time linker path" 1>&6 @@ -1193,7 +1195,7 @@ fi # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1197: checking for $ac_word" >&5 +echo "configure:1199: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1228,7 +1230,7 @@ fi min_gtk_version=1.2.0 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:1232: checking for GTK - version >= $min_gtk_version" >&5 +echo "configure:1234: checking for GTK - version >= $min_gtk_version" >&5 no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes @@ -1251,7 +1253,7 @@ echo "configure:1232: checking for GTK - version >= $min_gtk_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext <<EOF -#line 1255 "configure" +#line 1257 "configure" #include "confdefs.h" #include <gtk/gtk.h> @@ -1329,7 +1331,7 @@ main () } EOF -if { (eval echo configure:1333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1363,7 +1365,7 @@ fi CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat > conftest.$ac_ext <<EOF -#line 1367 "configure" +#line 1369 "configure" #include "confdefs.h" #include <gtk/gtk.h> @@ -1373,7 +1375,7 @@ int main() { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } EOF -if { (eval echo configure:1377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" @@ -1412,29 +1414,44 @@ rm -f conftest* rm -f conf.gtktest -# Evidently, some systems have pcap.h, etc. in */include/pcap -echo $ac_n "checking for extraneous pcap header directories""... $ac_c" 1>&6 -echo "configure:1418: checking for extraneous pcap header directories" >&5 -found_pcap_dir="" -for pcap_dir in /usr/include/pcap /usr/local/include/pcap -do - if test -d $pcap_dir ; then - LIBS="$LIBS -L$pcap_dir" - CFLAGS="$CFLAGS -I$pcap_dir" - CPPFLAGS="$CPPFLAGS -I$pcap_dir" - found_pcap_dir=" $found_pcap_dir -L$pcap_dir" - fi -done - -if test "$found_pcap_dir" != "" ; then - echo "$ac_t""found --$found_pcap_dir added to LIBS" 1>&6 +# Check whether --enable-pcap or --disable-pcap was given. +if test "${enable_pcap+set}" = set; then + enableval="$enable_pcap" + : else - echo "$ac_t""not found" 1>&6 + enable_pcap=yes fi -# Pcap checks -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1438: checking how to run the C preprocessor" >&5 + +echo $ac_n "checking whether to use libpcap for packet capture""... $ac_c" 1>&6 +echo "configure:1428: checking whether to use libpcap for packet capture" >&5 +if test "x$enable_pcap" = "xno" ; then + echo "$ac_t""no" 1>&6 +else + echo "$ac_t""yes" 1>&6 + # Evidently, some systems have pcap.h, etc. in */include/pcap + echo $ac_n "checking for extraneous pcap header directories""... $ac_c" 1>&6 +echo "configure:1435: checking for extraneous pcap header directories" >&5 + found_pcap_dir="" + for pcap_dir in /usr/include/pcap /usr/local/include/pcap + do + if test -d $pcap_dir ; then + LIBS="$LIBS -L$pcap_dir" + CFLAGS="$CFLAGS -I$pcap_dir" + CPPFLAGS="$CPPFLAGS -I$pcap_dir" + found_pcap_dir=" $found_pcap_dir -L$pcap_dir" + fi + done + + if test "$found_pcap_dir" != "" ; then + echo "$ac_t""found --$found_pcap_dir added to LIBS" 1>&6 + else + echo "$ac_t""not found" 1>&6 + fi + + # Pcap checks + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1455: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1449,13 +1466,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1453 "configure" +#line 1470 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1466,13 +1483,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1470 "configure" +#line 1487 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1483,13 +1500,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 1487 "configure" +#line 1504 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1515,17 +1532,17 @@ echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "net/bpf.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for net/bpf.h""... $ac_c" 1>&6 -echo "configure:1519: checking for net/bpf.h" >&5 +echo "configure:1536: checking for net/bpf.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1524 "configure" +#line 1541 "configure" #include "confdefs.h" #include <net/bpf.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1547,19 +1564,19 @@ else { echo "configure: error: Header file net/bpf.h not found." 1>&2; exit 1; } fi -ac_safe=`echo "pcap.h" | sed 'y%./+-%__p_%'` + ac_safe=`echo "pcap.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for pcap.h""... $ac_c" 1>&6 -echo "configure:1553: checking for pcap.h" >&5 +echo "configure:1570: checking for pcap.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1558 "configure" +#line 1575 "configure" #include "confdefs.h" #include <pcap.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1580: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1581,8 +1598,8 @@ else { echo "configure: error: Header file pcap.h not found." 1>&2; exit 1; } fi -echo $ac_n "checking for pcap_open_offline in -lpcap""... $ac_c" 1>&6 -echo "configure:1586: checking for pcap_open_offline in -lpcap" >&5 + echo $ac_n "checking for pcap_open_offline in -lpcap""... $ac_c" 1>&6 +echo "configure:1603: checking for pcap_open_offline in -lpcap" >&5 ac_lib_var=`echo pcap'_'pcap_open_offline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1590,7 +1607,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpcap $LIBS" cat > conftest.$ac_ext <<EOF -#line 1594 "configure" +#line 1611 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1601,7 +1618,7 @@ int main() { pcap_open_offline() ; return 0; } EOF -if { (eval echo configure:1605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1629,7 +1646,7 @@ else { echo "configure: error: Library libpcap not found." 1>&2; exit 1; } fi - +fi # Check whether --enable-ipv6 or --disable-ipv6 was given. @@ -1642,7 +1659,7 @@ fi echo $ac_n "checking whether to enable ipv6 name resolution if available""... $ac_c" 1>&6 -echo "configure:1646: checking whether to enable ipv6 name resolution if available" >&5 +echo "configure:1663: checking whether to enable ipv6 name resolution if available" >&5 if test "x$enable_ipv6" = "xno" ; then echo "$ac_t""no" 1>&6 else @@ -1652,12 +1669,12 @@ else v6lib=none echo $ac_n "checking ipv6 stack type""... $ac_c" 1>&6 -echo "configure:1656: checking ipv6 stack type" >&5 +echo "configure:1673: checking ipv6 stack type" >&5 for i in v6d toshiba kame inria zeta linux; do case $i in v6d) cat > conftest.$ac_ext <<EOF -#line 1661 "configure" +#line 1678 "configure" #include "confdefs.h" dnl #include </usr/local/v6/include/sys/types.h> @@ -1677,7 +1694,7 @@ rm -f conftest* ;; toshiba) cat > conftest.$ac_ext <<EOF -#line 1681 "configure" +#line 1698 "configure" #include "confdefs.h" dnl #include <sys/param.h> @@ -1697,7 +1714,7 @@ rm -f conftest* ;; kame) cat > conftest.$ac_ext <<EOF -#line 1701 "configure" +#line 1718 "configure" #include "confdefs.h" dnl #include <netinet/in.h> @@ -1717,7 +1734,7 @@ rm -f conftest* ;; inria) cat > conftest.$ac_ext <<EOF -#line 1721 "configure" +#line 1738 "configure" #include "confdefs.h" dnl #include <netinet/in.h> @@ -1735,7 +1752,7 @@ rm -f conftest* ;; zeta) cat > conftest.$ac_ext <<EOF -#line 1739 "configure" +#line 1756 "configure" #include "confdefs.h" dnl #include <sys/param.h> @@ -1784,12 +1801,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1788: checking for ANSI C header files" >&5 +echo "configure:1805: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1793 "configure" +#line 1810 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -1797,7 +1814,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1814,7 +1831,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1818 "configure" +#line 1835 "configure" #include "confdefs.h" #include <string.h> EOF @@ -1832,7 +1849,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1836 "configure" +#line 1853 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -1853,7 +1870,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 1857 "configure" +#line 1874 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1864,7 +1881,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1891,17 +1908,17 @@ for ac_hdr in fcntl.h sys/ioctl.h sys/time.h unistd.h stdarg.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1895: checking for $ac_hdr" >&5 +echo "configure:1912: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1900 "configure" +#line 1917 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1932,17 +1949,17 @@ for ac_hdr in sys/sockio.h sys/types.h netinet/in.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1936: checking for $ac_hdr" >&5 +echo "configure:1953: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1941 "configure" +#line 1958 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1982,7 +1999,7 @@ fi SNMP_A='' SNMP_O='' echo $ac_n "checking whether to use SNMP library if available""... $ac_c" 1>&6 -echo "configure:1986: checking whether to use SNMP library if available" >&5 +echo "configure:2003: checking whether to use SNMP library if available" >&5 if test "x$enable_snmp" = "xno" ; then echo "$ac_t""no" 1>&6 else @@ -1991,17 +2008,17 @@ else do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1995: checking for $ac_hdr" >&5 +echo "configure:2012: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2000 "configure" +#line 2017 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2028,7 +2045,7 @@ fi done echo $ac_n "checking for asn_parse_header in -lsnmp""... $ac_c" 1>&6 -echo "configure:2032: checking for asn_parse_header in -lsnmp" >&5 +echo "configure:2049: checking for asn_parse_header in -lsnmp" >&5 ac_lib_var=`echo snmp'_'asn_parse_header | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2036,7 +2053,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsnmp $LIBS" cat > conftest.$ac_ext <<EOF -#line 2040 "configure" +#line 2057 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2047,7 +2064,7 @@ int main() { asn_parse_header() ; return 0; } EOF -if { (eval echo configure:2051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2080,12 +2097,12 @@ fi # for get_interface_list(). echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6 -echo "configure:2084: checking for sa_len in struct sockaddr" >&5 +echo "configure:2101: checking for sa_len in struct sockaddr" >&5 if eval "test \"`echo '$''{'ac_cv_ethereal_struct_sa_len'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2089 "configure" +#line 2106 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/socket.h> @@ -2093,7 +2110,7 @@ int main() { struct sockaddr s; s.sa_len; ; return 0; } EOF -if { (eval echo configure:2097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_ethereal_struct_sa_len=yes else @@ -2116,14 +2133,14 @@ fi # We must know our byte order echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2120: checking whether byte ordering is bigendian" >&5 +echo "configure:2137: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext <<EOF -#line 2127 "configure" +#line 2144 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -2134,11 +2151,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext <<EOF -#line 2142 "configure" +#line 2159 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -2149,7 +2166,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2169,7 +2186,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 2173 "configure" +#line 2190 "configure" #include "confdefs.h" main () { /* Are we little or big endian? From Harbison&Steele. */ @@ -2182,7 +2199,7 @@ main () { exit (u.c[sizeof (long) - 1] == 1); } EOF -if { (eval echo configure:2186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -2208,13 +2225,13 @@ fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:2212: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:2229: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext <<EOF -#line 2218 "configure" +#line 2235 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -2232,7 +2249,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 2236 "configure" +#line 2253 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -2254,12 +2271,12 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:2258: checking for socket" >&5 +echo "configure:2275: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2263 "configure" +#line 2280 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket(); below. */ @@ -2282,7 +2299,7 @@ socket(); ; return 0; } EOF -if { (eval echo configure:2286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -2308,12 +2325,12 @@ fi SNPRINTF_C="" SNPRINTF_O="" echo $ac_n "checking for snprintf""... $ac_c" 1>&6 -echo "configure:2312: checking for snprintf" >&5 +echo "configure:2329: checking for snprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_snprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2317 "configure" +#line 2334 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char snprintf(); below. */ @@ -2336,7 +2353,7 @@ snprintf(); ; return 0; } EOF -if { (eval echo configure:2340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_snprintf=yes" else @@ -2367,12 +2384,12 @@ fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:2371: checking for strerror" >&5 +echo "configure:2388: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2376 "configure" +#line 2393 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strerror(); below. */ @@ -2395,7 +2412,7 @@ strerror(); ; return 0; } EOF -if { (eval echo configure:2399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else @@ -2428,6 +2445,8 @@ fi + + subdirs="wiretap" trap '' 1 2 15 @@ -2587,13 +2606,13 @@ s%@GTK_CONFIG@%$GTK_CONFIG%g s%@GTK_CFLAGS@%$GTK_CFLAGS%g s%@GTK_LIBS@%$GTK_LIBS%g s%@CPP@%$CPP%g -s%@SUBDIRS@%$SUBDIRS%g s%@SNMP_A@%$SNMP_A%g s%@SNMP_O@%$SNMP_O%g s%@SNPRINTF_C@%$SNPRINTF_C%g s%@SNPRINTF_O@%$SNPRINTF_O%g s%@STRERROR_C@%$STRERROR_C%g s%@STRERROR_O@%$STRERROR_O%g +s%@SUBDIRS@%$SUBDIRS%g s%@subdirs@%$subdirs%g CEOF diff --git a/configure.in b/configure.in index 916bf848e0..0d189ec87e 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.28 1999/07/07 22:51:36 gram Exp $ +# $Id: configure.in,v 1.29 1999/07/09 04:18:33 gram Exp $ dnl Process this file with autoconf to produce a configure script. AC_INIT(etypes.h) @@ -51,31 +51,40 @@ esac AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS", AC_MSG_ERROR(GTK+ distribution not found.)) -# Evidently, some systems have pcap.h, etc. in */include/pcap -AC_MSG_CHECKING(for extraneous pcap header directories) -found_pcap_dir="" -for pcap_dir in /usr/include/pcap /usr/local/include/pcap -do - if test -d $pcap_dir ; then - LIBS="$LIBS -L$pcap_dir" - CFLAGS="$CFLAGS -I$pcap_dir" - CPPFLAGS="$CPPFLAGS -I$pcap_dir" - found_pcap_dir=" $found_pcap_dir -L$pcap_dir" - fi -done - -if test "$found_pcap_dir" != "" ; then - AC_MSG_RESULT(found --$found_pcap_dir added to LIBS) +dnl pcap check +AC_ARG_ENABLE(pcap, +[ --enable-pcap use libpcap for packet capturing. [default=yes]],,enable_pcap=yes) + +AC_MSG_CHECKING(whether to use libpcap for packet capture) +if test "x$enable_pcap" = "xno" ; then + AC_MSG_RESULT(no) else - AC_MSG_RESULT(not found) + AC_MSG_RESULT(yes) + # Evidently, some systems have pcap.h, etc. in */include/pcap + AC_MSG_CHECKING(for extraneous pcap header directories) + found_pcap_dir="" + for pcap_dir in /usr/include/pcap /usr/local/include/pcap + do + if test -d $pcap_dir ; then + LIBS="$LIBS -L$pcap_dir" + CFLAGS="$CFLAGS -I$pcap_dir" + CPPFLAGS="$CPPFLAGS -I$pcap_dir" + found_pcap_dir=" $found_pcap_dir -L$pcap_dir" + fi + done + + if test "$found_pcap_dir" != "" ; then + AC_MSG_RESULT(found --$found_pcap_dir added to LIBS) + else + AC_MSG_RESULT(not found) + fi + + # Pcap checks + AC_CHECK_HEADER(net/bpf.h,, AC_MSG_ERROR(Header file net/bpf.h not found.)) + AC_CHECK_HEADER(pcap.h,, AC_MSG_ERROR(Header file pcap.h not found.)) + AC_CHECK_LIB(pcap, pcap_open_offline,, AC_MSG_ERROR(Library libpcap not found.)) fi -# Pcap checks -AC_CHECK_HEADER(net/bpf.h,, AC_MSG_ERROR(Header file net/bpf.h not found.)) -AC_CHECK_HEADER(pcap.h,, AC_MSG_ERROR(Header file pcap.h not found.)) -AC_CHECK_LIB(pcap, pcap_open_offline,, AC_MSG_ERROR(Library libpcap not found.)) - -AC_SUBST(SUBDIRS) dnl ipv6 check AC_ARG_ENABLE(ipv6, @@ -155,6 +164,9 @@ fi AC_SUBST(STRERROR_C) AC_SUBST(STRERROR_O) +dnl blank for now, but will be used in future +AC_SUBST(SUBDIRS) + AM_CONFIG_HEADER(config.h) AC_CONFIG_SUBDIRS(wiretap) AC_OUTPUT(Makefile) @@ -1,7 +1,7 @@ /* display.c * Routines for packet display windows * - * $Id: display.c,v 1.7 1999/06/24 05:37:04 guy Exp $ + * $Id: display.c,v 1.8 1999/07/09 04:18:34 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -33,7 +33,6 @@ #endif #include <gtk/gtk.h> -#include <pcap.h> #include <stdlib.h> #include <stdio.h> diff --git a/ethereal.c b/ethereal.c index d4f498f116..b8f2086c17 100644 --- a/ethereal.c +++ b/ethereal.c @@ -1,6 +1,6 @@ /* ethereal.c * - * $Id: ethereal.c,v 1.50 1999/07/08 04:23:02 gram Exp $ + * $Id: ethereal.c,v 1.51 1999/07/09 04:18:34 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -45,7 +45,6 @@ #endif #include <gtk/gtk.h> -#include <pcap.h> /* needed for capture.h */ #include <stdlib.h> #include <stdio.h> @@ -627,10 +626,12 @@ void blank_packetinfo() { /* Things to do when the main window is realized */ void main_realize_cb(GtkWidget *w, gpointer data) { +#ifdef HAVE_LIBPCAP if (start_capture) { capture(); start_capture = 0; } +#endif } static void @@ -704,8 +705,10 @@ main(int argc, char *argv[]) cf.wth = NULL; cf.fh = NULL; cf.dfilter = NULL; - cf.cfilter = NULL; cf.dfcode = NULL; +#ifdef HAVE_LIBPCAP + cf.cfilter = NULL; +#endif cf.iface = NULL; cf.save_file = NULL; cf.user_saved = 0; @@ -720,10 +723,16 @@ main(int argc, char *argv[]) /* Assemble the compile-time options */ snprintf(comp_info_str, 256, #ifdef GTK_MAJOR_VERSION - "GTK+ %d.%d.%d", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, - GTK_MICRO_VERSION + "GTK+ %d.%d.%d, %s libpcap", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, + GTK_MICRO_VERSION, #else - "GTK+ (version unknown)" + "GTK+ (version unknown), %s libpcap", +#endif + +#ifdef HAVE_LIBPCAP + "with" +#else + "without" #endif ); @@ -740,7 +749,9 @@ main(int argc, char *argv[]) cf.count = atoi(optarg); break; case 'f': +#ifdef HAVE_LIBPCAP cf.cfilter = g_strdup(optarg); +#endif break; case 'F': /* Fork to capture */ fork_mode = 1; @@ -1,7 +1,7 @@ /* file.c * File I/O routines * - * $Id: file.c,v 1.34 1999/07/07 22:51:38 gram Exp $ + * $Id: file.c,v 1.35 1999/07/09 04:18:35 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -29,8 +29,6 @@ #include <gtk/gtk.h> -#include <pcap.h> - #include <stdio.h> #include <unistd.h> #include <string.h> @@ -1,7 +1,7 @@ /* file.h * Definitions for file structures and routines * - * $Id: file.h,v 1.18 1999/07/07 22:51:39 gram Exp $ + * $Id: file.h,v 1.19 1999/07/09 04:18:35 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -29,8 +29,15 @@ #include <sys/types.h> #include <sys/time.h> +#ifndef __WTAP_H__ #include <wtap.h> +#endif + +#ifdef HAVE_LIBPCAP +#ifndef lib_pcap_h #include <pcap.h> +#endif +#endif typedef struct bpf_program bpf_prog; @@ -50,9 +57,11 @@ typedef struct _capture_file { gint user_saved;/* Was capture file saved by user yet? */ wtap *wth; /* Wiretap session */ gchar *dfilter; /* Display filter string */ + GNode *dfcode; /* Compiled display filter program */ +#ifdef HAVE_LIBPCAP gchar *cfilter; /* Capture filter string */ bpf_prog fcode; /* Compiled capture filter program */ - GNode *dfcode; /* Compiled display filter program */ +#endif /* XXX - I'm cheating for now. I'll hardcode 65536 here until I re-arrange * more header files so that ethereal.h is split up into two files, a * generic header and a gtk+-speficic header (or the gtk+ definitions are @@ -1,7 +1,7 @@ /* menu.c * Menu routines * - * $Id: menu.c,v 1.23 1999/07/07 22:51:40 gram Exp $ + * $Id: menu.c,v 1.24 1999/07/09 04:18:35 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -27,12 +27,14 @@ # include "config.h" #endif -#include <glib.h> - #include <gtk/gtk.h> -#include <pcap.h> /* for capture.h */ #include <string.h> +#include <stdio.h> + +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif #include "ethereal.h" #include "menu.h" @@ -95,13 +97,17 @@ static GtkItemFactoryEntry menu_items[] = {"/Edit/Find", "<control>F", NULL, 0, NULL}, {"/Edit/<separator>", NULL, NULL, 0, "<Separator>"}, {"/Edit/_Preferences...", NULL, GTK_MENU_FUNC(prefs_cb), E_PR_PG_NONE, NULL}, +#ifdef HAVE_LIBPCAP {"/_Capture", NULL, NULL, 0, "<Branch>" }, {"/Capture/_Start...", "<control>K", GTK_MENU_FUNC(capture_prep_cb), 0, NULL}, +#endif {"/_Display", NULL, NULL, 0, "<Branch>" }, {"/Display/_Options...", NULL, GTK_MENU_FUNC(display_opt_cb), 0, NULL}, {"/Display/_Match Selected", NULL, GTK_MENU_FUNC(match_selected_cb), 0, NULL}, {"/_Tools", NULL, NULL, 0, "<Branch>" }, +#ifdef HAVE_LIBPCAP {"/Tools/_Capture...", NULL, GTK_MENU_FUNC(capture_prep_cb), 0, NULL}, +#endif {"/Tools/_Follow TCP Stream", NULL, GTK_MENU_FUNC(follow_stream_cb), 0, NULL}, /* {"/Tools/Graph", NULL, NULL, 0, NULL}, future use */ {"/Tools/Summary", NULL, GTK_MENU_FUNC(summary_prep_cb), 0, NULL}, @@ -134,10 +140,14 @@ static GtkMenuEntry menu_items[] = {"<Main>/Edit/Find", "<control>F", NULL, NULL}, {"<Main>/Edit/<separator>", NULL, NULL, NULL}, {"<Main>/Edit/Preferences...", NULL, prefs_cb, (gpointer) E_PR_PG_NONE}, +#ifdef HAVE_LIBPCAP {"<Main>/Capture/Start...", "<control>K", capture_prep_cb, NULL}, +#endif {"<Main>/Display/Options...", NULL, display_opt_cb, NULL}, {"<Main>/Display/Match Selected", NULL, match_selected_cb, NULL}, +#ifdef HAVE_LIBPCAP {"<Main>/Tools/Capture...", NULL, capture_prep_cb, NULL}, +#endif {"<Main>/Tools/Follow TCP Stream", NULL, follow_stream_cb, NULL}, /* {"<Main>/Tools/Graph", NULL, NULL, NULL}, future use */ {"<Main>/Tools/Summary", NULL, summary_prep_cb, NULL}, @@ -1,7 +1,7 @@ /* summary.c * Routines for capture file summary window * - * $Id: summary.c,v 1.3 1999/07/07 22:52:00 gram Exp $ + * $Id: summary.c,v 1.4 1999/07/09 04:18:36 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -33,7 +33,6 @@ #endif #include <gtk/gtk.h> -#include <pcap.h> #include <stdlib.h> #include <stdio.h> @@ -280,6 +279,7 @@ traffic_bytes/seconds); } add_string_to_box(string_buff, capture_box); +#ifdef HAVE_LIBPCAP /* Capture filter */ if (cf.cfilter) { snprintf(string_buff, SUM_STR_MAX, "Capture filter: %s", cf.cfilter); @@ -287,6 +287,8 @@ traffic_bytes/seconds); sprintf(string_buff, "Capture filter: none"); } add_string_to_box(string_buff, capture_box); +#endif + gtk_window_set_position(GTK_WINDOW(sum_open_w), GTK_WIN_POS_MOUSE); gtk_widget_show(sum_open_w); } @@ -1,7 +1,7 @@ /* util.c * Utility routines * - * $Id: util.c,v 1.15 1999/06/12 09:10:18 guy Exp $ + * $Id: util.c,v 1.16 1999/07/09 04:18:36 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -73,7 +73,7 @@ const gchar *bm_key = "button mask"; * */ -#define ESD_MAX_MSG_LEN 1024 +#define ESD_MAX_MSG_LEN 2048 void simple_dialog(gint type, gint *btn_mask, gchar *msg_format, ...) { GtkWidget *win, *main_vb, *top_hb, *type_pm, *msg_label, |