5 * SQUID Web Proxy Cache http://www.squid-cache.org/
6 * ----------------------------------------------------------
8 * Squid is the result of efforts by numerous individuals from
9 * the Internet community; see the CONTRIBUTORS file for full
10 * details. Many organizations have provided support for Squid's
11 * development; see the SPONSORS file for full details. Squid is
12 * Copyrighted (C) 2001 by the Regents of the University of
13 * California; see the COPYRIGHT file for full details. Squid
14 * incorporates software developed and/or copyrighted by other
15 * sources; see the CREDITS file for full details.
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
37 \defgroup ServerProtocolICPAPI ICP
38 \ingroup ServerProtocol
41 #include "StoreClient.h"
44 \ingroup ServerProtocolICPAPI
46 * This struct is the wire-level header.
47 * DO NOT add more move fields on pain of breakage.
48 * DO NOT add virtual methods.
50 struct _icp_common_t
{
54 unsigned char version
;
55 /** total length (bytes) */
56 unsigned short length
;
57 /** req number (req'd for UDP) */
64 /// \todo I don't believe this header is included in non-c++ code anywhere
65 /// the struct should become a public POD class and kill these #ifdef.
69 _icp_common_t(char *buf
, unsigned int len
);
71 void handleReply(char *buf
, IpAddress
&from
);
72 static _icp_common_t
*createMessage(icp_opcode opcode
, int flags
, const char *url
, int reqnum
, int pad
);
73 icp_opcode
getOpCode() const;
79 /// \ingroup ServerProtocolICPAPI
80 inline icp_opcode
& operator++ (icp_opcode
& aCode
)
82 int tmp
= (int) aCode
;
83 aCode
= (icp_opcode
) (++tmp
);
89 \ingroup ServerProtocolICPAPI
96 ICPState(icp_common_t
&aHeader
, HttpRequest
*aRequest
);
108 /// \ingroup ServerProtocolICPAPI
116 struct timeval start
;
121 struct timeval queue_time
;
124 /// \ingroup ServerProtocolICPAPI
125 HttpRequest
* icpGetRequest(char *url
, int reqnum
, int fd
, IpAddress
&from
);
127 /// \ingroup ServerProtocolICPAPI
128 int icpAccessAllowed(IpAddress
&from
, HttpRequest
* icp_request
);
130 /// \ingroup ServerProtocolICPAPI
131 SQUIDCEXTERN
void icpCreateAndSend(icp_opcode
, int flags
, char const *url
, int reqnum
, int pad
, int fd
, const IpAddress
&from
);
133 /// \ingroup ServerProtocolICPAPI
134 extern icp_opcode
icpGetCommonOpcode();
136 /// \ingroup ServerProtocolICPAPI
137 SQUIDCEXTERN
int icpUdpSend(int, const IpAddress
&, icp_common_t
*, log_type
, int);
139 /// \ingroup ServerProtocolICPAPI
140 SQUIDCEXTERN log_type
icpLogFromICPCode(icp_opcode opcode
);
142 /// \ingroup ServerProtocolICPAPI
143 void icpDenyAccess(IpAddress
&from
, char *url
, int reqnum
, int fd
);
145 /// \ingroup ServerProtocolICPAPI
146 SQUIDCEXTERN PF icpHandleUdp
;
148 /// \ingroup ServerProtocolICPAPI
149 SQUIDCEXTERN PF icpUdpSendQueue
;
151 /// \ingroup ServerProtocolICPAPI
152 SQUIDCEXTERN
void icpHandleIcpV3(int, IpAddress
&, char *, int);
154 /// \ingroup ServerProtocolICPAPI
155 SQUIDCEXTERN
int icpCheckUdpHit(StoreEntry
*, HttpRequest
* request
);
157 /// \ingroup ServerProtocolICPAPI
158 SQUIDCEXTERN
void icpConnectionsOpen(void);
160 /// \ingroup ServerProtocolICPAPI
161 SQUIDCEXTERN
void icpConnectionShutdown(void);
163 /// \ingroup ServerProtocolICPAPI
164 SQUIDCEXTERN
void icpConnectionClose(void);
166 /// \ingroup ServerProtocolICPAPI
167 SQUIDCEXTERN
int icpSetCacheKey(const cache_key
* key
);
169 /// \ingroup ServerProtocolICPAPI
170 SQUIDCEXTERN
const cache_key
*icpGetCacheKey(const char *url
, int reqnum
);
172 #endif /* SQUID_ICP_H */