Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] Re: [Patch] HAVE_PCAP_DATALINK_NAME_TO_VAL

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Gisle Vanem" <giva@xxxxxxxxx>
Date: Thu, 23 Sep 2004 19:13:27 +0200
> Building with this define requires this patch to capture-wpcap.c. Attached.

Sorry, should be this patch.

--gv
--- ethereal-2004-09-23/capture-wpcap.c	Tue Aug 10 07:27:50 2004
+++ capture-wpcap.c	Thu Sep 23 18:14:42 2004
@@ -69,6 +69,9 @@
 static int     (*p_pcap_findalldevs) (pcap_if_t **, char *);
 static void    (*p_pcap_freealldevs) (pcap_if_t *);
 #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 +105,9 @@
 		SYM(pcap_findalldevs, TRUE),
 		SYM(pcap_freealldevs, 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 }
@@ -247,6 +253,15 @@
 {
 	g_assert(has_wpcap && p_pcap_freealldevs != NULL);
 	p_pcap_freealldevs(a);
+}
+#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