Add suppport for Microsoft Network Monitor Ethernet capture files.
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 17 Jan 1999 09:33:15 +0000 (09:33 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 17 Jan 1999 09:33:15 +0000 (09:33 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@171 f5534014-38df-0310-8fa8-9805f1628bb7

wiretap/Makefile.am
wiretap/Makefile.in
wiretap/aclocal.m4
wiretap/configure
wiretap/file.c
wiretap/wtap.h

index af49decf99b6e0e655ded510c2950fb3be3a453b..f1cdeb1e2ca5e517c6c0ce5305f880e3b7a9e6b8 100644 (file)
@@ -16,6 +16,8 @@ libwiretap_a_SOURCES = \
        lanalyzer.h             \
        libpcap.c               \
        libpcap.h               \
+       netmon.c                \
+       netmon.h                \
        ngsniffer.c             \
        ngsniffer.h             \
        snoop.c                 \
index 6a435cac2a5e40843c6facb216abe54f29b2c5f9..98172ea63e39e95f49c0043944ebb81d597ff050 100644 (file)
@@ -85,6 +85,8 @@ libwiretap_a_SOURCES = \
        lanalyzer.h             \
        libpcap.c               \
        libpcap.h               \
+       netmon.c                \
+       netmon.h                \
        ngsniffer.c             \
        ngsniffer.h             \
        snoop.c                 \
@@ -104,7 +106,7 @@ LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
 libwiretap_a_LIBADD = 
 libwiretap_a_OBJECTS =  buffer.o file.o iptrace.o lanalyzer.o libpcap.o \
-ngsniffer.o snoop.o wtap.o
+netmon.o ngsniffer.o snoop.o wtap.o
 AR = ar
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
@@ -119,8 +121,8 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 TAR = tar
 GZIP = --best
 DEP_FILES =  .deps/buffer.P .deps/file.P .deps/iptrace.P \
-.deps/lanalyzer.P .deps/libpcap.P .deps/ngsniffer.P .deps/snoop.P \
-.deps/wtap.P
+.deps/lanalyzer.P .deps/libpcap.P .deps/netmon.P .deps/ngsniffer.P \
+.deps/snoop.P .deps/wtap.P
 SOURCES = $(libwiretap_a_SOURCES)
 OBJECTS = $(libwiretap_a_OBJECTS)
 
index c4250574289b677f882666200fc0baf49be5992a..c009d8039e2e9f95cdaa3115a6106de3f30810ff 100644 (file)
@@ -197,10 +197,13 @@ int
 main ()
 {
   int major, minor, micro;
+  char *tmp_version;
 
   system ("touch conf.gtktest");
 
-  if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_gtk_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
      printf("%s, bad version string\n", "$min_gtk_version");
      exit(1);
    }
index 59e4611db12c8c2e5bfe4477240e1d890a727685..8b2c0eca1adf37f63405594073e1833eed8ee512 100755 (executable)
@@ -1098,10 +1098,13 @@ int
 main ()
 {
   int major, minor, micro;
+  char *tmp_version;
 
   system ("touch conf.gtktest");
 
-  if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_gtk_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
      printf("%s, bad version string\n", "$min_gtk_version");
      exit(1);
    }
@@ -1151,7 +1154,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:1155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1185,7 +1188,7 @@ fi
           CFLAGS="$CFLAGS $GTK_CFLAGS"
           LIBS="$LIBS $GTK_LIBS"
           cat > conftest.$ac_ext <<EOF
-#line 1189 "configure"
+#line 1192 "configure"
 #include "confdefs.h"
 
 #include <gtk/gtk.h>
@@ -1195,7 +1198,7 @@ int main() {
  return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); 
 ; return 0; }
 EOF
-if { (eval echo configure:1199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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"
@@ -1236,7 +1239,7 @@ rm -f conftest*
 
 # Wiretap check (copied and modified from ethereal)
 echo $ac_n "checking whether to include wiretap library""... $ac_c" 1>&6
-echo "configure:1240: checking whether to include wiretap library" >&5
+echo "configure:1243: checking whether to include wiretap library" >&5
 # Check whether --with-wiretap or --without-wiretap was given.
 if test "${with_wiretap+set}" = set; then
   withval="$with_wiretap"
@@ -1258,7 +1261,7 @@ fi
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1262: checking how to run the C preprocessor" >&5
+echo "configure:1265: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1273,13 +1276,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 1277 "configure"
+#line 1280 "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:1283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1290,13 +1293,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1294 "configure"
+#line 1297 "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:1300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1319,12 +1322,12 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1323: checking for ANSI C header files" >&5
+echo "configure:1326: 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 1328 "configure"
+#line 1331 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1332,7 +1335,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1349,7 +1352,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 1353 "configure"
+#line 1356 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1367,7 +1370,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 1371 "configure"
+#line 1374 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1388,7 +1391,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1392 "configure"
+#line 1395 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1399,7 +1402,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1426,17 +1429,17 @@ for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1430: checking for $ac_hdr" >&5
+echo "configure:1433: 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 1435 "configure"
+#line 1438 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
index 9ff7538b24838d3a39cd6df24b7b91b8048169df..28f1adf07685dc50d608b0aa11c473432fd5e7bf 100644 (file)
@@ -1,6 +1,6 @@
 /* file.c
  *
- * $Id: file.c,v 1.5 1999/01/02 06:10:55 gram Exp $
+ * $Id: file.c,v 1.6 1999/01/17 09:33:15 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
@@ -30,6 +30,7 @@
 #include "libpcap.h"
 #include "snoop.h"
 #include "iptrace.h"
+#include "netmon.h"
 
 /* The open_file_* routines should return the WTAP_FILE_* type
  * that they are checking for if the file is successfully recognized
@@ -70,6 +71,10 @@ wtap* wtap_open_offline(char *filename, int filetype)
                if ((wth->file_type = iptrace_open(wth)) != WTAP_FILE_UNKNOWN) {
                        goto success;
                }
+               /* WTAP_FILE_NETMON */
+               if ((wth->file_type = netmon_open(wth)) != WTAP_FILE_UNKNOWN) {
+                       goto success;
+               }
 
                printf("failed\n");
                /* WTAP_FILE_UNKNOWN */
@@ -103,6 +108,11 @@ wtap* wtap_open_offline(char *filename, int filetype)
                                goto success;
                        }
                        break;
+               case WTAP_FILE_NETMON:
+                       if ((wth->file_type = netmon_open(wth)) != WTAP_FILE_UNKNOWN) {
+                               goto success;
+                       }
+                       break;
                default:
                        goto failure;
        }
index 84bde9447f4d69c971b3d23767fcba64b17e1afd..45afc04ac9344e549a8e107cd1b8283228fdc7a3 100644 (file)
@@ -1,6 +1,6 @@
 /* wtap.h
  *
- * $Id: wtap.h,v 1.10 1999/01/07 16:15:37 gram Exp $
+ * $Id: wtap.h,v 1.11 1999/01/17 09:33:15 guy Exp $
  *
  * Wiretap Library
  * Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
@@ -41,6 +41,7 @@
 #define WTAP_FILE_NGSNIFFER                    4
 #define WTAP_FILE_SNOOP                                6
 #define WTAP_FILE_IPTRACE                      7
+#define WTAP_FILE_NETMON                       8
 
 #include <sys/types.h>
 #include <sys/time.h>
@@ -70,6 +71,12 @@ typedef struct {
        guint16 version_minor;
 } libpcap_t;
 
+typedef struct {
+       time_t  start_secs;
+       guint32 start_msecs;
+       int     end_offset;
+} netmon_t;
+
 struct wtap_pkthdr {
        struct timeval ts;
        guint32 caplen;
@@ -95,6 +102,7 @@ typedef struct wtap {
                libpcap_t               *pcap;
                lanalyzer_t             *lanalyzer;
                ngsniffer_t             *ngsniffer;
+               netmon_t                *netmon;
        } capture;
 
        subtype_func    subtype_read;