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

Make capture.Packet a struct instead of an interface #2

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

fako1024
Copy link
Owner

@fako1024 fako1024 commented Mar 8, 2023

This removes the capture.Packet interface and the afpacket.Packet struct (used by both ring and no ring afpacket sources) in favor of a single struct capture.Packet (which of course still has the same methods, hiding the packet type etc. under its hood). In addition to increased performance when using these methods in tight loops (which are usually present when performing packet capture) it also simplifies interaction within slimcap because it gets rid of some type assertions in packet population / capture from the wire.

Closes #1

@fako1024 fako1024 linked an issue Mar 8, 2023 that may be closed by this pull request
3 tasks
@fako1024 fako1024 self-assigned this Mar 8, 2023
@fako1024 fako1024 added enhancement New feature or request performance Performance / optimization related topics labels Mar 8, 2023
@fako1024 fako1024 merged commit a59af79 into main Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance Performance / optimization related topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider removing capture.Packet interface
1 participant