From 1d6ae62dcd9f541c4bcfa19149aaa808a4709708 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 26 Aug 1998 01:09:20 +0000 Subject: [PATCH] added netdbHostData as a faster way to get #samples, RTT, and HOPS --- src/net_db.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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) { -- 2.47.3