NetBSD/usr.sbin/npf/npftest
rmind 04cb50ac51 libnpf/npfctl: support dynamic NAT rulesets using a name prefix. 2019-09-30 00:37:11 +00:00
..
libnpftest - npfctl_load_nvlist: simplify the config loading logic. 2019-08-25 13:21:03 +00:00
Makefile Get rid of all the -lrumpdev and -lrumpvfs that are no longer needed 2019-05-13 17:55:07 +00:00
README
npfstream.c NPF improvements: 2019-07-23 00:52:01 +00:00
npftest.c NPF improvements: 2019-07-23 00:52:01 +00:00
npftest.conf libnpf/npfctl: support dynamic NAT rulesets using a name prefix. 2019-09-30 00:37:11 +00:00
npftest.h

README

$NetBSD: README,v 1.7 2018/09/29 14:41:36 rmind Exp $

npftest - a tool for regression testing and debugging NPF.
It uses RUMP framework to run NPF kernel module in the userspace.

---

Test:

npfctl debug npftest.conf /tmp/npf.nvlist
npftest -c /tmp/npf.nvlist -t

Stream:

tcpdump -w stream.pcap -i $interface "host $host and tcp"
npfctl debug npftest.conf /tmp/npf.nvlist
npftest -c /tmp/npf.nvlist -s stream.pcap > stream_npf_data.txt

Preferably, use MALLOC_OPTIONS="AJ" and/or other facilities.

Benchmark:

npftest -b rule -c /tmp/npf.nvlist -p $ncpu

---

Update RUMP libraries once the kernel side has been changed.  Hint:

cd src/sys/net/npf
sudo make includes

cd src/sys/rump/net/lib/libnpf
make distclean
MKDEBUG=yes MKDEBUGLIB=yes DBG="-g -O2" make -j8
sudo MKDEBUG=yes MKDEBUGLIB=yes DBG="-g -O2" make install