#bindings #gnu-linux #pf-ring

sys pfring-sys

Bindings to PF_RING for GNU/Linux

1 unstable release

0.0.1 Dec 4, 2018

#2906 in #bindings

MIT license

1.5MB
44K SLoC

Contains (ELF exe/lib, 32KB) test.o, (ELF exe/lib, 31KB) test, (debian package, 7KB) apt-ntop.deb

rust pfring-sys

Date:2018/12/04

Contents

Build

安装预编译的 PF_RING 内核模块以及用户态的 API:

# Debian
wget http://apt.ntop.org/stretch/all/apt-ntop.deb
dpkg -i apt-ntop.deb
apt install pfring pfring-dkms pfring-drivers-zc-dkms

从源码开始编译 PF_RING 内核模块 以及用户态 API:

# Debian
sudo apt install bison flex

git clone https://github.com/ntop/PF_RING.git

cd  PF_RING/driver
make

cd  PF_RING/kernel
make

cd PF_RING/userland
make libpfring pcap build_examples

构建对 Rust 的绑定:

cargo build

使用样例

Rust 语言样例:

cargo build --example dump
sudo ./target/debug/dump

C 语言样例:

cc examples/dump.c -Wall -g -lpfring -lpcap -o dump
sudo ./dump

Dependencies