Libnids TCP Data Flow reorganization, programs that show the TCP connection process are unable to capture packet resolution:

Source: Internet
Author: User
Law one: Specify the available network cards: nids_params.device= "Lo"; Law two: there is a paragraph in nids.h:

struct NIDS_CHKSUM_CTL {
U_int netaddr;
U_int Mask;
U_int Action;
U_int reserved;
};
extern void Nids_register_chksum_ctl (struct nids_chksum_ctl *,int);

This paragraph is related to the calculation of the checksum, compared to the new NIC driver will automatically calculate the checksum, we have to do is to turn it off, by:

At the beginning of the main () function, add such a piece of code:

struct NIDS_CHKSUM_CTL temp;
temp.netaddr = 0;
Temp.mask = 0;
Temp.action = 1;
Nids_register_chksum_ctl (&temp,1);

This turns off the calculation of the checksum, and recompiling the running program will catch the packet.

Libnids TCP Data Flow reorganization, programs that show the TCP connection process are unable to capture packet resolution:

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.