]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved netdbEntry classes to icmp/net_db.h
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 17 Sep 2012 18:03:06 +0000 (20:03 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 17 Sep 2012 18:03:06 +0000 (20:03 +0200)
src/icmp/net_db.h
src/mem.cc
src/structs.h

index b5b341174f47bc34e1388e2a9bea23f794cdf906..55c0eb3349bcbb424efdf3b659d7567c9f8c242e 100644 (file)
@@ -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 */
index 58f920292401b211662dcc91fec0e5cd232b0d4c..e4895c922504a0022615d5ed860d00ab06449ff6 100644 (file)
@@ -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"
index 63e7c38a401c8d0135d12737615d27b9c704e8cf..6db3f1fd2ca4ab22ca79856ca5f4c5e75f611f60 100644 (file)
@@ -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;