Refactor nft
front-end to properly parse bytecode
#182
Labels
area: front-end
Front-ends: parsing and translation
Milestone
Plenty of new features have been introduced during H2 2024 which are supported by
bfcli
. Thenft
front-end hasn't progressed at the same speed due to many limitations with its current implementation, makingbpfilter
unusable withnftables
.The front-end's logic is the following:
nftables
CLI binary parse the user-define rules and converts them intonft
bytecodelibbpfilter
(linked tonftables
) send the bytecode to thebpfilter
daemon using Netlink messagesnft
front-end in the daemon parses the Netlink messages to extract thenft
bytecode, and converts the bytecode into its internal format (shared by all the front-ends)The current implementation of the bytecode parsing logic can't be scalable to understand more complex filtering rules and only works with simple "filter IP xxx.xxx.xxx.xxx" rules. It must be refactored to provide a generic framework to properly parse the bytecode and allow for more matchers and rules to be supported in the future.
Some exploration is required to understand
nft
bytecode format, investigate if a similar tool or library already exists, and suggest possible solutions for this issue.The purpose of this task is to define, document, and implement a scalable framework to parse
nft
bytecode, not to reach feature parity betweennftables
andbfcli
.The text was updated successfully, but these errors were encountered: