Closes the open files related to the packet capture descriptor and frees the memory used by the packet capture descriptor.
pcap Library (libpcap.a)
#include <pcap.h>
void pcap_close(pcap_t * p);
The pcap_close subroutine closes the files associated with the packet capture descriptor and deallocates resources. If the pcap_open_offline subroutine was previously called, the pcap_close subroutine closes the savefile, a previously saved packet capture data file. Or the pcap_close subroutine closes the packet capture device if the pcap_open_live subroutine was previously called.
Item | Description |
---|---|
p | Points to a packet capture descriptor as returned by the pcap_open_live or the pcap_open_offline subroutine. |