]> git.ipfire.org Git - thirdparty/squid.git/blame_incremental - src/htcp.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / htcp.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 1996-2015 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_HTCP_H
10#define SQUID_HTCP_H
11
12#if USE_HTCP
13
14#include "http/forward.h"
15#include "HttpHeader.h"
16#include "ip/forward.h"
17
18/// \ingroup ServerProtocolHTCP
19class HtcpReplyData
20{
21
22public:
23 HtcpReplyData();
24 int hit;
25 HttpHeader hdr;
26 uint32_t msg_id;
27 double version;
28
29 struct cto_t {
30 /* cache-to-origin */
31 double rtt;
32 int samp;
33 int hops;
34 } cto;
35};
36
37/// \ingroup ServerProtocolHTCP
38void neighborsHtcpReply(const cache_key *, HtcpReplyData *, const Ip::Address &);
39
40/// \ingroup ServerProtocolHTCP
41void htcpOpenPorts(void);
42
43/**
44 * \ingroup ServerProtocolHTCP
45 *
46 * Generate and Send an HTCP query to the specified peer.
47 *
48 * \param e
49 * \param req
50 * \param p
51 * \retval 1 Successfully sent request.
52 * \retval 0 Unable to send request at this time. HTCP may be shutting down or starting up.
53 * Don't wait for a reply or count in stats as sent.
54 * \retval -1 Error sending request.
55 */
56int htcpQuery(StoreEntry * e, HttpRequest * req, CachePeer * p);
57
58/// \ingroup ServerProtocolHTCP
59void htcpClear(StoreEntry * e, const char *uri, HttpRequest * req, const HttpRequestMethod &method, CachePeer * p, htcp_clr_reason reason);
60
61/// \ingroup ServerProtocolHTCP
62void htcpSocketShutdown(void);
63
64/// \ingroup ServerProtocolHTCP
65void htcpClosePorts(void);
66
67#endif /* USE_HTCP */
68
69#endif /* SQUID_HTCP_H */
70