diff options
author | Guy Harris <guy@alum.mit.edu> | 1998-11-15 05:29:17 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1998-11-15 05:29:17 +0000 |
commit | 86bf1fc851b5564f5700a937de3213e8354aa52e (patch) | |
tree | 46a497072e194a9ed5f20733549362347c4d6eef /configure | |
parent | 8efdf8a74c3f0c32a380d15aeed0a3f6aff56a29 (diff) |
Add support to wiretap for reading Sun "snoop" capture files.
That requires that, in the packet-reading loop, we pass to the callback
routine the offset in the file of a packet's data, because we can no
longer compute that offset by subtracting the size of the captured
packet data from the offset in the file after the data was read -
"snoop" may stick padding in after the packet data to align packet
headers on 4-byte boundaries.
Doing that required that we arrange that we do that for "libpcap"
capture files as well; the cleanest way to do that was to write our own
code for reading "libpcap" capture files, rather than using the
"libpcap" code to do it.
Make "wtap_dispatch_cb()" and "pcap_dispatch_cb()" static to "file.c",
as they're not used elsewhere.
If we're using wiretap, don't define in "file.h" stuff used only when
we're not using wiretap.
Update the wiretap README to reflect Gilbert's and my recent changes.
Clean up some memory leaks in "wiretap/lanalyzer.c" and
"wiretap/ngsniffer.c", where the capture-file-format-specific data
wasn't freed if the open failed.
svn path=/trunk/; revision=91
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 70 |
1 files changed, 52 insertions, 18 deletions
@@ -1694,20 +1694,54 @@ done # AC_C_CONST -# We need libpcap's AC_LBL_SOCKADDR_SA_LEN test for get_interface_list(). +# We need to know whether "struct sockaddr" has an "sa_len" member +# for get_interface_list(). + +echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6 +echo "configure:1702: 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 1707 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/socket.h> +int main() { +struct sockaddr s; s.sa_len; +; return 0; } +EOF +if { (eval echo configure:1715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_ethereal_struct_sa_len=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_ethereal_struct_sa_len=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_ethereal_struct_sa_len" 1>&6 +if test $ac_cv_ethereal_struct_sa_len = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SA_LEN 1 +EOF + +fi -AC_LBL_SOCKADDR_SA_LEN # We must know our byte order echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1704: checking whether byte ordering is bigendian" >&5 +echo "configure:1738: 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 1711 "configure" +#line 1745 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -1718,11 +1752,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1756: \"$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 1726 "configure" +#line 1760 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -1733,7 +1767,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1753,7 +1787,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 1757 "configure" +#line 1791 "configure" #include "confdefs.h" main () { /* Are we little or big endian? From Harbison&Steele. */ @@ -1766,7 +1800,7 @@ main () { exit (u.c[sizeof (long) - 1] == 1); } EOF -if { (eval echo configure:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1792,13 +1826,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:1796: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:1830: 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 1802 "configure" +#line 1836 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -1816,7 +1850,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 1820 "configure" +#line 1854 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -1838,12 +1872,12 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:1842: checking for socket" >&5 +echo "configure:1876: 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 1847 "configure" +#line 1881 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket(); below. */ @@ -1866,7 +1900,7 @@ socket(); ; return 0; } EOF -if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -1892,12 +1926,12 @@ fi SNPRINTF_C="" SNPRINTF_O="" echo $ac_n "checking for snprintf""... $ac_c" 1>&6 -echo "configure:1896: checking for snprintf" >&5 +echo "configure:1930: 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 1901 "configure" +#line 1935 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char snprintf(); below. */ @@ -1920,7 +1954,7 @@ snprintf(); ; return 0; } EOF -if { (eval echo configure:1924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_snprintf=yes" else |