Opens a previously saved file containing packet capture data.
pcap Library (libpcap.a)
The pcap_open_offline subroutine opens a previously saved packet capture data file, known as the savefile. This subroutine creates and initializes a packet capture (pcap) descriptor and opens the specified savefile containing the packet capture data for reading.
This subroutine should be called before any other related routines that require a packet capture descriptor for offline packet processing. See the pcap_open_live (pcap_open_live Subroutine) subroutine for more details on live packet capture.
Item | Description |
---|---|
ebuf | Returns error text and is only set when the pcap_open_offline subroutine fails. |
fname | Specifies the name of the file to open. A hyphen (-) passed as the fname parameter indicates that stdin should be used as the file to open. |
Upon successful completion, the pcap_open_offline subroutine will return a pointer to the newly created packet capture descriptor. If the pcap_open_offline subroutine is unsuccessful, Null is returned, and text indicating the specific error is written into the ebuf buffer.