diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-10-26 18:42:59 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-10-26 18:42:59 +0000 |
commit | 31a60e22752d3daaa248ca10930f3cf4bc5f02e8 (patch) | |
tree | 18f5bd36118d98e2004fc0e5af866a280667278c /slirp/slirp.c | |
parent | 7d294b61edc6bd1be15739a11dce1414080dbb9b (diff) | |
download | qemu-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/slirp.c')
-rw-r--r-- | slirp/slirp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/slirp/slirp.c b/slirp/slirp.c index f535db1..28f6c0c 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -93,7 +93,9 @@ static int get_dns_addr(struct in_addr *pdns_addr) if (!f) return -1; +#ifdef DEBUG lprint("IP address of your DNS(s): "); +#endif while (fgets(buff, 512, f) != NULL) { if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) { if (!inet_aton(buff2, &tmp_addr)) @@ -103,13 +105,20 @@ static int get_dns_addr(struct in_addr *pdns_addr) /* If it's the first one, set it to dns_addr */ if (!found) *pdns_addr = tmp_addr; +#ifdef DEBUG else lprint(", "); +#endif if (++found > 3) { +#ifdef DEBUG lprint("(more)"); +#endif break; - } else + } +#ifdef DEBUG + else lprint("%s", inet_ntoa(tmp_addr)); +#endif } } fclose(f); |