diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-05-21 09:59:49 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-05-21 09:59:49 +0000 |
commit | 88a9628529e748b7dd6d93fe5dc324414a4da016 (patch) | |
tree | 1126172a05ea0e3d65d1cebe38bd10af3a2735a1 | |
parent | fa1317cd942571234966e1b2c233c5d796425f62 (diff) |
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
-rw-r--r-- | capture-wpcap.c | 15 | ||||
-rw-r--r-- | config.h.win32 | 3 |
2 files changed, 16 insertions, 2 deletions
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()". diff --git a/config.h.win32 b/config.h.win32 index 930b1b4e25..e45839a22e 100644 --- a/config.h.win32 +++ b/config.h.win32 @@ -58,6 +58,9 @@ @WPCAP_CONSTIFIED@ @HAVE_LIBETHEREALDLL@ +/* availability of pcap_freecode() is handled at runtime */ +#define HAVE_PCAP_FREECODE 1 + /* define macro for importing variables from an dll * it depends on HAVE_LIBETHEREAL and _NEED_VAR_IMPORT_ */ |