Skip to content

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