]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/icmp/net_db.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / icmp / net_db.h
index 8246fcddf55a7203893be9960d2e30476d8c9466..1e944e63c54e5fce19cd90ab590ef2edf487abbf 100644 (file)
@@ -1,36 +1,81 @@
+/*
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef ICMP_NET_DB_H
 #define ICMP_NET_DB_H
 
-#include "config.h"
+#include "hash.h"
 
-namespace Ip {
-    class Address;
+class CachePeer;
+class HttpRequest;
+class netdbEntry;
+class StoreEntry;
+namespace Ip
+{
+class Address;
 };
 
-class StoreEntry;
-class HttpRequest;
+// POD
+class net_db_name
+{
+public:
+    hash_link hash;     /* must be first */
+    net_db_name *next;
+    netdbEntry *net_db_entry;
+};
 
-/* for struct peer */
-#include "structs.h"
+// POD
+class net_db_peer
+{
+public:
+    const char *peername;
+    double hops;
+    double rtt;
+    time_t expires;
+};
 
+// POD
+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;
+};
 
-SQUIDCEXTERN void netdbInit(void);
+void netdbInit(void);
 
-SQUIDCEXTERN void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt);
-SQUIDCEXTERN void netdbPingSite(const char *hostname);
-SQUIDCEXTERN void netdbDump(StoreEntry *);
+void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt);
+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 *, peer * e, int rtt, int hops);
+void netdbFreeMemory(void);
+int netdbHostHops(const char *host);
+int netdbHostRtt(const char *host);
+void netdbUpdatePeer(HttpRequest *, CachePeer * e, int rtt, int hops);
 
-SQUIDCEXTERN void netdbDeleteAddrNetwork(Ip::Address &addr);
-SQUIDCEXTERN void netdbBinaryExchange(StoreEntry *);
-SQUIDCEXTERN void netdbExchangeStart(void *);
+void netdbDeleteAddrNetwork(Ip::Address &addr);
+void netdbBinaryExchange(StoreEntry *);
+void netdbExchangeStart(void *);
 
-SQUIDCEXTERN void netdbExchangeUpdatePeer(Ip::Address &, peer *, double, double);
-SQUIDCEXTERN peer *netdbClosestParent(HttpRequest *);
-SQUIDCEXTERN void netdbHostData(const char *host, int *samp, int *rtt, int *hops);
+void netdbExchangeUpdatePeer(Ip::Address &, CachePeer *, double, double);
+CachePeer *netdbClosestParent(HttpRequest *);
+void netdbHostData(const char *host, int *samp, int *rtt, int *hops);
 
 #endif /* ICMP_NET_DB_H */
+