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