diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-02-11 21:29:03 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-02-11 21:29:03 +0000 |
commit | 35a14714c0fa761928e3da32584b29a66ba9490a (patch) | |
tree | d2a62cd4043089c5fea8685e8594c31b7dab9e71 /capture.c | |
parent | bf0a3a32d1135b4bc84a5051adfbf934d091ba61 (diff) | |
download | wireshark-35a14714c0fa761928e3da32584b29a66ba9490a.tar.gz wireshark-35a14714c0fa761928e3da32584b29a66ba9490a.tar.bz2 wireshark-35a14714c0fa761928e3da32584b29a66ba9490a.zip |
Report failures of "pcap_stats()", as tcpdump does.
Print the "Capturing on <interface>" message, the running count of
packets captured, and error messages to the standard error in Tethereal,
so that you can pipe the output of a live capture that's printing
packets to a program or script without that script having to worry about
parsing stuff other than dissected packet summaries or details (tcpdump
does the same).
svn path=/trunk/; revision=3017
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,7 +1,7 @@ /* capture.c * Routines for packet capture windows * - * $Id: capture.c,v 1.139 2001/02/11 09:28:15 guy Exp $ + * $Id: capture.c,v 1.140 2001/02/11 21:29:03 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -1604,6 +1604,11 @@ capture(gboolean *stats_known, struct pcap_stat *stats) dropped. */ if (pcap_stats(pch, stats) >= 0) *stats_known = TRUE; + else { + simple_dialog(ESD_TYPE_WARN, NULL, + "Can't get packet-drop statistics: %s", + pcap_geterr(pch)); + } pcap_close(pch); } |