aboutsummaryrefslogtreecommitdiffstats
path: root/capture-wpcap.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-09-23 17:54:49 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-09-23 17:54:49 +0000
commite17eed023902bb9821321d1c606a42c2cde86200 (patch)
tree3cb63f5548e6996c33882f725a2614dd0294a0ca /capture-wpcap.c
parent5583c5128c2667c453fb16fb30254c31d253c9bb (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12073 f5534014-38df-0310-8fa8-9805f1628bb7
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)
{