-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
Draft: Nftables sets #1017
Draft: Nftables sets #1017
Conversation
@@ -46,6 +47,55 @@ | |||
NFT_MSG_GETFLOWTABLE = 23 | |||
NFT_MSG_DELFLOWTABLE = 24 | |||
|
|||
# from nftables/include/datatype.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment, what do you think — would we benefit of using enum
in these cases instead of a plain definition of variables?
Not starting with this PR, but in some future maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think it would be better
pyroute2/nftables/main.py
Outdated
else: | ||
kwarg.pop("elements") | ||
|
||
kwarg["elements"] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already started to work on kwarg filters for IPRoute
, see /pyroute2/requests/
; eventually we could make some common API that solves common transformations like str 255.255.255.0 ⇒ int 24
, or iterable ( int interface_index ) ⇒ int interface_index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will see that thanks !
LGTM, if you could fix pep8 (run I see no issues so far, but tonigh I'll look more closer and start some test routines as well. |
6b16545
to
6767826
Compare
6767826
to
6c2a59c
Compare
d2e52d5
to
096da94
Compare
@inemajo does the functional test succeeds on your system? |
Yes, and I try on a VM with ubuntu-18 and they pass too, so I don't understand why they don't pass on the CI |
I put some new features on sets (timeout, counter...) I want to add userdata (for the comment entry) and after passing the MR to ready |
504a423
to
ca75a64
Compare
Is it possible that the test has some prerequisites set up on your machines but on the CI VM:s? I'll take a look tonight, maybe will be lucky to find out. |
that's what I thought, the test create the filter table but it had no effect. Thanks for the help |
ca75a64
to
f4746ad
Compare
…oseconds) in kwarg
…of expressions) and fix NFTA_SET_EXPR (only one expression)
…ESSIONS and fix NFTA_SET_ELEM_EXPR, it's only one nft_expr
…ment timeout and counter on sets
f4746ad
to
4a107fa
Compare
Hello @svinota, I move the tests into examples for unlock the CI, do you think it's ok for you ? |
Sure thing, thanks. |
Hello @svinota, this is a draft for the issue #1013 (implementation of sets and set_elements for Nftables)