From: wessels <> Date: Wed, 26 Aug 1998 01:09:20 +0000 (+0000) Subject: added netdbHostData as a faster way to get #samples, RTT, and HOPS X-Git-Tag: SQUID_3_0_PRE1~2795 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d6ae62dcd9f541c4bcfa19149aaa808a4709708;p=thirdparty%2Fsquid.git added netdbHostData as a faster way to get #samples, RTT, and HOPS --- diff --git a/src/net_db.cc b/src/net_db.cc index 5e2eeb645f..afe4c7be62 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -1,6 +1,6 @@ /* - * $Id: net_db.cc,v 1.124 1998/08/21 03:15:20 wessels Exp $ + * $Id: net_db.cc,v 1.125 1998/08/25 19:09:20 wessels Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -790,6 +790,19 @@ netdbHostRtt(const char *host) return 0; } +void +netdbHostData(const char *host, int *samp, int *rtt, int *hops) +{ +#if USE_ICMP + netdbEntry *n = netdbLookupHost(host); + if (n == NULL) + return; + *samp = n->pings_recv; + *rtt = (int) (n->rtt + 0.5); + *hops = (int) (n->hops + 0.5); +#endif +} + int netdbHostPeerRtt(const char *host, peer * peer) {