/*
- * $Id: ACLDestinationDomain.cc,v 1.13 2007/04/28 22:26:37 hno Exp $
+ * $Id: ACLDestinationDomain.cc,v 1.14 2007/09/21 11:41:52 amosjeffries Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
}
void
-DestinationDomainLookup::checkForAsync(ACLChecklist *checklist)const
+DestinationDomainLookup::checkForAsync(ACLChecklist *checklist) const
{
checklist->asyncInProgress(true);
fqdncache_nbgethostbyaddr(checklist->dst_addr, LookupDone, checklist);
ACLDestinationDomainStrategy::match (ACLData<MatchType> * &data, ACLChecklist *checklist)
{
const ipcache_addrs *ia = NULL;
+ const char *fqdn = NULL;
if (data->match(checklist->request->host))
return 1;
if ((ia = ipcacheCheckNumeric(checklist->request->host)) == NULL)
return 0;
- const char *fqdn = NULL;
-
fqdn = fqdncache_gethostbyaddr(ia->in_addrs[0], FQDN_LOOKUP_IF_MISS);
if (fqdn) {
}
/*
- * aclIpAddrNetworkCompare - The guts of the comparison for IP ACLs.
- * The first argument (a) is a "host" address, i.e. the IP address
- * of a cache client. The second argument (b) is a "network" address
- * that might have a subnet and/or range. We mask the host address
- * bits with the network subnet mask.
- */
-/*
- * aclIpAddrNetworkCompare - The comparison function used for ACL
- * matching checks. The first argument (a) is a "host" address,
- * i.e. the IP address of a cache client. The second argument (b)
+ * aclIpAddrNetworkCompare - The guts of the comparison for IP ACLs
+ * matching checks. The first argument (p) is a "host" address,
+ * i.e. the IP address of a cache client. The second argument (q)
* is an entry in some address-based access control element. This
* function is called via ACLIP::match() and the splay library.
*/
* used by the splay insertion routine. It emits a warning if it
* detects a "collision" or overlap that would confuse the splay
* sorting algorithm. Much like aclDomainCompare.
+ * The first argument (p) is a "host" address, i.e. the IP address of a cache client.
+ * The second argument (b) is a "network" address that might have a subnet and/or range.
+ * We mask the host address bits with the network subnet mask.
*/
int
acl_ip_data::NetworkCompare(acl_ip_data * const & a, acl_ip_data * const &b)
}
/*
- * Decode a ascii representation (asc) of a IP adress, and place
- * adress and netmask information in addr and mask.
+ * Decode an ascii representation (asc) of a IP netmask address or CIDR,
+ * and place resulting information in mask.
* This function should NOT be called if 'asc' is a hostname!
*/
bool
-
acl_ip_data::DecodeMask(const char *asc, struct IN_ADDR *mask)
{
char junk;
if (!asc || !*asc)
{
mask->s_addr = htonl(0xFFFFFFFFul);
- return 1;
+ return true;
}
if (sscanf(asc, "%d%c", &a1, &junk) == 1 && a1 >= 0 && a1 < 33)
{ /* a significant bits value for a mask */
mask->s_addr = a1 ? htonl(0xfffffffful << (32 - a1)) : 0;
- return 1;
+ return true;
}
/* dotted notation */
if (safe_inet_addr(asc, mask))
- return 1;
+ return true;
- return 0;
+ return false;
}
#define SCAN_ACL1 "%[0123456789.]-%[0123456789.]/%[0123456789.]"
/*
- * $Id: ACLSourceDomain.cc,v 1.5 2007/04/28 22:26:37 hno Exp $
+ * $Id: ACLSourceDomain.cc,v 1.6 2007/09/21 11:41:52 amosjeffries Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
}
void
-SourceDomainLookup::checkForAsync(ACLChecklist *checklist)const
+SourceDomainLookup::checkForAsync(ACLChecklist *checklist) const
{
checklist->asyncInProgress(true);
fqdncache_nbgethostbyaddr(checklist->src_addr, LookupDone, checklist);
/*
- * $Id: DelayId.cc,v 1.22 2007/08/27 12:50:42 hno Exp $
+ * $Id: DelayId.cc,v 1.23 2007/09/21 11:41:52 amosjeffries Exp $
*
* DEBUG: section 77 Delay Pools
* AUTHOR: Robert Collins <robertc@squid-cache.org>
}
}
-
return DelayId();
}
/*
- * $Id: HttpHeader.cc,v 1.134 2007/08/13 17:20:51 hno Exp $
+ * $Id: HttpHeader.cc,v 1.135 2007/09/21 11:41:52 amosjeffries Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
/* field stats for all messages */
storeAppendPrintf(e, "\nHttp Fields Stats (replies and requests)\n");
- storeAppendPrintf(e, "%2s\t %-20s\t %5s\t %6s\t %6s\n",
+ storeAppendPrintf(e, "%2s\t %-25s\t %5s\t %6s\t %6s\n",
"id", "name", "#alive", "%err", "%repeat");
for (ht = (http_hdr_type)0; ht < HDR_ENUM_END; ++ht) {
HttpHeaderFieldInfo *f = Headers + ht;
- storeAppendPrintf(e, "%2d\t %-20s\t %5d\t %6.3f\t %6.3f\n",
+ storeAppendPrintf(e, "%2d\t %-25s\t %5d\t %6.3f\t %6.3f\n",
f->id, f->name.buf(), f->stat.aliveCount,
xpercent(f->stat.errCount, f->stat.parsCount),
xpercent(f->stat.repCount, f->stat.seenCount));
/*
- * $Id: ICP.h,v 1.7 2007/04/19 20:21:34 wessels Exp $
+ * $Id: ICP.h,v 1.8 2007/09/21 11:41:52 amosjeffries Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
#include "StoreClient.h"
-/* This struct is the wire-level header.
- * DO NOT add ore move fields on pain of breakage.
+/**
+ * This struct is the wire-level header.
+ * DO NOT add more move fields on pain of breakage.
* DO NOT add virtual methods.
*/
}
-/* todo: mempool this */
-
+/** \todo mempool this */
class ICPState
{
#endif
-typedef struct _icpUdpData icpUdpData;
-
-struct _icpUdpData
+struct icpUdpData
{
struct sockaddr_in address;
};
-HttpRequest *
-
-icpGetRequest(char *url, int reqnum, int fd, struct sockaddr_in *from);
+HttpRequest* icpGetRequest(char *url, int reqnum, int fd, struct sockaddr_in *from);
int icpAccessAllowed(struct sockaddr_in *from, HttpRequest * icp_request);
SQUIDCEXTERN const cache_key *icpGetCacheKey(const char *url, int reqnum);
-
-
#endif /* SQUID_ICP_H */
/*
- * $Id: PeerDigest.h,v 1.3 2007/05/29 13:31:38 amosjeffries Exp $
+ * $Id: PeerDigest.h,v 1.4 2007/09/21 11:41:52 amosjeffries Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
void *operator new (size_t);
void operator delete(void *);
- struct _peer *peer; /* pointer back to peer structure, argh */
- CacheDigest *cd; /* actual digest structure */
- String host; /* copy of peer->host */
- const char *req_result; /* text status of the last request */
+ struct _peer *peer; /* pointer back to peer structure, argh */
+ CacheDigest *cd; /* actual digest structure */
+ String host; /* copy of peer->host */
+ const char *req_result; /* text status of the last request */
struct
{
/*
- * $Id: asn.cc,v 1.114 2007/08/27 12:50:42 hno Exp $
+ * $Id: asn.cc,v 1.115 2007/09/21 11:41:52 amosjeffries Exp $
*
* DEBUG: section 53 AS Number handling
* AUTHOR: Duane Wessels, Kostas Anagnostakis
* enhancements (e.g. expires)
*/
-struct _as_info
+struct as_info
{
List<int> *as_number;
time_t expires; /* NOTUSED */
};
-struct _ASState
+struct ASState
{
StoreEntry *entry;
store_client *sc;
bool dataRead;
};
-typedef struct _ASState ASState;
-
-typedef struct _as_info as_info;
-
-/* entry into the radix tree */
-
-struct _rtentry
+/** entry into the radix tree */
+struct rtentry_t
{
-
struct squid_radix_node e_nodes[2];
as_info *e_info;
m_int e_addr;
m_int e_mask;
};
-typedef struct _rtentry rtentry_t;
-
static int asnAddNet(char *, int);
static void asnCacheStart(int as);
/*
- * $Id: client_db.cc,v 1.70 2007/05/29 13:31:39 amosjeffries Exp $
+ * $Id: client_db.cc,v 1.71 2007/09/21 11:41:52 amosjeffries Exp $
*
* DEBUG: section 0 Client Database
* AUTHOR: Duane Wessels
c->last_seen = squid_curtime;
}
-/*
- * clientdbEstablished()
+/**
* This function tracks the number of currently established connections
* for a client IP address. When a connection is accepted, call this
* with delta = 1. When the connection is closed, call with delta =
while ((c = (ClientInfo *) hash_next(client_table))) {
storeAppendPrintf(sentry, "Address: %s\n", hashKeyStr(&c->hash));
- storeAppendPrintf(sentry, "Name: %s\n", fqdnFromAddr(c->addr));
+ storeAppendPrintf(sentry, "Name: %s\n", fqdnFromAddr(c->addr));
storeAppendPrintf(sentry, "Currently established connections: %d\n",
c->n_established);
- storeAppendPrintf(sentry, " ICP Requests %d\n",
+ storeAppendPrintf(sentry, " ICP Requests %d\n",
c->Icp.n_requests);
for (l = LOG_TAG_NONE; l < LOG_TYPE_MAX; ++l) {
#if SQUID_SNMP
-struct IN_ADDR *
-
- client_entry(struct IN_ADDR *current)
+struct in_addr*
+client_entry(struct IN_ADDR *current)
{
ClientInfo *c = NULL;
char *key;