aboutsummaryrefslogtreecommitdiff
path: root/slirp/ip_icmp.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-26 18:42:59 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-26 18:42:59 +0000
commit31a60e22752d3daaa248ca10930f3cf4bc5f02e8 (patch)
tree18f5bd36118d98e2004fc0e5af866a280667278c /slirp/ip_icmp.c
parent7d294b61edc6bd1be15739a11dce1414080dbb9b (diff)
downloadqemu-31a60e22752d3daaa248ca10930f3cf4bc5f02e8.zip
qemu-31a60e22752d3daaa248ca10930f3cf4bc5f02e8.tar.gz
qemu-31a60e22752d3daaa248ca10930f3cf4bc5f02e8.tar.bz2
Make Slirp statistics gathering and output conditional to LOG_ENABLED
Add 'info slirp' command to monitor to display statistics Disable Slirp debugging code by default git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3451 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'slirp/ip_icmp.c')
-rw-r--r--slirp/ip_icmp.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c
index ae5a321..4cf14c8 100644
--- a/slirp/ip_icmp.c
+++ b/slirp/ip_icmp.c
@@ -37,7 +37,9 @@
#include "slirp.h"
#include "ip_icmp.h"
+#ifdef LOG_ENABLED
struct icmpstat icmpstat;
+#endif
/* The message sent when emulating PING */
/* Be nice and tell them it's just a psuedo-ping packet */
@@ -83,14 +85,14 @@ icmp_input(m, hlen)
DEBUG_ARG("m = %lx", (long )m);
DEBUG_ARG("m_len = %d", m->m_len);
- icmpstat.icps_received++;
+ STAT(icmpstat.icps_received++);
/*
* Locate icmp structure in mbuf, and check
* that its not corrupted and of at least minimum length.
*/
if (icmplen < ICMP_MINLEN) { /* min 8 bytes payload */
- icmpstat.icps_tooshort++;
+ STAT(icmpstat.icps_tooshort++);
freeit:
m_freem(m);
goto end_error;
@@ -100,7 +102,7 @@ icmp_input(m, hlen)
m->m_data += hlen;
icp = mtod(m, struct icmp *);
if (cksum(m, icmplen)) {
- icmpstat.icps_checksum++;
+ STAT(icmpstat.icps_checksum++);
goto freeit;
}
m->m_len += hlen;
@@ -170,12 +172,12 @@ icmp_input(m, hlen)
case ICMP_TSTAMP:
case ICMP_MASKREQ:
case ICMP_REDIRECT:
- icmpstat.icps_notsupp++;
+ STAT(icmpstat.icps_notsupp++);
m_freem(m);
break;
default:
- icmpstat.icps_badtype++;
+ STAT(icmpstat.icps_badtype++);
m_freem(m);
} /* swith */
@@ -314,7 +316,7 @@ icmp_error(msrc, type, code, minsize, message)
(void ) ip_output((struct socket *)NULL, m);
- icmpstat.icps_reflect++;
+ STAT(icmpstat.icps_reflect++);
end_error:
return;
@@ -371,5 +373,5 @@ icmp_reflect(m)
(void ) ip_output((struct socket *)NULL, m);
- icmpstat.icps_reflect++;
+ STAT(icmpstat.icps_reflect++);
}