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