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

feat: conntrack for data aggregation #283

Closed
wants to merge 46 commits into from
Closed

feat: conntrack for data aggregation #283

wants to merge 46 commits into from

Conversation

nddq
Copy link
Contributor

@nddq nddq commented Apr 17, 2024

Description

Implement a naive conntrack map. Related to #138. Smaller PRs will be open from this PR for ease of review.

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.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation 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 file for more information on how to contribute to this project.

Sorry, something went wrong.

@nddq nddq added type/enhancement New feature or request lang/go The Go Programming Language area/ebpf priority/1 P1 lang/c The C Programming Language labels Apr 17, 2024
@nddq nddq self-assigned this Apr 17, 2024
Copy link

This PR will be closed in 7 days due to inactivity.

@github-actions github-actions bot added the meta/waiting-for-author Blocked and waiting on the author label May 20, 2024
@nddq nddq removed the meta/waiting-for-author Blocked and waiting on the author label May 20, 2024
Copy link

This PR will be closed in 7 days due to inactivity.

@github-actions github-actions bot added the meta/waiting-for-author Blocked and waiting on the author label Jun 20, 2024
Copy link

Pull request closed due to inactivity.

@github-actions github-actions bot closed this Jun 27, 2024
@github-actions github-actions bot deleted the feat/conntrack branch June 27, 2024 00:18
@vakalapa vakalapa restored the feat/conntrack branch July 29, 2024 21:30
@vakalapa vakalapa reopened this Jul 29, 2024
nddq added 2 commits July 29, 2024 18:03

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen
@nddq nddq force-pushed the feat/conntrack branch from c3b65d3 to 56a6438 Compare July 29, 2024 22:04
@nddq nddq removed the meta/waiting-for-author Blocked and waiting on the author label Jul 29, 2024
nddq added 8 commits July 30, 2024 11:57

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen
nddq added 3 commits August 9, 2024 15:57

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen
* @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) {
Copy link
Contributor

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.

nddq added 12 commits August 12, 2024 19:23

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Signed-off-by: Quang Nguyen <[email protected]>

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen
nddq added 9 commits August 15, 2024 18:01

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was signed with the committer’s verified signature.
nddq Quang Nguyen

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
github-merge-queue bot pushed a commit that referenced this pull request Aug 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
# 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) {
Copy link
Contributor

@rectified95 rectified95 Aug 29, 2024

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

@nddq
Copy link
Contributor Author

nddq commented Sep 5, 2024

closing in favor of #624

@nddq nddq closed this Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ebpf lang/c The C Programming Language lang/go The Go Programming Language priority/1 P1 type/enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants