--------------------- PatchSet 5965 Date: 2007/10/15 10:03:07 Author: amosjeffries Branch: docs Tag: (none) Log: Link existing ICP protocol docs Members: src/ICP.h:1.7.4.1->1.7.4.2 src/htcp.h:1.4->1.4.28.1 src/icp_v2.cc:1.32->1.32.2.1 src/icp_v3.cc:1.8->1.8.2.1 src/fs/ufs/ufscommon.h:1.9.10.5->1.9.10.6 Index: squid3/src/ICP.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICP.h,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.2 diff -u -r1.7.4.1 -r1.7.4.2 --- squid3/src/ICP.h 26 Sep 2007 03:35:44 -0000 1.7.4.1 +++ squid3/src/ICP.h 15 Oct 2007 10:03:07 -0000 1.7.4.2 @@ -1,6 +1,5 @@ - /* - * $Id: ICP.h,v 1.7.4.1 2007/09/26 03:35:44 amosjeffries Exp $ + * $Id: ICP.h,v 1.7.4.2 2007/10/15 10:03:07 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -34,23 +33,34 @@ #ifndef SQUID_ICP_H #define SQUID_ICP_H +/** + \defgroup ServerProtocolICPAPI ICP + \ingroup ServerProtocol + */ + #include "StoreClient.h" /** + \ingroup ServerProtocolICPAPI + * * This struct is the wire-level header. * DO NOT add more move fields on pain of breakage. * DO NOT add virtual methods. */ - struct _icp_common_t { - unsigned char opcode; /* opcode */ - unsigned char version; /* version number */ - unsigned short length; /* total length (bytes) */ - u_int32_t reqnum; /* req number (req'd for UDP) */ + /* opcode */ + unsigned char opcode; + /* version number */ + unsigned char version; + /** total length (bytes) */ + unsigned short length; + /** req number (req'd for UDP) */ + u_int32_t reqnum; u_int32_t flags; u_int32_t pad; - u_int32_t shostid; /* sender host id */ + /** sender host id */ + u_int32_t shostid; #ifdef __cplusplus _icp_common_t(); @@ -64,6 +74,7 @@ #ifdef __cplusplus +/// \ingroup ServerProtocolICPAPI inline icp_opcode & operator++ (icp_opcode & aCode) { int tmp = (int) aCode; @@ -72,7 +83,10 @@ } -/** \todo mempool this */ +/** + \ingroup ServerProtocolICPAPI + \todo mempool this + */ class ICPState { @@ -89,6 +103,7 @@ #endif +/// \ingroup ServerProtocolICPAPI struct icpUdpData { @@ -106,28 +121,42 @@ struct timeval queue_time; }; - +/// \ingroup ServerProtocolICPAPI HttpRequest* icpGetRequest(char *url, int reqnum, int fd, struct sockaddr_in *from); +/// \ingroup ServerProtocolICPAPI int icpAccessAllowed(struct sockaddr_in *from, HttpRequest * icp_request); +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const struct sockaddr_in *from); +/// \ingroup ServerProtocolICPAPI extern icp_opcode icpGetCommonOpcode(); +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN int icpUdpSend(int, const struct sockaddr_in *, icp_common_t *, log_type, int); +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN log_type icpLogFromICPCode(icp_opcode opcode); +/// \ingroup ServerProtocolICPAPI void icpDenyAccess(struct sockaddr_in *from, char *url, int reqnum, int fd); +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN PF icpHandleUdp; +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN PF icpUdpSendQueue; +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN void icpHandleIcpV3(int, struct sockaddr_in, char *, int); +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN int icpCheckUdpHit(StoreEntry *, HttpRequest * request); +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN void icpConnectionsOpen(void); +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN void icpConnectionShutdown(void); +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN void icpConnectionClose(void); +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN int icpSetCacheKey(const cache_key * key); +/// \ingroup ServerProtocolICPAPI SQUIDCEXTERN const cache_key *icpGetCacheKey(const char *url, int reqnum); - #endif /* SQUID_ICP_H */ Index: squid3/src/htcp.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/htcp.h,v retrieving revision 1.4 retrieving revision 1.4.28.1 diff -u -r1.4 -r1.4.28.1 --- squid3/src/htcp.h 11 Aug 2003 02:13:03 -0000 1.4 +++ squid3/src/htcp.h 15 Oct 2007 10:03:07 -0000 1.4.28.1 @@ -1,6 +1,5 @@ - /* - * $Id: htcp.h,v 1.4 2003/08/11 02:13:03 squidadm Exp $ + * $Id: htcp.h,v 1.4.28.1 2007/10/15 10:03:07 amosjeffries Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -37,6 +36,7 @@ #if USE_HTCP #include "HttpHeader.h" +/// \ingroup ServerProtocolHTCP class HtcpReplyData { @@ -47,7 +47,7 @@ u_int32_t msg_id; double version; - struct + struct cto_t { /* cache-to-origin */ double rtt; @@ -58,9 +58,10 @@ cto; }; +/// \bug redundant typedef typedef class HtcpReplyData htcpReplyData; -SQUIDCEXTERN void neighborsHtcpReply(const cache_key *, htcpReplyData *, const struct sockaddr_in *); +SQUIDCEXTERN void neighborsHtcpReply(const cache_key *, HtcpReplyData *, const struct sockaddr_in *); SQUIDCEXTERN void htcpInit(void); SQUIDCEXTERN void htcpQuery(StoreEntry * e, HttpRequest * req, peer * p); SQUIDCEXTERN void htcpSocketShutdown(void); Index: squid3/src/icp_v2.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/icp_v2.cc,v retrieving revision 1.32 retrieving revision 1.32.2.1 diff -u -r1.32 -r1.32.2.1 --- squid3/src/icp_v2.cc 30 Apr 2007 17:51:40 -0000 1.32 +++ squid3/src/icp_v2.cc 15 Oct 2007 10:03:07 -0000 1.32.2.1 @@ -1,6 +1,5 @@ - /* - * $Id: icp_v2.cc,v 1.32 2007/04/30 17:51:40 squidadm Exp $ + * $Id: icp_v2.cc,v 1.32.2.1 2007/10/15 10:03:07 amosjeffries Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -33,6 +32,11 @@ * */ +/** + \defgroup ServerProtocolICPInternal2 ICPv2 Internals + \ingroup ServerProtocolICPAPI + */ + #include "squid.h" #include "Store.h" #include "comm.h" @@ -45,17 +49,22 @@ #include "SquidTime.h" #include "SwapDir.h" +/// \ingroup ServerProtocolICPInternal2 static void icpLogIcp(struct IN_ADDR, log_type, int, const char *, int); +/// \ingroup ServerProtocolICPInternal2 static void icpHandleIcpV2(int, struct sockaddr_in, char *, int); +/// \ingroup ServerProtocolICPInternal2 static void icpCount(void *, int, size_t, int); -/* +/** + \ingroup ServerProtocolICPInternal2 * IcpQueueHead is global so comm_incoming() knows whether or not * to call icpUdpSendQueue. */ -static icpUdpData *IcpQueueTail = NULL; static icpUdpData *IcpQueueHead = NULL; +/// \ingroup ServerProtocolICPInternal2 +static icpUdpData *IcpQueueTail = NULL; /* icp_common_t */ _icp_common_t::_icp_common_t() : opcode(ICP_INVALID), version(0), length(0), reqnum(0), flags(0), pad(0), shostid(0) @@ -108,7 +117,8 @@ /* ICP2State */ -class ICP2State:public ICPState, public StoreClient +/// \ingroup ServerProtocolICPInternal2 +class ICP2State : public ICPState, public StoreClient { public: @@ -124,11 +134,11 @@ u_int32_t flags; }; -ICP2State::~ICP2State () +ICP2State::~ICP2State() {} void -ICP2State::created (StoreEntry *newEntry) +ICP2State::created(StoreEntry *newEntry) { StoreEntry *entry = newEntry->isNull () ? NULL : newEntry; debugs(12, 5, "icpHandleIcpV2: OPCODE " << icp_opcode_str[header.opcode]); @@ -156,8 +166,8 @@ /* End ICP2State */ +/// \ingroup ServerProtocolICPInternal2 static void - icpLogIcp(struct IN_ADDR caddr, log_type logcode, int len, const char *url, int delay) { AccessLogEntry al; @@ -188,6 +198,7 @@ accessLogLog(&al, NULL); } +/// \ingroup ServerProtocolICPInternal2 void icpUdpSendQueue(int fd, void *unused) { @@ -326,9 +337,11 @@ return 1; } -/* ICP_ERR means no opcode selected here - * +/** * This routine selects an ICP opcode for ICP misses. + * + \retval ICP_ERR no opcode selected here + \retval ICP_MISS_NOFETCH store is rebuilding, no fetch is possible yet */ icp_opcode icpGetCommonOpcode() @@ -367,7 +380,6 @@ } void - icpCreateAndSend(icp_opcode opcode, int flags, char const *url, int reqnum, int pad, int fd, const struct sockaddr_in *from) { icp_common_t *reply = _icp_common_t::createMessage(opcode, flags, url, reqnum, pad); @@ -375,7 +387,6 @@ } void - icpDenyAccess(struct sockaddr_in *from, char *url, int reqnum, int fd) { debugs(12, 2, "icpDenyAccess: Access Denied for " << inet_ntoa(from->sin_addr) << " by " << AclMatchedName << "."); @@ -394,7 +405,6 @@ } int - icpAccessAllowed(struct sockaddr_in *from, HttpRequest * icp_request) { ACLChecklist checklist; @@ -417,7 +427,6 @@ } HttpRequest * - icpGetRequest(char *url, int reqnum, int fd, struct sockaddr_in * from) { if (strpbrk(url, w_space)) @@ -437,7 +446,6 @@ } static void - doV2Query(int fd, struct sockaddr_in from, char *buf, icp_common_t header) { int rtt = 0; @@ -490,7 +498,6 @@ } void - _icp_common_t::handleReply(char *buf, struct sockaddr_in *from) { if (neighbors_do_private_keys && reqnum == 0) @@ -509,7 +516,6 @@ } static void - icpHandleIcpV2(int fd, struct sockaddr_in from, char *buf, int len) { if (len <= 0) @@ -742,7 +748,7 @@ theOutICPAddr = xaddr.sin_addr; } -/* +/** * icpConnectionShutdown only closes the 'in' socket if it is * different than the 'out' socket. */ @@ -757,7 +763,7 @@ comm_close(theInIcpConnection); } - /* + /** * Here we set 'theInIcpConnection' to -1 even though the ICP 'in' * and 'out' sockets might be just one FD. This prevents this * function from executing repeatedly. When we are really ready to @@ -765,7 +771,7 @@ */ theInIcpConnection = -1; - /* + /** * Normally we only write to the outgoing ICP socket, but * we also have a read handler there to catch messages sent * to that specific interface. During shutdown, we must Index: squid3/src/icp_v3.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/icp_v3.cc,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -r1.8 -r1.8.2.1 --- squid3/src/icp_v3.cc 28 Apr 2007 22:51:53 -0000 1.8 +++ squid3/src/icp_v3.cc 15 Oct 2007 10:03:07 -0000 1.8.2.1 @@ -1,6 +1,5 @@ - /* - * $Id: icp_v3.cc,v 1.8 2007/04/28 22:51:53 squidadm Exp $ + * $Id: icp_v3.cc,v 1.8.2.1 2007/10/15 10:03:07 amosjeffries Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -33,16 +32,22 @@ * */ +/** + \defgroup ServerProtocolICPInternal3 ICPv3 Internals + \ingroup ServerProtocolICPAPI + */ + #include "squid.h" #include "Store.h" #include "ICP.h" #include "HttpRequest.h" +/// \ingroup ServerProtocolICPInternal3 class ICP3State : public ICPState, public StoreClient { public: - ICP3State(icp_common_t &aHeader, HttpRequest *aRequest): + ICP3State(icp_common_t &aHeader, HttpRequest *aRequest) : ICPState(aHeader, aRequest) {} @@ -50,8 +55,8 @@ void created (StoreEntry *newEntry); }; +/// \ingroup ServerProtocolICPInternal3 static void - doV3Query(int fd, struct sockaddr_in from, char *buf, icp_common_t header) { /* We have a valid packet */ @@ -80,11 +85,11 @@ StoreEntry::getPublic (state, url, METHOD_GET); } -ICP3State::~ICP3State () +ICP3State::~ICP3State() {} void -ICP3State::created (StoreEntry *newEntry) +ICP3State::created(StoreEntry *newEntry) { StoreEntry *entry = newEntry->isNull () ? NULL : newEntry; debugs(12, 5, "icpHandleIcpV3: OPCODE " << icp_opcode_str[header.opcode]); @@ -102,9 +107,10 @@ delete this; } + +/// \ingroup ServerProtocolICPInternal3 /* Currently Harvest cached-2.x uses ICP_VERSION_3 */ void - icpHandleIcpV3(int fd, struct sockaddr_in from, char *buf, int len) { if (len <= 0) Index: squid3/src/fs/ufs/ufscommon.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/ufs/ufscommon.h,v retrieving revision 1.9.10.5 retrieving revision 1.9.10.6 diff -u -r1.9.10.5 -r1.9.10.6 --- squid3/src/fs/ufs/ufscommon.h 15 Aug 2007 02:32:59 -0000 1.9.10.5 +++ squid3/src/fs/ufs/ufscommon.h 15 Oct 2007 10:03:08 -0000 1.9.10.6 @@ -1,6 +1,6 @@ /* - * $Id: ufscommon.h,v 1.9.10.5 2007/08/15 02:32:59 amosjeffries Exp $ + * $Id: ufscommon.h,v 1.9.10.6 2007/10/15 10:03:08 amosjeffries Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -327,6 +327,7 @@ private: CBDATA_CLASS2(StoreSearchUFS); + /// \bug (callback) should be hidden behind a proper human readable name void (callback)(void *cbdata); void *cbdata; StoreEntry * current; @@ -431,6 +432,7 @@ StoreEntry *e; bool fromLog; bool _done; + /// \bug (callback) should be hidden behind a proper human readable name void (callback)(void *cbdata); void *cbdata; };