Commit Graph

13 Commits

Author SHA1 Message Date
vsandonis 0aa65c0fdd
Fix Objref expression parsing ()
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 ()
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 ()
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 () 2019-08-25 23:43:47 +02:00
Serguei Bezverkhi 6925991d82 Meta SREG and DREG ()
* 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 () 2019-04-30 17:07:43 +02:00
Michael Stapelberg 409eade12e switch to new netlink.AttributeDecoder
fixes 
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