]> git.ipfire.org Git - thirdparty/squid.git/blame - src/htcp.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / htcp.h
CommitLineData
e6ccf245 1/*
bde978a6 2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
e6ccf245 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.
e6ccf245 7 */
8
9#ifndef SQUID_HTCP_H
10#define SQUID_HTCP_H
11
924f73bc 12#if USE_HTCP
9837e5f0 13
f35c0145 14#include "http/forward.h"
e74be5fd 15#include "HttpHeader.h"
e06b8df8 16#include "ip/forward.h"
924f73bc 17
63be0a78 18/// \ingroup ServerProtocolHTCP
75faaa7a 19class HtcpReplyData
924f73bc 20{
75faaa7a 21
22public:
23 HtcpReplyData();
924f73bc 24 int hit;
25 HttpHeader hdr;
09aabd84 26 uint32_t msg_id;
924f73bc 27 double version;
28
26ac0430 29 struct cto_t {
924f73bc 30 /* cache-to-origin */
31 double rtt;
32 int samp;
33 int hops;
2fadd50d 34 } cto;
924f73bc 35};
36
63be0a78 37/// \ingroup ServerProtocolHTCP
fad2588a 38void neighborsHtcpReply(const cache_key *, HtcpReplyData *, const Ip::Address &);
63be0a78 39
40/// \ingroup ServerProtocolHTCP
314782d4 41void htcpOpenPorts(void);
63be0a78 42
bebf08ff
AJ
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.
f53969cc 53 * Don't wait for a reply or count in stats as sent.
bebf08ff
AJ
54 * \retval -1 Error sending request.
55 */
314782d4 56int htcpQuery(StoreEntry * e, HttpRequest * req, CachePeer * p);
63be0a78 57
4f4fa815 58/// \ingroup ServerProtocolHTCP
314782d4 59void htcpClear(StoreEntry * e, const char *uri, HttpRequest * req, const HttpRequestMethod &method, CachePeer * p, htcp_clr_reason reason);
4f4fa815 60
63be0a78 61/// \ingroup ServerProtocolHTCP
314782d4 62void htcpSocketShutdown(void);
63be0a78 63
64/// \ingroup ServerProtocolHTCP
314782d4 65void htcpClosePorts(void);
75faaa7a 66
63be0a78 67#endif /* USE_HTCP */
924f73bc 68
e6ccf245 69#endif /* SQUID_HTCP_H */
f53969cc 70