]> git.ipfire.org Git - thirdparty/squid.git/blob - src/icmp/net_db.h
Removed some unnecessary includes.
[thirdparty/squid.git] / src / icmp / net_db.h
1 #ifndef ICMP_NET_DB_H
2 #define ICMP_NET_DB_H
3
4 #include "hash.h"
5
6 class CachePeer;
7 namespace Ip
8 {
9 class Address;
10 };
11
12 class StoreEntry;
13 class HttpRequest;
14 class netdbEntry;
15
16 class net_db_name
17 {
18 public:
19 hash_link hash; /* must be first */
20 net_db_name *next;
21 netdbEntry *net_db_entry;
22 };
23
24 class net_db_peer
25 {
26 public:
27 const char *peername;
28 double hops;
29 double rtt;
30 time_t expires;
31 };
32
33 class netdbEntry
34 {
35 public:
36 hash_link hash; /* must be first */
37 char network[MAX_IPSTRLEN];
38 int pings_sent;
39 int pings_recv;
40 double hops;
41 double rtt;
42 time_t next_ping_time;
43 time_t last_use_time;
44 int link_count;
45 net_db_name *hosts;
46 net_db_peer *peers;
47 int n_peers_alloc;
48 int n_peers;
49 };
50
51 extern void netdbInit(void);
52
53 extern void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt);
54 extern void netdbPingSite(const char *hostname);
55 void netdbDump(StoreEntry *);
56
57 extern void netdbFreeMemory(void);
58 extern int netdbHostHops(const char *host);
59 extern int netdbHostRtt(const char *host);
60 extern void netdbUpdatePeer(HttpRequest *, CachePeer * e, int rtt, int hops);
61
62 extern void netdbDeleteAddrNetwork(Ip::Address &addr);
63 extern void netdbBinaryExchange(StoreEntry *);
64 extern void netdbExchangeStart(void *);
65
66 extern void netdbExchangeUpdatePeer(Ip::Address &, CachePeer *, double, double);
67 extern CachePeer *netdbClosestParent(HttpRequest *);
68 extern void netdbHostData(const char *host, int *samp, int *rtt, int *hops);
69
70 #endif /* ICMP_NET_DB_H */