]> git.ipfire.org Git - thirdparty/squid.git/blob - src/icmp/net_db.h
Simplified MSNT basic auth helper
[thirdparty/squid.git] / src / icmp / net_db.h
1 /*
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef ICMP_NET_DB_H
10 #define ICMP_NET_DB_H
11
12 #include "hash.h"
13
14 class CachePeer;
15 class HttpRequest;
16 class netdbEntry;
17 class StoreEntry;
18 namespace Ip
19 {
20 class Address;
21 };
22
23 // POD
24 class net_db_name
25 {
26 public:
27 hash_link hash; /* must be first */
28 net_db_name *next;
29 netdbEntry *net_db_entry;
30 };
31
32 // POD
33 class net_db_peer
34 {
35 public:
36 const char *peername;
37 double hops;
38 double rtt;
39 time_t expires;
40 };
41
42 // POD
43 class netdbEntry
44 {
45 public:
46 hash_link hash; /* must be first */
47 char network[MAX_IPSTRLEN];
48 int pings_sent;
49 int pings_recv;
50 double hops;
51 double rtt;
52 time_t next_ping_time;
53 time_t last_use_time;
54 int link_count;
55 net_db_name *hosts;
56 net_db_peer *peers;
57 int n_peers_alloc;
58 int n_peers;
59 };
60
61 void netdbInit(void);
62
63 void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt);
64 void netdbPingSite(const char *hostname);
65 void netdbDump(StoreEntry *);
66
67 void netdbFreeMemory(void);
68 int netdbHostHops(const char *host);
69 int netdbHostRtt(const char *host);
70 void netdbUpdatePeer(HttpRequest *, CachePeer * e, int rtt, int hops);
71
72 void netdbDeleteAddrNetwork(Ip::Address &addr);
73 void netdbBinaryExchange(StoreEntry *);
74 void netdbExchangeStart(void *);
75
76 void netdbExchangeUpdatePeer(Ip::Address &, CachePeer *, double, double);
77 CachePeer *netdbClosestParent(HttpRequest *);
78 void netdbHostData(const char *host, int *samp, int *rtt, int *hops);
79
80 #endif /* ICMP_NET_DB_H */
81