Create nftables.yaml (#3325)

Created nftables syntax highlighting
This commit is contained in:
theredcmdcraft 2024-10-06 13:04:32 +02:00 committed by GitHub
parent 3b3fe63f19
commit ac73f18191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,20 @@
filetype: nftables
detect:
filename: "nftables.conf$"
header: "^(#!.*/(env +)?nft( |$)|flush +ruleset)"
rules:
- type: "\\b(chain|counter|map|rule|ruleset|set|table)\\b"
- type: "\\b(ether|icmp|icmpv6|icmpx|inet|ip|ip6|ipv4|ipv6|tcp|udp)\\b"
- special: "\\b(elements|hook|policy|priority|type)\\b"
- identifier: "\\b(ct|iif|iifname|meta|oif|oifname|th)\\b"
- statement: "\\b(accept|drop|goto|jump|log|masquerade|reject)\\b"
- preproc: "\\b(add|define|flush|include|delete)\\b"
- symbol: "[-=/:;,@]"
- symbol.operator: "[<>.&|^!]|\\b(and|ge|gt|le|lt|or|xor)\\b"
- constant.string: '([\"]{1})(.*)([\"]{1})'
- identifier.var: "[$@][a-zA-Z_.][a-zA-Z0-9_/.-]*"
- comment: "(^|[[:space:]])#([^{].*)?$"
- indent-char.whitespace: "[[:space:]]+$"
- indent-char: " + +| + +"