aboutsummaryrefslogtreecommitdiff
path: root/pcap-linux.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-05-16 12:18:33 -0700
committerGuy Harris <guy@alum.mit.edu>2017-05-16 12:18:33 -0700
commita8578d4f2fd5ea365f93846cf3da7f4151d7404d (patch)
treeea769d57ee750e35e982810d2bd0ba28bc4d03f2 /pcap-linux.c
parentcbffeaeb5880d49be4fb4d66055787c6b7f4cc1d (diff)
Allow a platform to add information to the version string.
For example, on Linux, we add information about memory-mapped capture support; see comments on GitHub issue #600.
Diffstat (limited to 'pcap-linux.c')
-rw-r--r--pcap-linux.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/pcap-linux.c b/pcap-linux.c
index 1ee10ddb..ae29bf57 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -6916,3 +6916,22 @@ reset_kernel_filter(pcap_t *handle)
return 0;
}
#endif
+
+/*
+ * Platform-specific information.
+ */
+const char *
+pcap_platform_lib_version(void)
+{
+#ifdef HAVE_PACKET_RING
+ #if defined(HAVE_TPACKET3)
+ return ("with TPACKET_V{1,2,3} support");
+ #elif defined(HAVE_TPACKET2)
+ return ("with TPACKET_V{1,2} support");
+ #else
+ return ("with TPACKET_V1 support");
+ #endif
+#else
+ return ("without TPACKET support");
+#endif
+}