Packet Capture Library Data Structures

This section describes the data structure for the packets that should be captured.

The three data structures defined in the /usr/include/pcap.h file for use with the libpcap.a subroutines are as follows:

Item Description
struct pcap_file_header This structure defines the first record in the savefile that contains the saved packet capture data.
struct pcap_pkthdr This is the structure that defines the packet header that is added to the front of each packet that is written to the savefile.
struct pcap_stat This structure is returned by the pcap_stats subroutine, and contains information related to the packet statistics from the start of the packet capture session to the time of the call to the pcap_stats subroutine.