Commit Graph

8 Commits

Author SHA1 Message Date
Antonio Ojea 1e48c1007e nf2go: convert nftables rules to golang code
One of the biggest barriers to adopt the netlink format for nftables is
the complexity of writing bytecode.

This commits adds a tool that allows to take an nftables dump and
generate the corresponding golang code and validating that the generated
code produces the exact same output.

Change-Id: I491b35e0d8062de33c67091dd4126d843b231838
Signed-off-by: Antonio Ojea <aojea@google.com>
2025-02-03 15:16:57 +00:00
turekt 912dee68b1
Refactor expr for obj reimplementation (#265)
Added marshalData func to expressions
Prepare parseexprfunc for obj implementation refactor

related to #253
2024-07-24 08:26:13 +02:00
Steffen Vogel 971247e1b2 Move setup/teardown of system NFT connection to internal package
As we want to reuse it also in other test packages.

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-04-18 08:53:20 +02:00
turekt ec1e802faf
Added dynset exprs support (#173)
fixes https://github.com/google/nftables/issues/172

- Rearranged `exprFromMsg` function
- Rearranged limit expr marshaling logic
- Added dynamic flag for sets
- Implemented connlimit
- Added missing constants 
- Added tests
2022-07-29 18:32:59 +02:00
Michael Stapelberg 2025aec0d2 nftest: generate message acknowledgements
Previously, the code just returned the input requests, which happened to work
2022-06-11 23:25:19 +02:00
Michael Stapelberg 2719b9add1 refactor common test code into package nftest
Converting more test functions to use it (and then splitting out test
functions into their own files) is left for a follow-up commit.
2022-06-11 23:10:56 +02:00
Michael Stapelberg dab6002a09 add enough expressions to express port forwardings 2018-06-04 23:13:54 +02:00
Michael Stapelberg afbe6ed893 Initial commit 2018-05-24 22:09:26 -07:00