Sorry the versio of lbpcap is libpcap-0.8.1 and OS is Linux ...
Main Topics
Browse All TopicsPlease, does someone know how to increase the buffer of
libpcap ? when I try to send 1000 syn packets for example with a delay equal to 0,
i receive only 800 packets; how could I access the buffer lenght with libpcap and increase it ?
Thank you
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This link has a patch
http://www.tcpdump.org/lis
and the default value is actually set in src/sys/net/bpf.c is
debug.bpf_bufsize,
http://www.tcpdump.org/lis
that is kernel version ... what distro ... If it is rpm based like redhat, then go to rpmfind.net and download a libpcap rpm with .src extension ... when you install it with -i, it will give you the source code in /usr/src/REDHAT or some equivalent directory ...
In those sources, make the changes I have listed above and recompile the library
I installed libpcap with sources codes, and I modified
the sources codes ny indreasing
BUFSPACE and BPF_MAXBUFSIZE in 7 files , but, there were no change in my program; I have always
the same problem, on 100 packets send, I only received 47 packets.
When I modify the sources code of libpcap , I recompile libpcap as follow
I do ./configure, make and make install
I tried to put some print in these files, and there is no print in my screen when I recompile libpcap; it is to strange !!!!
Do you want me to send you the sources code of libpcap by email ??
The protocol is simple: I simply send 100 syn packets I forge from my machine to my machine using eth0 and eth1 interface (I used a patch to do it). when doing TCPdump, I send and receive all packets; but with libpcap in my program, I do not receive all packets, so I have to increase the buffer of libpcap; but the problem is how ?
I tried to modify varialbles like I said in the sources code of libpcap, it does not work
The protocol is simple: I simply send 100 syn packets I forge from my machine to my machine using eth0 and eth1 interface (I used a patch to do it). when doing TCPdump, I send and receive all packets; but with libpcap in my program, I do not receive all packets, so I have to increase the buffer of libpcap; but the problem is how ?
I tried to modify varialbles like I said in the sources code of libpcap, it does not work
syn packets for which protocol ?
If you have devised you own packets and using TCP to send them, then there is no correspondence between number of packets sent and received ( i.e., If you listen to the wire )
>1000 syn packets for example with a delay equal to 0,i receive only 800 packets;
>on 100 packets send, I only received 47 packets.
If your test are to be believed, second case proves that it is not buffer capacity problem ... It should have accomodated 800 packets
still if you wish to change the code ... change debug.bpf_bufsize, for changing default size of the buffer and recompile the library ... to install the library, remove old library from path (/etc/ld.so.conf) and put path to new library in the file .. next run ldconfig
A better option will be link to the newer library using the complete path and linking to it statically (for experimental purposes)
Business Accounts
Answer for Membership
by: sunnycoderPosted on 2004-02-26 at 21:47:45ID: 10466944
It should be defined in one of the header files in the source ... You will have to change the value in the header file and then recompile the library for the changes to take effect...
If you are willing to put in the efforts, post your libpcap version number and OS and I'll try to locate the declaration