Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor nft front-end to properly parse bytecode #182

Open
qdeslandes opened this issue Jan 21, 2025 · 0 comments
Open

Refactor nft front-end to properly parse bytecode #182

qdeslandes opened this issue Jan 21, 2025 · 0 comments
Labels
area: front-end Front-ends: parsing and translation

Comments

@qdeslandes
Copy link
Contributor

qdeslandes commented Jan 21, 2025

Plenty of new features have been introduced during H2 2024 which are supported by bfcli. The nft front-end hasn't progressed at the same speed due to many limitations with its current implementation, making bpfilter unusable with nftables.

The front-end's logic is the following:

  • nftables CLI binary parse the user-define rules and converts them into nft bytecode
  • libbpfilter (linked to nftables) send the bytecode to the bpfilter daemon using Netlink messages
  • The nft front-end in the daemon parses the Netlink messages to extract the nft 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 between nftables and bfcli.

@qdeslandes qdeslandes added this to the 2025 H1 Roadmap milestone Jan 21, 2025
@qdeslandes qdeslandes added the area: front-end Front-ends: parsing and translation label Jan 21, 2025
@qdeslandes qdeslandes moved this to To do in bpfilter's roadmap Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: front-end Front-ends: parsing and translation
Projects
Status: To do
Development

No branches or pull requests

1 participant