]> git.ipfire.org Git - thirdparty/squid.git/blame - src/PingData.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / PingData.h
CommitLineData
b24880fe 1/*
f70aedc4 2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
b24880fe 3 *
bbc27441
AJ
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.
b24880fe 7 */
bbc27441 8
b24880fe 9#ifndef SQUID_PINGDATA_H
10#define SQUID_PINGDATA_H
11
9865de72
EB
12#include "mem/PoolingAllocator.h"
13
14#include <map>
15
16class PeerSelector;
17class PeerSelectorPingMonitor;
18
ab36c3dc 19typedef std::pair<const timeval, PeerSelector *> WaitingPeerSelector;
9865de72
EB
20/// waiting PeerSelector objects, ordered by their absolute deadlines
21typedef std::multimap<timeval, PeerSelector *, std::less<timeval>, PoolingAllocator<WaitingPeerSelector> > WaitingPeerSelectors;
22typedef WaitingPeerSelectors::iterator WaitingPeerSelectorPosition;
23
24/// ICP probing of cache_peers during peer selection
b24880fe 25class ping_data
26{
27
28public:
29 ping_data();
30
9865de72
EB
31 /// no ICP responses are expected beyond the returned absolute time
32 /// \returns start + timeout
33 timeval deadline() const;
34
b24880fe 35 struct timeval start;
36
37 struct timeval stop;
38 int n_sent;
39 int n_recv;
40 int n_replies_expected;
f53969cc 41 int timeout; /* msec */
b24880fe 42 int timedout;
43 int w_rtt;
44 int p_rtt;
9865de72
EB
45
46private:
47 friend PeerSelectorPingMonitor;
48 /// maintained by PeerSelectorPingMonitor
49 WaitingPeerSelectorPosition monitorRegistration;
b24880fe 50};
51
52#endif /* SQUID_PINGDATA_H */
f53969cc 53