1 # Compiling and using libpcap with Myricom network adapters
3 On Linux, a Myricom network adapter by default works as a regular network
4 interface using the `myri10ge.ko` kernel module. To support such interfaces,
5 libpcap does not require any additional setup and the rest of this document
8 It is also possible to use the `myri_snf.ko` kernel module, which is a part of
9 the SNF software , which can be installed separately. To support a Myricom
10 network adapter, the module requires it to have a valid SNF licence, then it
11 makes supported adapters available as both regular network interfaces and
12 capture-optimized SNF devices. To support the SNF devices, libpcap needs to
13 be compiled in a specific way.
15 Two versions of the SNF software exist: SNFv3 and SNFv5. Depending on the
16 hardware model, a Myricom adapter may be compatible with either SNFv3 or SNFv5.
17 This version of libpcap has been tested on Linux/AMD64 using SNFv3 version
18 3.0.26.50935 and a Myricom 10G-PCIE2-8C2-2S adapter. Other operating systems
23 1. [Download](https://www.ariacybersecurity.com/support/downloads/) the SNF
24 software and its documentation, unpack the software to a directory.
25 2. Build the `myri_snf.ko` kernel module in the unpacked SNF software
26 directory, load it and verify that the module accepts the hardware as SNF
32 insmod ./sbin/myri_snf.ko
35 3. Configure and build libpcap. For example, using Autoconf:
38 ./configure [--with-snf=DIR] [--with-pcap=snf]
40 Here `DIR` is the directory with the unpacked SNF software if the directory
41 is not the default `/opt/snf/`, and `--with-pcap=snf` would request an
42 SNF-only build of libpcap if required. If `configure` has detected the SNF
43 software correctly, it will report:
45 configure: using Myricom SNF API headers from /path/to/snf/include
46 configure: using Myricom SNF API libraries from /path/to/snf/lib
48 Then run `make testprogs`.
49 4. Verify that the compiled libpcap detects the SNF device(s)s using the SNF
52 LD_LIBRARY_PATH=/path/to/snf/lib ./testprogs/findalldevstest
54 In the output of `findalldevstest` SNF devices should have "Myricom snf" in
57 ## Supported libpcap features
58 The only supported link-level header type is `DLT_EN10MB`.
60 [**pcap_findalldevs**](https://www.tcpdump.org/manpages/pcap_findalldevs.3pcap.html)(3PCAP)
61 is supported. The connection status flags of each device reflect what the SNF
62 API reports for the device, not what the regular network interface reports.
64 [**pcap_setfilter**](https://www.tcpdump.org/manpages/pcap_setfilter.3pcap.html)(3PCAP)
65 is supported, BPF programs run in userspace.
67 [**pcap_inject**](https://www.tcpdump.org/manpages/pcap_inject.3pcap.html)(3PCAP)
70 [**pcap_setnonblock**](https://www.tcpdump.org/manpages/pcap_setnonblock.3pcap.html)(3PCAP)
73 [**pcap_get_selectable_fd**](https://www.tcpdump.org/manpages/pcap_get_selectable_fd.3pcap.html)(3PCAP)
76 [**pcap_setdirection**](https://www.tcpdump.org/manpages/pcap_setdirection.3pcap.html)(3PCAP)
79 ## Vendor contact details
80 [Main web site](https://www.cspi.com/)
82 [Technical support](https://www.ariacybersecurity.com/support/)
84 aria_support@ariacybersecurity.com