diff options
author | Sake Blok <sake@euronet.nl> | 2010-10-03 12:04:18 +0000 |
---|---|---|
committer | Sake Blok <sake@euronet.nl> | 2010-10-03 12:04:18 +0000 |
commit | f3e94f6753a53d1f88a864ff6ef197da89717477 (patch) | |
tree | 981ca2b1c05f9cad13f4b6e712f0ba02dc405d83 /capture-wpcap.c | |
parent | a301593846109b699860bb81bcda313e440b3bb5 (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.
svn path=/trunk/; revision=34340
Diffstat (limited to 'capture-wpcap.c')
-rw-r--r-- | capture-wpcap.c | 35 |
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) |