59 Commits

Author SHA1 Message Date
rjs
5abdc4ce9a Allow build with MKRUMP=no. 2012-09-12 19:20:37 +00:00
martin
9cf2fc91c7 Fix printf format 2012-09-12 16:26:02 +00:00
martin
18d0240310 Install the npftest binary 2012-09-12 14:06:02 +00:00
martin
a76a87c096 Add two new command line options to help integration into ATF:
-L lists the available test cases, -T executes a single named test.
2012-09-12 08:47:14 +00:00
rmind
8f51214c07 npfctl usage: minor formatting fix. 2012-09-01 19:08:01 +00:00
rmind
b8c27e4a39 npftest:
- Do not stop running other tests, if some tests fail.
- Fix some endianness bugs in the test cases.

Tested on sparc64 by martin@, all tests pass.
2012-08-21 20:52:11 +00:00
rmind
e0cfa502eb Add npf_state_setsampler() for _NPF_TESTING case. This also fixes the build. 2012-08-15 19:47:38 +00:00
rmind
68f7a7bc54 Move and rename librumpdev_npf to librumpnet_npf. 2012-08-14 22:31:43 +00:00
rmind
f95b2549d9 - npfctl show: add most of the missing cases.
- Few minor improvements to NPF man pages.
2012-08-13 01:18:31 +00:00
rmind
63f44833ba - Extend npftest: add ruleset inspection testing from the config generated
by npfctl debug functionality.  Auto-create npftest interfaces for this.
- NPF sessions: combine protocol and interface into a separate substructure,
  share between the entries and thus fix the handling of them.  Constify.
- npftest: add regression tests for NAT policies.
- npf_build_nat: simplify and fix bi-NAT regression.
- Bump yacc stack size for npfctl.
2012-08-12 03:35:13 +00:00
rmind
4ad5029440 - npf_fetch_tcpopts: fix off-by-one when validating TCP option length
against the maximum allowed.
- npf_tcp_inwindow: be more liberal with npf_fetch_tcpopts().
- Few minor improvements to npftest.
2012-07-21 17:11:01 +00:00
rmind
083c690112 - npfctl_print_stats: beautification a la French style.
- npfctl_icmpcode: fix the build break.
2012-07-19 22:22:53 +00:00
spz
7cf84a83d6 teach npf ipv6-icmp
reviewed by rmind@
2012-07-19 21:52:29 +00:00
joerg
7219ead3a1 Add missing __dead. 2012-07-19 06:31:26 +00:00
rmind
a3b239f6f3 - Rework NPF tables and fix support for IPv6. Implement tree table type
using radix / Patricia tree.  Universal IPv4/IPv6 comparator for ptree(3)
  was contributed by Matt Thomas.
- NPF tables: update regression tests, improve npfctl(8) error messages.
- Fix few bugs when using kernel modules and handle module autounloader.
- Few other fixes and misc cleanups.
- Bump the version.
2012-07-15 00:22:58 +00:00
rmind
33b678d7e0 NPF improvements:
- Add NPF_OPCODE_PROTO to match the address and/or protocol only.
- Update parser to support arbitrary "pass proto <name/number>".
- Fix IPv6 address and protocol handling (add a regression test).
- Fix few theorethical races in session handling module.
- Misc fixes, simplifications and some clean up.
2012-07-01 23:21:06 +00:00
rmind
4940c18bab Fix and update npf.conf(5), npfctl(8) and its usage message. 2012-06-27 23:05:28 +00:00
rmind
53e5b8cc71 NPF:
- Rename some functions for consistency and de-inline them.
- Fix few invalid asserts (add regressoin test).
- Use pserialize(9) for ALG interface.
- Minor fixes, sprinkle many comments.
2012-06-22 13:43:17 +00:00
christos
b416920400 remove error(1) output 2012-06-16 01:34:10 +00:00
christos
55cd49b90e make this compile again. 2012-06-16 01:31:33 +00:00
rmind
7a3e0c216a - Rework NPF NAT syntax to be more structured and support future additions
of different types and configurations of NAT.
- npfctl: improve disassemble and show-config command functionality.
- Fix custom ICMP code and type filtering.
2012-06-15 23:24:08 +00:00
rmind
79afee64f7 npftest: add a module for TCP state tracking and add few test cases. 2012-06-04 00:28:34 +00:00
wiz
1c095f6bdd Remove superfluous Pp 2012-05-30 22:00:44 +00:00
rmind
fb07f475c0 npftest: add a stream processor, which prints out the TCP state information.
A tool for debugging connection tracking from tcpdump -w captured data.
2012-05-30 21:38:03 +00:00
rmind
ac69c0c39c npfctl(8): add show-config command. Also, update syntax. 2012-05-30 21:30:07 +00:00
rmind
9ffbe6bd3d Add initial NPF regression tests integrated with RUMP framework (running the
kernel part of NPF in userland).  Other tests will be added once converted to
RUMP framework.  All tests are in the public domain.

Some Makefile fixes from christos@.
2012-04-14 21:57:29 +00:00
christos
da8fd09e2d don't leak the branch target array. 2012-03-12 15:32:02 +00:00
christos
65aaee04ca - better printing of type/code flags/mask
- pass the instruction start pointer, instead of subtracting 1 to account for it
2012-03-10 22:55:28 +00:00
christos
a2855f0d2c Add a small disassembler. 2012-03-10 22:21:50 +00:00
christos
46641ee3e7 remove extra rule that got merged... 2012-02-26 22:04:42 +00:00
christos
394473e707 - make each element of a variable hold a type
- change get_type to take an index, so we can get the individual types of
  each element (since primitive elements can be in lists)
- make port_range primitive
- add a routine to convert a variable of primitives to a variable containing
- only port ranges.
2012-02-26 21:50:05 +00:00
rmind
2d942d9d58 Simplify slightly: merge iface into addr_or_iface, use it in filt_addr. 2012-02-26 21:14:50 +00:00
rmind
15d58f91b8 - Add NPF_DECISION_BLOCK and NPF_DECISION_PASS. Be more defensive in the
packet handler.  Change the default policy to block when the config is
  loaded and set it to pass when flush operation is performed.
- Use kmem_zalloc(9) instead of kmem_alloc(9) in few places.
- npf_rproc_{create,release}: use kmem_intr_{alloc,free} as the destruction
  of rule procedure might happen in the interrupt handler (under a very rare
  condition, if config reload races with the handler).
- npf_session_establish: check whether layer 3 and 4 are cached.
- npfctl_build_group: do not make groups as passing rules.
- Remove some unecessary header inclusion.
2012-02-20 00:18:19 +00:00
rmind
4d11ce4d7b Fix the family option in the grammar and example. 2012-02-06 00:41:36 +00:00
rmind
d47695fbde - Handle NPF rule procedures in the parser and thus re-enable them.
- Few small updates to the man page.
2012-02-06 00:37:52 +00:00
rmind
f7fec0d2a4 Multiple NPF fixes, add better error reporting from kernel side, add some
asserts, bump the version.
2012-02-05 00:37:13 +00:00
rmind
4b85474b41 - Expire all sessions on flush.
- Enable checking for zero mask in IP{4,6}MATCH after npfctl changes.
- Make locking symmetric for npf_ruleset_inspect().
- Sync function prototypes in npf(3) man page with reality.
- Rename NPF_TABLE_RBTREE to NPF_TABLE_TREE.
2012-01-15 00:49:47 +00:00
christos
a079a21d6c handle variables that contain variables 2012-01-12 20:41:33 +00:00
joerg
4c70cdf100 Use __dead 2012-01-10 23:39:11 +00:00
rmind
ee48c623f2 npfctl_ncgen_putptr: use correct format for size_t. 2012-01-09 01:47:09 +00:00
christos
058e423965 update. 2012-01-08 22:14:55 +00:00
rmind
d3c56566f0 Full rewrite of npfctl(8) parser and rework of n-code generation part.
Fixes most of the known bugs and issues with the utility.  Note: rule
procedures are not yet (as we want to make them fully modular).

Huge thanks to Martin Husemann who wrote the parser and Christos Zoulas
who wrote intermediate structures and helped to complete the work.
2012-01-08 21:34:21 +00:00
riz
8747d13883 Remove quotes from "hash" and "tree" in the table examples so
the example stands a chance of actually working as written.  There appear
to be other problems, too.
2011-11-29 01:12:09 +00:00
jakllsch
7c5be444d3 freeaddrinfo() only on getaddrinfo() success. 2011-11-05 19:19:29 +00:00
zoltan
5a5d868dc5 Add IPv6 support for NPF. 2011-11-04 01:00:27 +00:00
joerg
bec77c5f43 Use __dead 2011-08-31 13:32:36 +00:00
jruoho
b0ced04988 As per request from the author, put non-standard PERFORMANCE back. 2011-03-24 05:48:54 +00:00
jruoho
761da725b5 Use 'offset indent' for the list of commands. Emphasize valid commands.
Remove PERFORMANCE (too small paragraph to warrant a section).
2011-03-22 07:40:10 +00:00
jruoho
b9f2143d66 Use .Ss for non-standard subtitles in the DESCRIPTION. 2011-03-22 07:31:42 +00:00
rmind
3bb326c464 Fix sun2 builds. Noted by joerg@. 2011-02-04 00:19:51 +00:00