adds a flush command to the top of the example ruleset so that nftables rules are applied on a clean state.
adds tests that check args passing to nft with get_current_ruleset and specifying invalid nft binary.
The current code cannot handle the ParloadRaw type, serde is unable to
deserialize the json with a raw payload fields.
This is because serde cannot handle two fields with the same name and I
haven't found a way to make this work like that. Instead we have to use
a untagged enum that share both possible payload values.
Therefore this is an API break: NamedExpression now only contains one
Payload field which contains the Payload enum, the old Payload type is
renamed to PayloadField.
Lastly, export the PayloadRaw fields so they can be used externally.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
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`.