From 88a9628529e748b7dd6d93fe5dc324414a4da016 Mon Sep 17 00:00:00 2001 From: ulfl Date: Sat, 21 May 2005 09:59:49 +0000 Subject: bugfix: mark pcap_freecode() as optional, as it's not available by WinPcap 2.3 add optional pcap_next_ex() which is currently unused git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14412 f5534014-38df-0310-8fa8-9805f1628bb7 --- capture-wpcap.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'capture-wpcap.c') diff --git a/capture-wpcap.c b/capture-wpcap.c index 7228f953c7..d43bbda2e3 100644 --- a/capture-wpcap.c +++ b/capture-wpcap.c @@ -78,6 +78,7 @@ static const char *(*p_pcap_datalink_val_to_name) (int); #endif static const char *(*p_pcap_lib_version) (void); static int (*p_pcap_setbuff) (pcap_t *, int dim); +static int (*p_pcap_next_ex) (pcap_t *, struct pcap_pkthdr **pkt_header, u_char **pkt_data); typedef struct { const char *name; @@ -105,7 +106,7 @@ load_wpcap(void) SYM(pcap_lookupnet, FALSE), SYM(pcap_open_live, FALSE), SYM(pcap_loop, FALSE), - SYM(pcap_freecode, FALSE), + SYM(pcap_freecode, TRUE), #ifdef HAVE_PCAP_FINDALLDEVS SYM(pcap_findalldevs, TRUE), SYM(pcap_freealldevs, TRUE), @@ -118,6 +119,7 @@ load_wpcap(void) #endif SYM(pcap_lib_version, TRUE), SYM(pcap_setbuff, TRUE), + SYM(pcap_next_ex, TRUE), { NULL, NULL, FALSE } }; @@ -250,7 +252,9 @@ void pcap_freecode(struct bpf_program *a) { g_assert(has_wpcap); - p_pcap_freecode(a); + if(p_pcap_freecode) { + p_pcap_freecode(a); + } } #ifdef HAVE_PCAP_FINDALLDEVS @@ -418,6 +422,13 @@ int pcap_setbuff(pcap_t *a, int b) return p_pcap_setbuff(a, b); } +/* next_ex is win32 specific! */ +int pcap_next_ex (pcap_t *a, struct pcap_pkthdr **b, u_char **c) +{ + g_assert(has_wpcap); + return p_pcap_next_ex(a, b, c); +} + /* * This will use "pcap_findalldevs()" if we have it, otherwise it'll * fall back on "pcap_lookupdev()". -- cgit v1.2.3