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

Optionally limit packet count #63

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pchaseh
Copy link

@pchaseh pchaseh commented May 8, 2023

Adds a new flag, -c, which allows for the capture to stop when a certain number of matched packets have been hit similar to what tcpdump offers. Having the capture utility be capable of exiting on this condition is helpful in the following cases:

  • The application is ran with a filter that may match a significant number of traffic, but the user only wants a fixed size sample
  • One wants to run the program unattended until a certain amount of packets have been captured, but without the burden of having to kill it after a certain amount of time using timeout and risking either ending up with too few or too many packets

These changes can be tested by running xdpcap with the -c flag set to a non-zero value, observing it exiting, and then verifying that the resulting packet capture only has the requested amount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant