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

List single table or chain by name #258

Merged
merged 1 commit into from
Apr 14, 2024
Merged

Conversation

turekt
Copy link
Contributor

@turekt turekt commented Apr 13, 2024

Hi,

I think that current nftables package is missing the nft list chain and nft list table functionality. Without this functionality, current user code that wants to manage one specific table or chain has to fetch all of tables/chains and then iterate until it matches the desired table/chain by name (and family). This pull request adds the ability to fetch the table/chain with a single request that returns the desired table/chain immediately.

Current change should not affect existing usage of ListTablesOfFamily or ListChainsOfTableFamily. Tests are also added.

Let me know what you think.

Copy link
Collaborator

@stapelberg stapelberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable overall

chain.go Outdated Show resolved Hide resolved
chain.go Outdated Show resolved Hide resolved
Adds functionality to list table or chain by specifying its name
@stapelberg stapelberg merged commit 5e242ec into google:main Apr 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants