Obtains packet capture statistics.
pcap Library (libpcap.a)
The pcap_stats subroutine fills in a pcap_stat struct. The values represent packet statistics from the start of the run to the time of the call. Statistics for both packets that are received by the filter and packets that are dropped are stored inside a pcap_stat struct. This subroutine is for use when a packet capture device is opened using the pcap_open_live subroutine.
|p||Points to a packet capture descriptor as returned by the pcap_open_live subroutine.|
|ps||Points to the pcap_stat struct that will be filled in with the packet capture statistics.|
On successful completion, the pcap_stats subroutine fills in ps and returns 0. If the pcap_stats subroutine is unsuccessful, -1 is returned. In this case, the error text can be obtained with the pcap_perror subroutine or the pcap_geterr subroutine.
The pcap_geterr (pcap_geterr Subroutine) subroutine, pcap_open_live (pcap_open_live Subroutine) subroutine, pcap_perror (pcap_perror Subroutine) subroutine.