tags: operating system socket
Red Hat 9
Control single sentence output format
Control packet data output format
MAC address printing function

is the IP address of the print function

of the captured data packet processing
Analyzing network layer protocol
To determine the transport layer protocol
The number of parameters controlling operation of the main function of the input, in addition to input executable file name, card need to enter a run-time parameter
pcap_open_live acquires the packet for capturing network packets capture descriptor parameters were specified opening device name [Network], [the maximum number of bytes of data captured], [if the network interface in promiscuous mode], [designated timeout], [send the wrong message when an error function]
pcap_lookupnet for the specified number of network devices and network mask parameters are specified for the open device name [Network], [] bpf_u_int32 pointer, pointer bpf_u_int32 [], [] stored error message when an error occurs
pcap_compile string compiler string parameter specified program into the filter, the filter condition is specified here as the source IP virtual machine IP: 192.168.xxx.xxx, pcap_setfilter specify a filter program
pcap_loop parameters are winpcap handle [], [the specified number of packets captured if the capture infinite loop -1], [callback], [] used by the user for parameter
After installing libpcap, compile written procedures gcc -o lpcaptest lpcaptest.c -lpcap
Run command input ./lpcaptest eth0, as part of the results, by observing, source fetch the IP packets are 192.168.xxx.xxx, dest IP are 192.168.xxx. x

In project (1), we successfully captured the data packet and extracted the basic information in the data packet. This time we will output the various protocols used by the data packet and output the m...
First introduce the usage of libpcap library functions: Here I use two functions, pcap_open_live () and pcap_next (), you can jump through the portal to see the specific usage. The comments in the cod...
In project three, we completed the parsing of a package in the "hospital mirror stream.pcapng" file. The next thing we need to do is to write the parsed data into the file, so that the TS st...
At present, the network packet capture system under the Linux operating system is generally built on the libpcap packet capture platform. The English meaning of libpcap is Library of Packet Capture, t...
1. Process and performance analysis of traditional Linux network protocol stack The Linux network protocol stack is a typical system for processing network packets. It includes the entire process from...
1 installation sudo apt-get install libpcap-dev 2 The header file that needs to be included: #include <pcap.h Need to add: -lpcap Basic steps to develop applications with libpcap function libraries...
Transfer from: Overview libpcap is a network packet capture library, and tcpdump is based on libpcap. Main function: Capture various data packets, for example: network traffic statistics Filter networ...
Recently, the project needs to collect packets under the gigabit network, and the bandwidth is about 800Mb. Traditional sockets or raw sockets are easy to lose packets, so use libpcap to capture packe...
One of the most powerful features of WinPCAP and LibPCAP is the engine with filtering packets. It provides an effective way to get some packets in the network, which is also an integral part of the Wi...
Wireshark. It is a big kill a local monitor data, the drawback is that only monitor local data there any way to make traffic on the LAN are away from the machine do? First ARP sniffing, hijacking gate...