Commit Graph

33 Commits

Author SHA1 Message Date
rmind cbc7bab49c KNF 2016-12-27 20:32:58 +00:00
christos 52d8bce52a Add a function to iterate over endpoints 2016-12-27 20:14:07 +00:00
christos f75d79eb69 Sync NPF with the version on github: backport standalone NPF changes,
which allow us to create and run separate NPF instances. Minor fixes.
(from rmind@)
2016-12-26 23:05:05 +00:00
christos 5467719bc0 use array notation 2016-12-10 21:04:12 +00:00
christos 3d5a430c2b add npf_nat_lookup() 2016-12-10 05:37:55 +00:00
rmind 3e73e7e64b libnpf: add npf_rule_getid() and npf_rule_getcode().
Missed in the previous commit.
2015-02-02 00:55:28 +00:00
rmind a02b7176fb NPF: rework of the connection saving and restoring:
- Add support for saving a snapshot of the current connections together
  with a full configuration.  Support a reverse load operation.  Eliminate
  the old 'sess-save' and 'sess-load' in favour of the new mechanism.
- Share code between load and reload operations: the latter performs
  load from npf.conf without affecting the connections.
- Simplify and fix races with connection loading.
- Bump NPF_VERSION.
2014-07-23 01:25:34 +00:00
jakllsch c628b5784a add npf_ext_param_string() 2014-05-19 18:47:19 +00:00
rmind 068cee2998 NPF: add support for IPv6-to-IPv6 Network Prefix Translation (NPTv6),
as per RFC 6296.  Add a unit test.  Also, bump NPF_VERSION.

Thanks to S.P.Zeidler for the help with NPTv6 work!
2014-02-13 03:34:40 +00:00
rmind 8274d601f9 NPF: add support for static (stateless) NAT. 2014-02-07 23:45:22 +00:00
rmind ffcdc4af8d Add support for CDB based NPF tables. 2014-02-06 02:51:28 +00:00
rmind 55b0c96054 - npfctl: fix table IDs (breakage since the table naming was added).
- libnpf: remove npf_table_exists_p() from public API.
2014-02-03 02:21:52 +00:00
rmind 805a41fbfe Add npf_tableset_syncdict() to sync the table IDs in the proplib dictionary,
as they can change on reload now.  Also, fix table name checking in npfctl.
2013-11-22 00:25:51 +00:00
rmind 1e7342c150 NPF: add support for table naming and remove NPF_TABLE_SLOTS (there is
just an arbitrary sanity limit of NPF_MAX_TABLES currently set to 128).

Few misc fixes.  Bump NPF_VERSION.
2013-11-12 00:46:34 +00:00
rmind a79812ea10 NPF: add support for specifying the interfaces before they are attached.
If an interface is or gets detached, all associated rules and connections
will be deactivated (it might be useful to have an option to invalidate
the associated connections).  Once the interface is reattached they will
become active.

Bump NPF_VERSION.
2013-11-08 00:38:26 +00:00
rmind 7b5edfdc0d NPF: G/C n-code in favour of BPF byte-code. Delete lots of code, mmm! 2013-09-19 01:49:07 +00:00
rmind 4e592132ab - Convert NPF to use BPF byte-code by default. Compile BPF byte-code in
npfctl(8) and generate separate marks to describe the filter criteria.
- Rewrite 'npfctl show' functionality and fix some of the bugs.
- npftest: add a test for BPF COP.
- Bump NPF_VERSION.
2013-09-19 01:04:45 +00:00
christos bc0f55de88 Make ALG's autoloadable by providing in the config file:
alg "algname"
2013-03-20 00:29:46 +00:00
rmind 56910be779 - Convert NPF dynamic rule ID to just incremented 64-bit counter.
- Fix multiple bugs.  Also, update the man page.
2013-02-16 21:11:12 +00:00
rmind 50c5afcad4 - Fix NPF config reload with dynamic rules present.
- Implement list and flush commands on a dynamic ruleset.
2013-02-10 23:47:37 +00:00
rmind 0e21825481 NPF:
- Implement dynamic NPF rules.  Controlled through npf(3) library of via
  npfctl rule command.  A rule can be removed using a unique identifier,
  returned on addition, or using a key which is SHA1 hash of the rule.
  Adjust npftest and add a regression test.
- Improvements to rule inspection mechanism.
- Initial BPF support as an alternative to n-code.
- Minor fixes; bump the version.
2013-02-09 03:35:31 +00:00
rmind 57ff5416fd - Add NPF version check in proplist as well, not only ioctl. Bump the version.
- Fix a bug in table entry lookup.
- Updates/fixes to the man pages.  Misc.
2012-12-23 21:01:03 +00:00
rmind 8c6e21bf5e Implement dynamic NPF extensions interface. An extension consists of
dynamically loaded module (.so) supplementing npfctl(8) and a kernel
module.  Move normalisation and logging functionality into their own
extensions.  More improvements to come.
2012-09-16 13:47:41 +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 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 5f6fa3d5ee Add NPF config retrieval routines. 2012-04-01 19:16:24 +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 3552fa1ee9 - consistency with types
- prefer sizeof(*var)
2011-11-26 23:42:27 +00:00
rmind fc9011aa1d Add _npf_config_setsubmit() function. 2011-11-26 23:11:19 +00:00
zoltan 5a5d868dc5 Add IPv6 support for NPF. 2011-11-04 01:00:27 +00:00
rmind 07ac07d35f NPF checkpoint:
- Add libnpf(3) - a library to control NPF (configuration, ruleset, etc).
- Add NPF support for ftp-proxy(8).
- Add rc.d script for NPF.
- Convert npfctl(8) to use libnpf(3) and thus make it less depressive.
  Note: next clean-up step should be a parser, once dholland@ will finish it.
- Add more documentation.
- Various fixes.
2011-02-02 02:20:24 +00:00