Design and Implementation of the packet capture module based on Linux-Linux Enterprise Application-Linux server application information. The following is a detailed description. 1. Data Packet capture module design Flowchart
In the packet capture program, network links are monitored and data packets are collected by setting the network adapter to work in a hybrid State to obtain the packet header information.
2. Data Packet capture module implementation
This data packet capture program is written in C language and uses many functions in Linux network programming.
(1) set network interfaces to hybrid mode
The hybrid mode of network interfaces enables a network interface device to read only data packets with a 6-byte MAC address from the target address to all data packets in the network broadcast media. This part is implemented through two ioctl function calls: