aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-11-09 07:44:51 +0000
committerGuy Harris <guy@alum.mit.edu>2001-11-09 07:44:51 +0000
commit40b22f317b55ecd98cfbd7eeca2015a09de76e86 (patch)
treea629cd7ba4581f6eea83a274230336a2c98b7f92 /capture.c
parente6b12dd801e086d437777e8d3163b5e2e0dceb7a (diff)
Wrap calls to "pcap_datalink()" in a routine that attempts to compensate
for AIX 5.x's non-standard libpcap, where "pcap_datalink()" doesn't return DLT_ values, it returns RFC 1573 ifType values. Put that wrapper, and the routine to get the interface list, in a separate file, for packet-capture utility routines, so not everybody who includes "util.h" needs to include <pcap.h>. Fix up the Wiretap hack for dealing with said incompatibility to use the correct ifType value for Token Ring. svn path=/trunk/; revision=4184
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/capture.c b/capture.c
index 31ca305d44..4b5c77c0c6 100644
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.156 2001/10/26 18:28:15 gram Exp $
+ * $Id: capture.c,v 1.157 2001/11/09 07:44:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -141,6 +141,7 @@
#include "file.h"
#include "capture.h"
#include "util.h"
+#include "pcap-util.h"
#include "simple_dialog.h"
#include "prefs.h"
#include "globals.h"
@@ -159,6 +160,10 @@
#include "packet-ieee80211.h"
#include "packet-chdlc.h"
+#ifdef WIN32
+#include "capture-wpcap.h"
+#endif
+
static int sync_pipe[2]; /* used to sync father */
enum PIPES { READ, WRITE }; /* Constants 0 and 1 for READ and WRITE */
int quit_after_cap; /* Makes a "capture only mode". Implies -k */
@@ -1394,7 +1399,7 @@ capture(gboolean *stats_known, struct pcap_stat *stats)
} else
#endif
{
- pcap_encap = pcap_datalink(pch);
+ pcap_encap = get_pcap_linktype(pch, cfile.iface);
snaplen = pcap_snapshot(pch);
}
ld.linktype = wtap_pcap_encap_to_wtap_encap(pcap_encap);