Compare commits

..

2 Commits

Author SHA1 Message Date
Antonio Ojea fa641e9cea
Merge 5dae564e86 into 69f487d596 2025-02-02 12:08:44 -05:00
Antonio Ojea 5dae564e86 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-02 17:08:37 +00:00
1 changed files with 1 additions and 1 deletions

View File

@ -182,7 +182,7 @@ func main() {
log.Printf("Expected output:\n%s", string(expectedOutput)) log.Printf("Expected output:\n%s", string(expectedOutput))
log.Printf("Actual output:\n%s", actualOutput) log.Printf("Actual output:\n%s", actualOutput)
log.Fatalf("nftables ruleset mismatch:\n%s", cmp.Diff(expectedOutput, actualOutput)) log.Fatalf("nftables ruleset mismatch:\n%s", cmp.Diff(string(expectedOutput), actualOutput))
} }
if err := flushNFTRuleset(); err != nil { if err := flushNFTRuleset(); err != nil {