Kernel Buffer and other Buffer settings of Winpcap

Source: Internet
Author: User


In pcap, the concepts of Kernel Buffer and User Buffer exist. Kernel Buffer is provided to the driver layer to cache packets captured on the NIC, and the User Buffer is used to interact with User applications, provide the data to the user through UserBuffer.
Int pcap_setbuff (pcap_t * p, int dim );

Set the size of the kernel buffer associated with an adapter. dim specifies the size of the buffer in bytes. the return value is 0 when the call succeeds,-1 otherwise. if an old buffer was already created with a previous call to pcap_setbuff (), it is deleted and its content is discarded. pcap_open_live () creates a 1 MByte buffer by default.


This interface is an extension of Winpcap and is used to set the Windows Kernel buffer size. However, it is not available in Linux.
PCAP_BUF_SIZE is the compilation macro of Winpcap. It is used to save information such as address, port, and interface name. The default value is 1024.
Snaplen is a parameter of pcap_open_live. It is used to define the Buffer size of captured packets. It is generally set to 65535. & Nbs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.