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

Allow pcap_set_buffer_size() to set SNF_DATARING_SIZE in pcap-snf.c. #435

Merged
merged 6 commits into from Dec 13, 2016

Conversation

@myri
Copy link
Contributor

commented May 15, 2015

No description provided.

@guyharris

This comment has been minimized.

Copy link
Member

commented May 15, 2015

So the ring size argument to snf_open() is in bytes?

@myri

This comment has been minimized.

Copy link
Contributor Author

commented May 15, 2015

The dataring_sz argument to snf_open() is considered to be in bytes if it is greater than or equal to 1048576. If it is less than that, it is considered in megabytes. If the value is zero or less than 0, the Sniffer library tries to choose a sensible default unless the SNF_DATARING_SIZE variable is set in the environment.

@guyharris

This comment has been minimized.

Copy link
Member

commented May 15, 2015

The dataring_sz argument to snf_open() is considered to be in bytes if it is greater than or equal to 1048576. If it is less than that, it is considered in megabytes.

Then perhaps if the value provided by pcap_set_buffer_size() is < 1048576, you should multiply it by 1048576 before passing it to snf_open(), to ensure that the value, in bytes (that's what the pcap_set_buffer_size() says are the units of the argument), is used as the ring size.

@guyharris

This comment has been minimized.

Copy link
Member

commented May 15, 2015

Or just pass 1048576 if the value is > 0 but < 1048576, as you'd have to round up the value after dividing it by 1048576.

  in pcap-snf.c. value is adjusted to the minimum of 1MB.
@myri

This comment has been minimized.

Copy link
Contributor Author

commented May 15, 2015

Thanks. I'll treat the value as in bytes and convert it to the minimum of 1048576 if it < 1MB.

Christopher K Lee and others added 4 commits Nov 25, 2015
…=0x2.

It now will update description info if existing device list matches a SNF
interface. It will also adjust SNF interface name in description field if
SNF_FLAGS=0x2(port aggregation enabled).
@guyharris guyharris merged commit ea27457 into the-tcpdump-group:master Dec 13, 2016
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@guyharris

This comment has been minimized.

Copy link
Member

commented Dec 13, 2016

So the only part of this change that survived your most recent commit is the "Update snf_findalldevs() ..." part; did you really intend not to "Allow pcap_set_buffer_size() to set SNF_DATARING_SIZE in pcap-snf.c"?

@myri

This comment has been minimized.

Copy link
Contributor Author

commented Dec 13, 2016

Right. I may add pcap_set_buffer_size() support back in later after some more review and discussion. Thanks for noticing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.