freebsd-dev/sbin/pfctl/tests/files/pf0001.in
Kristof Provost 4d7709ddf6 pfctl parser tests
Copy the most important test cases from OpenBSD's corresponding
src/regress/sbin/pfctl, those that run pfctl on a test input file and check
correctness of its output. We have also added some new tests using the same
format.

The tests consist of a collection of input files (pf*.in) and
corresponding output files (pf*.ok). We run pfctl -nv on the input
files and check that the output matches the output files. If any
discrepancy is discovered during future development in the source
tree, we know that a regression bug has been introduced into the tree.

Submitted by:	paggas
Sponsored by:	Google, Inc (GSoC 2017)
Differential Revision:	https://reviews.freebsd.org/D11322
2017-07-15 19:22:01 +00:00

9 lines
387 B
Plaintext

pass in all
pass in from any to any no state
pass in proto tcp from any port <= 1024 to any label foo_bar
pass in proto tcp from any to any port = 25
pass in proto tcp from 10.0.0.0/8 port > 1024 to ! 10.1.2.3 port != 22
pass in proto igmp from 10.0.0.0/8 to 10.1.1.1 allow-opts
pass in proto tcp from { 1.2.3.4, 1.2.3.5 } to any label \
"$nr:$proto:$srcaddr:$srcport:$dstaddr:$dstport"