-
/*
- * DEBUG: section 53 AS Number handling
- * AUTHOR: Duane Wessels, Kostas Anagnostakis
- *
- * SQUID Web Proxy Cache http://www.squid-cache.org/
- * ----------------------------------------------------------
- *
- * Squid is the result of efforts by numerous individuals from
- * the Internet community; see the CONTRIBUTORS file for full
- * details. Many organizations have provided support for Squid's
- * development; see the SPONSORS file for full details. Squid is
- * Copyrighted (C) 2001 by the Regents of the University of
- * California; see the COPYRIGHT file for full details. Squid
- * incorporates software developed and/or copyrighted by other
- * sources; see the CREDITS file for full details.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
*
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
*/
+/* DEBUG: section 53 AS Number handling */
+
#include "squid.h"
#include "acl/Acl.h"
#include "acl/Asn.h"
#include "Store.h"
#include "StoreClient.h"
#include "StoreClient.h"
-#include "wordlist.h"
#define WHOIS_PORT 43
-#define AS_REQBUF_SZ 4096
+#define AS_REQBUF_SZ 4096
/* BEGIN of definitions for radix tree entries */
/* explicit instantiation required for some systems */
-/// \cond AUTODOCS-IGNORE
+/// \cond AUTODOCS_IGNORE
template cbdata_type CbDataList<int>::CBDATA_CbDataList;
/// \endcond
*/
struct as_info {
CbDataList<int> *as_number;
- time_t expires; /* NOTUSED */
+ time_t expires; /* NOTUSED */
};
class ASState
{
+ CBDATA_CLASS(ASState);
+
public:
ASState();
~ASState();
int reqofs;
char reqbuf[AS_REQBUF_SZ];
bool dataRead;
-private:
- CBDATA_CLASS2(ASState);
};
CBDATA_CLASS_INIT(ASState);
ASState::ASState() :
- entry(NULL),
- sc(NULL),
- request(NULL),
- as_number(0),
- offset(0),
- reqofs(0),
- dataRead(false)
+ entry(NULL),
+ sc(NULL),
+ request(NULL),
+ as_number(0),
+ offset(0),
+ reqofs(0),
+ dataRead(false)
{
memset(reqbuf, 0, AS_REQBUF_SZ);
}
{
debugs(53, 3, entry->url());
storeUnregister(sc, entry, this);
- entry->unlock();
+ entry->unlock("~ASState");
}
/** entry into the radix tree */
extern "C" {
#endif
- static int destroyRadixNode(struct squid_radix_node *rn, void *w);
- static int printRadixNode(struct squid_radix_node *rn, void *sentry);
+static int destroyRadixNode(struct squid_radix_node *rn, void *w);
+static int printRadixNode(struct squid_radix_node *rn, void *sentry);
#if defined(__cplusplus)
}
/* initialize the radix tree structure */
-SQUIDCEXTERN int squid_max_keylen; /* yuck.. this is in lib/radix.c */
+SQUIDCEXTERN int squid_max_keylen; /* yuck.. this is in lib/radix.c */
void
asnInit(void)
asState->sc = storeClientListAdd(e, asState);
FwdState::fwdStart(Comm::ConnectionPointer(), e, asState->request.getRaw());
} else {
- e->lock();
+ e->lock("Asn");
asState->sc = storeClientListAdd(e, asState);
}
e->e_info = asinfo;
}
- if (rn == 0) { /* assert might expand to nothing */
+ if (rn == 0) { /* assert might expand to nothing */
xfree(asinfo);
delete q;
xfree(e);
return asnMatchIp(data, toMatch);
}
-wordlist *
-ACLASN::dump()
+SBufList
+ACLASN::dump() const
{
- wordlist *W = NULL;
- char buf[32];
+ SBufList sl;
+
CbDataList<int> *ldata = data;
while (ldata != NULL) {
- snprintf(buf, sizeof(buf), "%d", ldata->element);
- wordlistAdd(&W, buf);
+ SBuf s;
+ s.Printf("%d", ldata->element);
+ sl.push_back(s);
ldata = ldata->next;
}
- return W;
+ return sl;
}
bool
}
ACLDestinationASNStrategy ACLDestinationASNStrategy::Instance_;
+