fix nftables syntax

This commit is contained in:
Daniel Barlow
2023-06-18 22:18:44 +01:00
parent a65bb9d585
commit d66f5901a2
2 changed files with 37 additions and 31 deletions

View File

@@ -31,17 +31,20 @@ let
indent = text : indentLines 0 (splitString "\n" text);
dochain = { name, type, family, rules, policy ? null, hook ? null } : ''
dochain = { name, type, family, rules,
policy ? null,
priority ? "filter",
hook ? null } : ''
chain ${name} {
${if hook != null
then "type ${type} hook ${hook}; policy ${policy};"
then "type ${type} hook ${hook} priority ${priority}; policy ${policy};"
else ""
}
${concatStringsSep "\n" rules}
}
'';
dotable = family : chains : ''
table ${family} ${family} {
table ${family} table-${family} {
${concatStringsSep "\n" (map dochain chains)}
}
'';