namib-project / nftables-rs

Safe abstraction for nftables JSON API (libnftables-json).
https://crates.io/crates/nftables
Apache License 2.0
23 stars 13 forks source link

Implement map support #11

Closed marcinosypka closed 7 months ago

marcinosypka commented 7 months ago

A Verdict enum was moved from a NamedExpression to an Expression, placing it in a NamedExpression was a bug. Accroding to libnftables-json(5) (section VERDICT) a Verdict does not have a "verdict" key, it is "anonymous". e.g.: { "jump": { "target": "my_target"}, and not: { "verdict": { "jump": { "target": "my_target"} } }

Additionally a Verdict::Jump and a Verdict::Goto data was changed to a stmt::JumpTarget struct from a String.

A Map and a Set use almost the same fields, a map additinally uses a map field of type String.

jwhb commented 7 months ago

@marcinosypka Great work, thank you!