-
Notifications
You must be signed in to change notification settings - Fork 13
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
ct: add support for mark and labels #434
base: main
Are you sure you want to change the base?
Conversation
72cb70f
to
3f70aed
Compare
/// u128 representation in the events. We can't use the Rust primitive as serde | ||
/// does not handle the type well. | ||
#[event_type] | ||
pub struct U128 { | ||
hi: u64, | ||
lo: u64, | ||
} |
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.
Due to serde limitations I chose to represent u128
as the above. Another way would be to use something like U128(u128)
and represent it as a string in JSON.
Feels like I'm getting some random garbage instead of labels. Every time I run the test they are different or not show up at all. For example:
It supposed to be the same ct entry, but the labels are not shown the first time. And the The test that produced this is using either |
For the formatting of the parent entry, it looks like this:
It might be better if the parent was indented further to the right, so it better aligns with the current connection and that it looks more like part of the
|
Thanks for testing! I believe there are two issues:
(The above is probably a combination of the two issues). Also there is the issue reported in #445. [Edit] [1] I think the issue is the |
IMO we should avoid to shift things more, we already have events (in series) and their sections. Maybe instead we can use a special char to start the parent line?
WDYT? |
As it contains helpers. Signed-off-by: Antoine Tenart <[email protected]>
Signed-off-by: Antoine Tenart <[email protected]>
While the mark is an optional feature that can be compiled out, let's not use a dedicated event section for just an u32. Instead we detect if the mark value should be seen as valid in the Rust side while processing the raw event. Signed-off-by: Antoine Tenart <[email protected]>
While labels are an optional feature that can be compiled out, let's not use a dedicated event section for just 128 bits. Instead we detect if the labels value should be seen as valid in the Rust side while processing the raw event. Also 0 means there is no label. Signed-off-by: Antoine Tenart <[email protected]>
3f70aed
to
1221269
Compare
I like how the protocol and reply align in the shifted version, and it's easier to compare IPs this way. But I won't insist. Having a special character seems better than not having it. |
@igsilya the various issues should be fixed now. I refreshed the container image. |
Updated version seems to work:
Tested with RHEL 9.4 stock kernel and 6.10-rc6 upstream kernel. I no longer see any garbage data and the labels are the labels match what OVS has in OpenFlow rules. Also works without kenrel config available. |
Thanks for testing! |
RFC as I don't want this to be merged before the bindgen PR (#419); this will need to be rebased.
A test image is available and can be used as follow:
Labels can be set for testing, eg:
A few questions / remarks:
nf_conn
.@igsilya can you help testing to make sure this looks good? Thanks!
Close #407.