]> git.ipfire.org Git - thirdparty/squid.git/blame_incremental - src/PingData.h
Simplify appending SBuf to String (#2108)
[thirdparty/squid.git] / src / PingData.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 1996-2025 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 SQUID_SRC_PINGDATA_H
10#define SQUID_SRC_PINGDATA_H
11
12#include "mem/PoolingAllocator.h"
13
14#include <map>
15
16class PeerSelector;
17class PeerSelectorPingMonitor;
18
19typedef std::pair<const timeval, PeerSelector *> WaitingPeerSelector;
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
25class ping_data
26{
27
28public:
29 ping_data();
30
31 /// no ICP responses are expected beyond the returned absolute time
32 /// \returns start + timeout
33 timeval deadline() const;
34
35 struct timeval start;
36
37 struct timeval stop;
38 int n_sent;
39 int n_recv;
40 int n_replies_expected;
41 int timeout; /* msec */
42 int timedout;
43 int w_rtt;
44 int p_rtt;
45
46private:
47 friend PeerSelectorPingMonitor;
48 /// maintained by PeerSelectorPingMonitor
49 WaitingPeerSelectorPosition monitorRegistration;
50};
51
52#endif /* SQUID_SRC_PINGDATA_H */
53