Commit Graph

20 Commits

Author SHA1 Message Date
Lionel Jouin 0b98a7af91
Replace TODO const by golang.org/x/sys/unix (#256)
Replace some hardcoded consts by the ones provided in
golang.org/x/sys/unix
2024-03-18 08:32:45 +01:00
Francesco Cheinasso ef45dd3322
NAT: prefix support (#251) 2023-12-22 08:33:18 +01:00
Rafael Campos 98de8c8ac9 expr: Add Hash to the expr type
Add the Hash type to the expr read parser.

Signed-off-by: Rafael Campos <methril@gmail.com>
2023-06-14 20:10:15 +02:00
turekt 9aa6fdf5a2
Masq marshal fix (#214)
Fixes https://github.com/google/nftables/issues/213
2023-01-15 21:51:35 +01:00
turekt 130caa4c31
Reject expression fix (#206)
Added missing reject expression to exprsFromMsg
2022-11-07 20:04:33 +01:00
turekt c89a57ce19
Flowtables implementation (#201)
Added flowtables implementation | Added flow_offload expression | Added tests
2022-11-01 07:48:00 +01:00
Andrew LeFevre d007ae63f1
fix queue expression getting skipped when unmarshaling rules (#197) 2022-10-15 19:08:15 +02:00
vsandonis 0aa65c0fdd
Fix Objref expression parsing (#193)
The Objref expression was not considered when parsing raw expressions
bytes to construct nftables expressions.

Add unit test to check that a rule with an Objref expression is
properly obtained by GetRules().

Signed-off-by: Victor Sandonis Consuegra <vsandonis@ibm.com>
2022-09-28 18:33:16 +02:00
Rafael Campos Las Heras 2eca001357
Fix Meta unmarshal when is Source Register (#174)
The Meta nftables expression was not filling the Register and SourceRegister
fields when unmarshalling.

Add a check for NFTA_META_SREG message when unmarshalling to fill the Meta
fields.
Add Unit Test for source and destination unmarshall.

Signed-off-by: Rafael Campos <rafael.campos.lasheras@ibm.com>
2022-08-08 17:45:52 +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
thediveo 3e042f75d7 refactor: pass table family when un/marshalling expr 2022-05-15 23:12:26 +02:00
Serguei Bezverkhi ec0390b058 Extend Masq support and add unit testing (#52) 2019-08-25 23:43:47 +02:00
Serguei Bezverkhi 6925991d82 Meta SREG and DREG (#51)
* meta requires to use source and destination registers

Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
2019-08-19 23:36:36 +02:00
Ryan Whelan 07c974e364 fix: Typo in unmarshal on Cmp struct (#14) 2019-04-30 17:07:43 +02:00
Michael Stapelberg 409eade12e switch to new netlink.AttributeDecoder
fixes #2
2018-08-10 18:59:05 +02:00
Michael Stapelberg 2338808f3c fix expr.Cmp unmarshaling 2018-06-28 20:05:16 +02:00
Michael Stapelberg 1324f5d5a9 add GetRule 2018-06-23 21:12:14 +02:00
Michael Stapelberg 0ba4d9997a Cmp: fix accidentally hard-coded EQ operator 2018-06-14 22:26:13 +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