From: Francesco Chemolli Date: Mon, 17 Sep 2012 18:03:06 +0000 (+0200) Subject: Moved netdbEntry classes to icmp/net_db.h X-Git-Tag: SQUID_3_3_0_1~33^2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c78cfe481e97987c0bb2e99a813c2aa3952e234;p=thirdparty%2Fsquid.git Moved netdbEntry classes to icmp/net_db.h --- diff --git a/src/icmp/net_db.h b/src/icmp/net_db.h index b5b341174f..55c0eb3349 100644 --- a/src/icmp/net_db.h +++ b/src/icmp/net_db.h @@ -1,6 +1,9 @@ #ifndef ICMP_NET_DB_H #define ICMP_NET_DB_H +#include "CachePeer.h" +#include "hash.h" + namespace Ip { class Address; @@ -8,27 +11,58 @@ class Address; class StoreEntry; class HttpRequest; +class netdbEntry; + +class net_db_name { +public: + hash_link hash; /* must be first */ + net_db_name *next; + netdbEntry *net_db_entry; +}; + +class net_db_peer { +public: + const char *peername; + double hops; + double rtt; + time_t expires; +}; + +class netdbEntry { +public: + hash_link hash; /* must be first */ + char network[MAX_IPSTRLEN]; + int pings_sent; + int pings_recv; + double hops; + double rtt; + time_t next_ping_time; + time_t last_use_time; + int link_count; + net_db_name *hosts; + net_db_peer *peers; + int n_peers_alloc; + int n_peers; +}; -/* for CachePeer */ -#include "structs.h" -SQUIDCEXTERN void netdbInit(void); +extern void netdbInit(void); -SQUIDCEXTERN void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt); -SQUIDCEXTERN void netdbPingSite(const char *hostname); +extern void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt); +extern void netdbPingSite(const char *hostname); void netdbDump(StoreEntry *); -SQUIDCEXTERN void netdbFreeMemory(void); -SQUIDCEXTERN int netdbHostHops(const char *host); -SQUIDCEXTERN int netdbHostRtt(const char *host); -SQUIDCEXTERN void netdbUpdatePeer(HttpRequest *, CachePeer * e, int rtt, int hops); +extern void netdbFreeMemory(void); +extern int netdbHostHops(const char *host); +extern int netdbHostRtt(const char *host); +extern void netdbUpdatePeer(HttpRequest *, CachePeer * e, int rtt, int hops); -SQUIDCEXTERN void netdbDeleteAddrNetwork(Ip::Address &addr); -SQUIDCEXTERN void netdbBinaryExchange(StoreEntry *); -SQUIDCEXTERN void netdbExchangeStart(void *); +extern void netdbDeleteAddrNetwork(Ip::Address &addr); +extern void netdbBinaryExchange(StoreEntry *); +extern void netdbExchangeStart(void *); -SQUIDCEXTERN void netdbExchangeUpdatePeer(Ip::Address &, CachePeer *, double, double); -SQUIDCEXTERN CachePeer *netdbClosestParent(HttpRequest *); -SQUIDCEXTERN void netdbHostData(const char *host, int *samp, int *rtt, int *hops); +extern void netdbExchangeUpdatePeer(Ip::Address &, CachePeer *, double, double); +extern CachePeer *netdbClosestParent(HttpRequest *); +extern void netdbHostData(const char *host, int *samp, int *rtt, int *hops); #endif /* ICMP_NET_DB_H */ diff --git a/src/mem.cc b/src/mem.cc index 58f9202924..e4895c9225 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -41,6 +41,7 @@ #include "MemBuf.h" #include "memMeter.h" #include "mgr/Registration.h" +#include "icmp/net_db.h" #include "RegexList.h" #include "SquidConfig.h" #include "SquidList.h" diff --git a/src/structs.h b/src/structs.h index 63e7c38a40..6db3f1fd2c 100644 --- a/src/structs.h +++ b/src/structs.h @@ -184,40 +184,6 @@ public: class PeerDigest; -class netdbEntry; - -class net_db_name { -public: - hash_link hash; /* must be first */ - net_db_name *next; - netdbEntry *net_db_entry; -}; - -class net_db_peer { -public: - const char *peername; - double hops; - double rtt; - time_t expires; -}; - -class netdbEntry { -public: - hash_link hash; /* must be first */ - char network[MAX_IPSTRLEN]; - int pings_sent; - int pings_recv; - double hops; - double rtt; - time_t next_ping_time; - time_t last_use_time; - int link_count; - net_db_name *hosts; - net_db_peer *peers; - int n_peers_alloc; - int n_peers; -}; - #if USE_SSL struct _sslproxy_cert_sign { int alg;