path: root/pcap-linux.c
diff options
authorChristian Bell <csbell@myri.com>2010-01-26 11:58:37 -0800
committerGuy Harris <guy@alum.mit.edu>2010-01-26 11:58:37 -0800
commite1539bdbcb636f3fc3d3982bc3ee1987d6c00643 (patch)
treea4d1af908d716c1918b171d9088231568f3a0b27 /pcap-linux.c
parentecd955e0df1a2471542119c947c351dcd94cb234 (diff)
Add Myricom SNF API support as a new pcap device.
This patch adds support for our NICs when run in a specialized capture mode. It is diffed against the current master. The Myricom Sniffer10G software uses Myri-10G programmable Network Interface Cards (NICs), a firmware extension, a specialized driver and a user-level library (libsnf) to enable sustained capture of 10-Gigabit Ethernet traffic. Small-packet coalescing and an efficient zero-copy path to host memory allow Sniffer10G to capture streams at line rate for all Ethernet packet sizes. Optionally, libpcap can be used concurrently by multiple processes on a single NIC port to partition the incoming traffic across processes. While the Linux kernel enables this through multiple receive queues, the difference is that the myri_snf driver cooperates with libsnf to set up multiple queues that are each independently accessible through user-space. More information here: http://www.myri.com/scs/SNF/doc Signed-off-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'pcap-linux.c')
1 files changed, 16 insertions, 0 deletions
diff --git a/pcap-linux.c b/pcap-linux.c
index 6df107d..af12543 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -170,6 +170,10 @@ static const char rcsid[] _U_ =
#include "pcap-septel.h"
#endif /* HAVE_SEPTEL_API */
+#ifdef HAVE_SNF_API
+#include "pcap-snf.h"
+#endif /* HAVE_SNF_API */
#include "pcap-usb-linux.h"
@@ -376,6 +380,13 @@ pcap_create(const char *device, char *ebuf)
#endif /* HAVE_SEPTEL_API */
+#ifdef HAVE_SNF_API
+ handle = snf_create(device, ebuf);
+ if (strstr(device, "snf") || handle != NULL)
+ return handle;
+#endif /* HAVE_SNF_API */
if (strstr(device, "bluetooth")) {
return bt_create(device, ebuf);
@@ -2100,6 +2111,11 @@ pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
return (-1);
#endif /* HAVE_SEPTEL_API */
+#ifdef HAVE_SNF_API
+ if (snf_platform_finddevs(alldevsp, errbuf) < 0)
+ return (-1);
+#endif /* HAVE_SNF_API */
* Add Bluetooth devices.