aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-snoop.c
diff options
context:
space:
mode:
authorguy <guy>2003-07-25 04:04:56 +0000
committerguy <guy>2003-07-25 04:04:56 +0000
commit9792990eb80889004b39ee70caa98b3d91ac8012 (patch)
tree599047dd2650b318c82f4f9832485661d8f50c3d /pcap-snoop.c
parente648c9e593e7a7f0c3d031eb2e2c146de9efc67e (diff)
Add a "stats" function pointer to the pcap_t structure, which handles
getting statistics for a pcap_t. Have "pcap_stats()" call it, rather than being a per-platform function; have stats routines for non-live pcap_t's that return an error.
Diffstat (limited to 'pcap-snoop.c')
-rw-r--r--pcap-snoop.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pcap-snoop.c b/pcap-snoop.c
index 83cb6d2..ef2fbc5 100644
--- a/pcap-snoop.c
+++ b/pcap-snoop.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.40 2003-07-25 03:25:47 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.41 2003-07-25 04:04:59 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -102,8 +102,8 @@ again:
return (0);
}
-int
-pcap_stats(pcap_t *p, struct pcap_stat *ps)
+static int
+pcap_stats_snoop(pcap_t *p, struct pcap_stat *ps)
{
register struct rawstats *rs;
struct rawstats rawstats;
@@ -294,6 +294,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
goto bad;
}
+ p->stats_op = pcap_stats_snoop;
p->close_op = pcap_close_snoop;
return (p);