-
Notifications
You must be signed in to change notification settings - Fork 222
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
feat: conntrack for data aggregation #283
Conversation
This PR will be closed in 7 days due to inactivity. |
This PR will be closed in 7 days due to inactivity. |
Pull request closed due to inactivity. |
* @arg flags The flags of the packet. | ||
* Returns true if the packet should be report to userspace. False otherwise. | ||
**/ | ||
static __always_inline __attribute__((unused)) bool ct_process_packet(struct ct_v4_key key, __u8 flags) { |
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.
Write out the algorithm as steps and see how to refactor it in a more manageable way. Currently code complexity (branching) feels too high.
# Description Part of #283, broken down for ease of review. Testing results will be added in #624 ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Quang Nguyen <[email protected]>
default: | ||
// Some kind of option. | ||
// Since each option is at least 2 bytes long, we need to check that adding 2 to the pointer will not go past the end of the packet. | ||
if (tcp_options_cur_ptr + 2 > tcp_opt_end_ptr || tcp_options_cur_ptr + 2 > (__u8 *)data_end) { |
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.
when possible avoid magic nubmers like this in non-test code, even though there's a comment
closing in favor of #624 |
Description
Implement a naive conntrack map. Related to #138. Smaller PRs will be open from this PR for ease of review.
packetparser
#590 (Optional)Related Issue
If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request.
Checklist
git commit -S -s ...
). See this documentation on signing commits.Screenshots (if applicable) or Testing Completed
Please add any relevant screenshots or GIFs to showcase the changes made.
Additional Notes
Add any additional notes or context about the pull request here.
Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.