$NetBSD: README,v 1.8 2026/10/24 15:54:55 joe 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 -c $test_config -o /tmp/npf.nvlist

$test_config (Test configuration files) are either npftest.conf or npftestl3.conf

npftest.conf - contains rules for layer 2 and 3.
npftestl3.conf - contains rules for layer 3 only

npftest -c /tmp/npf.nvlist -t   /* for regression in al testnames */

npftest -c /tmp/npf.nvlist -T $testname /* for a specific test */

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
