aboutsummaryrefslogtreecommitdiffstats
path: root/capture-wpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-09-23 17:54:49 +0000
committerGuy Harris <guy@alum.mit.edu>2004-09-23 17:54:49 +0000
commit29753bf6b2576c71421ae8d9c3e1ac50af8e8873 (patch)
tree3cb63f5548e6996c33882f725a2614dd0294a0ca /capture-wpcap.c
parent285066ac5bfcf1569cb86a56cca9825f8e416ada (diff)
From Gisle Vanem: add support for pcap_datalink_val_to_name() for Win32.
Also add support for pcap_datalink_name_to_val(), and arrange that we properly define HAVE_PCAP_DATALINK_NAME_TO_VAL and HAVE_PCAP_DATALINK_VAL_TO_NAME for MSVC++ builds. svn path=/trunk/; revision=12073
Diffstat (limited to 'capture-wpcap.c')
-rw-r--r--capture-wpcap.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/capture-wpcap.c b/capture-wpcap.c
index e81b737cb8..8e6c49b048 100644
--- a/capture-wpcap.c
+++ b/capture-wpcap.c
@@ -69,6 +69,12 @@ static int (*p_pcap_loop) (pcap_t *, int, pcap_handler, guchar *);
static int (*p_pcap_findalldevs) (pcap_if_t **, char *);
static void (*p_pcap_freealldevs) (pcap_if_t *);
#endif
+#ifdef HAVE_PCAP_DATALINK_NAME_TO_VAL
+static const char *(*p_pcap_datalink_name_to_val) (int);
+#endif
+#ifdef HAVE_PCAP_DATALINK_VAL_TO_NAME
+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);
@@ -102,6 +108,12 @@ load_wpcap(void)
SYM(pcap_findalldevs, TRUE),
SYM(pcap_freealldevs, TRUE),
#endif
+#ifdef HAVE_PCAP_DATALINK_NAME_TO_VAL
+ SYM(pcap_datalink_name_to_val, TRUE),
+#endif
+#ifdef HAVE_PCAP_DATALINK_VAL_TO_NAME
+ SYM(pcap_datalink_val_to_name, TRUE),
+#endif
SYM(pcap_lib_version, TRUE),
SYM(pcap_setbuff, TRUE),
{ NULL, NULL, FALSE }
@@ -250,6 +262,24 @@ pcap_freealldevs(pcap_if_t *a)
}
#endif
+#ifdef HAVE_PCAP_DATALINK_NAME_TO_VAL
+int
+pcap_datalink_name_to_val(const char *name)
+{
+ g_assert(has_wpcap && p_pcap_datalink_name_to_val != NULL);
+ return p_pcap_datalink_name_to_val(dlt);
+}
+#endif
+
+#ifdef HAVE_PCAP_DATALINK_VAL_TO_NAME
+const char *
+pcap_datalink_val_to_name(int dlt)
+{
+ g_assert(has_wpcap && p_pcap_datalink_val_to_name != NULL);
+ return p_pcap_datalink_val_to_name(dlt);
+}
+#endif
+
/* setbuff is win32 specific! */
int pcap_setbuff(pcap_t *a, int b)
{