aboutsummaryrefslogtreecommitdiffstats
path: root/capture-wpcap.c
diff options
context:
space:
mode:
authorsake <sake@f5534014-38df-0310-8fa8-9805f1628bb7>2010-10-03 12:04:18 +0000
committersake <sake@f5534014-38df-0310-8fa8-9805f1628bb7>2010-10-03 12:04:18 +0000
commit512d3ba2201c2a3c9944d240c6a41105fe6fca31 (patch)
tree981ca2b1c05f9cad13f4b6e712f0ba02dc405d83 /capture-wpcap.c
parentdae4bfa165024d332f6bfab3b8f8e262a87d17e4 (diff)
Retry of SVN 34338, now tested on my WinXP dev VM:
Use pcap_open_dead instead of pcap_create for the compile BPF button. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34340 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture-wpcap.c')
-rw-r--r--capture-wpcap.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/capture-wpcap.c b/capture-wpcap.c
index f1d0cf06d6..d081fa657b 100644
--- a/capture-wpcap.c
+++ b/capture-wpcap.c
@@ -69,6 +69,9 @@ static int (*p_pcap_lookupnet) (const char *, bpf_u_int32 *, bpf_u_int32 *,
char *);
static pcap_t* (*p_pcap_open_live) (const char *, int, int, int, char *);
static int (*p_pcap_loop) (pcap_t *, int, pcap_handler, guchar *);
+#ifdef HAVE_PCAP_OPEN_DEAD
+static pcap_t* (*p_pcap_open_dead) (int, int);
+#endif
static void (*p_pcap_freecode) (struct bpf_program *);
#ifdef HAVE_PCAP_FINDALLDEVS
static int (*p_pcap_findalldevs) (pcap_if_t **, char *);
@@ -113,6 +116,10 @@ static int (*p_pcap_set_datalink)(pcap_t *, int);
static int (*p_pcap_free_datalinks)(int *);
#endif
+#ifdef HAVE_BPF_IMAGE
+static char *(*p_bpf_image) (const struct bpf_insn *, int);
+#endif
+
typedef struct {
const char *name;
gpointer *ptr;
@@ -144,6 +151,9 @@ load_wpcap(void)
SYM(pcap_createsrcstr, FALSE),
#endif
SYM(pcap_open_live, FALSE),
+#ifdef HAVE_PCAP_OPEN_DEAD
+ SYM(pcap_open_dead, FALSE),
+#endif
#ifdef HAVE_PCAP_SETSAMPLING
SYM(pcap_setsampling, TRUE),
#endif
@@ -182,6 +192,9 @@ load_wpcap(void)
#ifdef HAVE_PCAP_FREE_DATALINKS
SYM(pcap_free_datalinks, TRUE),
#endif
+#ifdef HAVE_BPF_IMAGE
+ SYM(bpf_image, FALSE),
+#endif
{ NULL, NULL, FALSE }
};
@@ -316,6 +329,28 @@ pcap_open_live(const char *a, int b, int c, int d, char *e)
return p_pcap_open_live(a, b, c, d, e);
}
+#ifdef HAVE_PCAP_OPEN_DEAD
+pcap_t*
+pcap_open_dead(int a, int b)
+{
+ if (!has_wpcap) {
+ return NULL;
+ }
+ return p_pcap_open_dead(a, b);
+}
+#endif
+
+#ifdef HAVE_BPF_IMAGE
+static char *
+bpf_image(const struct bpf_insn *a, int b)
+{
+ if (!has_wpcap) {
+ return NULL;
+ }
+ return p_bpf_image(a, b);
+}
+#endif
+
#ifdef HAVE_PCAP_REMOTE
pcap_t*
pcap_open(const char *a, int b, int c, int d, struct pcap_rmtauth *e, char *f)