]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
added netdbHostData as a faster way to get #samples, RTT, and HOPS
authorwessels <>
Wed, 26 Aug 1998 01:09:20 +0000 (01:09 +0000)
committerwessels <>
Wed, 26 Aug 1998 01:09:20 +0000 (01:09 +0000)
src/net_db.cc

index 5e2eeb645f18088ebf93fab50c7bc7f49771aaa8..afe4c7be62db98a177c860859e1da3e986e6b6f2 100644 (file)
@@ -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)
 {