-
Notifications
You must be signed in to change notification settings - Fork 17
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
WIP: Ability to dump packets to shared memory on "dump" rule in pcap format #259
Open
ol-imorozko
wants to merge
15
commits into
yanet-platform:main
Choose a base branch
from
ol-imorozko:tcpdump
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ol-imorozko
force-pushed
the
tcpdump
branch
2 times, most recently
from
December 13, 2024 16:54
0fd8555
to
98395a4
Compare
…acro This simplifies error message construction and is more type secure
Missed those in the original commit 01422b7
In the following commit we will add new option to the shared memory config, and we will need an ability to use that config in another file. Including whole dataplane.h there will be awkward.
….conf. This option specifies the format for dumping packets in shared memory. If the option is not specified or is set to an invalid value, the format defaults to raw, maintaining the current behavior. Valid options are "raw" and "pcap". The logic for dumping packets in pcap format within shared memory will be implemented in subsequent commits.
- Rename `cSharedMemory` to `SharedMemoryDumpRing` to reflect that it exclusively manages dump rings for packet handling. - Rename `bufferring` to `PacketBufferRing` to better indicate that it is specifically designed for packet processing. - Remove the unnecessary `init` function, as initialization is now handled by the constructor. - Move the calculation of unit size and total capacity into the `PacketBufferRing` constructor. Now capacity calculations i.e adding headers are encapsulated within the class itself. Now we pass in configuration values for memory expectations, and handle internal header sizing within `SharedMemoryDumpRing` to not violate encapsulation.
Use unordered map instead of an ordered one, we don't need order there. Encapsulate memory size calculation logic in a static helper function. Avoid iterators that were there for some reason, simple increment operator is enough.
Use `ShmInfo` struct with `key`, `addr`, and `offset` instead of obscure std::tuple and another map for offset. Applied placement `new` for `tsc_deltas` initialization instead of value initizlizing with empty brackets and setting pointer. Move efficient and literal this way.
This function is too useful and universal to be in that namespace
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.