diff options
author | Roland Dreier <roland@purestorage.com> | 2017-05-17 19:53:46 -0700 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2017-08-25 10:47:31 -0700 |
commit | f5f1484a931851d2d3b67d6033aedea8da5acb42 (patch) | |
tree | c01d2a111966be6c14fd010102d8eb92d1835bad /pcap-rdmasniff.h | |
parent | 3a39b1d782dd36cffec621bd44ac238168d6594e (diff) |
RDMA sniffing support for pcap
Implement capture support for offloaded RDMA traffic. This uses the RDMA
verbs "flow steering" interface, which is available in the Linux kernel
since version 3.12. The userspace interface is ibv_create_flow() - so
building this support in pcap adds a new dependency on libibverbs.
I added a new "rdmasniff" pcap module, which exposes RDMA devices under an
interface name equal to their libibverbs name. The module uses the RDMA
verbs interface to create a receive queue with a flow steering rule that
gets a copy of all packets, even offloaded packets generated by or consumed
by the hardware.
The autoconf test for a usable version of libibverbs is a bit complicated
because ibv_create_flow() is defined as an inline function in the header
file, so we need to find the library and header and then try to link a
program to check if the API is usable (it appeared in libibverbs 1.1.8).
Diffstat (limited to 'pcap-rdmasniff.h')
-rw-r--r-- | pcap-rdmasniff.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pcap-rdmasniff.h b/pcap-rdmasniff.h new file mode 100644 index 00000000..ff1f3c20 --- /dev/null +++ b/pcap-rdmasniff.h @@ -0,0 +1,2 @@ +pcap_t *rdmasniff_create(const char *device, char *ebuf, int *is_ours); +int rdmasniff_findalldevs(pcap_if_list_t *devlistp, char *err_str); |