aboutsummaryrefslogtreecommitdiffstats
path: root/file.h
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1998-11-12 00:06:47 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1998-11-12 00:06:47 +0000
commitfcb4c78a6a01d22f0db9d6de870342511030cb01 (patch)
treed32b2d7467b0266e722aa763c9b48cf0df2c802c /file.h
parentc2eeef9467d44eb4ea2cd6bd08f62f5c9c293810 (diff)
A lengthy patch to add the wiretap library. Wiretap is not used by default
because it is still in its infancy, but it can be compiled in optionally. The library exists in its own subdirectory ethereal/wiretap. This patch also edits all the packet-*.c files to remove the #include <pcap.h> line which is unnecessary in these files. In the ethereal code, file.c is the most heavily modified with #ifdef WITH_WIRETAP lines for the optional library. svn path=/trunk/; revision=82
Diffstat (limited to 'file.h')
-rw-r--r--file.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/file.h b/file.h
index f2da3feb14..ea0c487a3f 100644
--- a/file.h
+++ b/file.h
@@ -1,7 +1,7 @@
/* file.h
* Definitions for file structures and routines
*
- * $Id: file.h,v 1.4 1998/10/12 01:40:49 gerald Exp $
+ * $Id: file.h,v 1.5 1998/11/12 00:06:21 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -29,7 +29,11 @@
#include <sys/types.h>
#include <sys/time.h>
-#include <pcap.h>
+#ifdef WITH_WIRETAP
+ #include <wtap.h>
+#else
+ #include <pcap.h>
+#endif
/* Data file formats */
#define CD_UNKNOWN 0
@@ -67,7 +71,11 @@ typedef struct _capture_file {
guint32 snap; /* Captured packet length */
gchar *iface; /* Interface */
gchar *save_file; /* File to write capture data */
+#ifdef WITH_WIRETAP
+ wtap *wth; /* Wiretap session */
+#else
pcap_t *pfh; /* Pcap session */
+#endif
gchar *dfilter; /* Display filter string */
gchar *cfilter; /* Capture filter string */
bpf_prog fcode; /* Compiled filter program */
@@ -97,7 +105,11 @@ typedef struct _snoop_frame_hdr {
int open_cap_file(char *, capture_file *);
void close_cap_file(capture_file *, GtkWidget *, guint);
int load_cap_file(char *, capture_file *);
+#ifdef WITH_WIRETAP
+void wtap_dispatch_cb(u_char *, const struct wtap_pkthdr *, const u_char *);
+#else
void pcap_dispatch_cb(u_char *, const struct pcap_pkthdr *, const u_char *);
+#endif
/* size_t read_frame_header(capture_file *); */
#endif /* file.h */