FreeBSD/src aeddee8 — sbin/pfctl parse.y pfctl.c, sbin/pfctl/tests pfctl_test.c pfctl_test_list.inc
pfctl: Split pool parsing into separate functions The pf pools are used in NAT, route-to and af-to rules. Some parts of code are duplicated between them. Create functions apply_redirspec(), apply_nat_ports() and apply_rdr_ports() to handle the common tasks. Simplify data structures used for pool parsing. Move the contents of struct redirection to struct redirspec. Map all ways of parsing pools directly onto struct redirspec. Name various forms of struct redirspect to hint where they are used. Remove struct redirspec *rroute from struct filter_opts, because filter_opts is bzero()'ed after the route part of rule is parsed, and thus can't be used. Add tests to ensure that parsing and error messages behave as expected. The tests have been written and tested with pfctl from before this patch. [6 lines not shown]
Delta | File | |
---|---|---|
+260 | -309 | sbin/pfctl/parse.y |
+162 | -32 | sbin/pfctl/tests/pfctl_test.c |
+37 | -0 | sbin/pfctl/tests/pfctl_test_list.inc |
+10 | -0 | sbin/pfctl/pfctl.c |
+3 | -0 | sbin/pfctl/tests/files/pf1054.in |
+1 | -1 | sbin/pfctl/tests/files/pf1026.ok |
+473 | -342 | 77 files not shown |
+550 | -344 | 83 files |