]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SourceLayout: migrate IPAddress into lipip.la
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 16 Jan 2009 12:14:02 +0000 (01:14 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 16 Jan 2009 12:14:02 +0000 (01:14 +1300)
This also makes some small changes to other API inside libip to allow
libbip.la to be built first as a POD library before anything src/ gets built.

Anything added to it from this point on MUST NOT require linkage outside
of libip.la or the planned libcompat.

108 files changed:
Makefile.am
include/CbDataList.h
lib/Makefile.am
src/ACLARP.cc
src/ACLASN.h
src/ACLChecklist.h
src/ACLDestinationASN.h
src/ACLIP.cc
src/ACLIP.h
src/ACLMaxUserIP.cc
src/ACLMaxUserIP.h
src/ACLSourceASN.h
src/AccessLogEntry.h
src/AuthUser.cc
src/AuthUser.h
src/AuthUserRequest.cc
src/AuthUserRequest.h
src/CompositePoolNode.h
src/ConnectionDetail.h
src/DiskIO/DiskDaemon/DiskdIOStrategy.cc
src/ESI.cc
src/HttpRequest.h
src/ICAP/ICAPXaction.cc
src/ICP.h
src/Makefile.am
src/PeerSelectState.h
src/ProtoPort.h
src/SquidTime.h
src/asn.cc
src/auth/digest/auth_digest.cc
src/cache_cf.cc
src/cf.data.depend
src/cf.data.pre
src/cf_gen.cc
src/client_db.cc
src/client_side.cc
src/client_side.h
src/client_side_reply.cc
src/client_side_reply.h
src/client_side_request.cc
src/comm.cc
src/comm.h
src/delay_pools.cc
src/dns_internal.cc
src/dnsserver.cc
src/errorpage.h
src/external_acl.cc
src/fde.h
src/forward.cc
src/forward.h
src/fqdncache.cc
src/ftp.cc
src/globals.h
src/helper.h
src/htcp.cc
src/htcp.h
src/http.cc
src/icmp/Icmp.cc
src/icmp/Icmp.h
src/icmp/Icmp4.cc
src/icmp/Icmp4.h
src/icmp/Icmp6.cc
src/icmp/Icmp6.h
src/icmp/IcmpPinger.h
src/icmp/IcmpSquid.cc
src/icmp/IcmpSquid.h
src/icmp/Makefile.am
src/icmp/net_db.cc
src/icmp/net_db.h
src/icmp/testIcmp.h
src/icp_v2.cc
src/icp_v3.cc
src/ident.cc
src/ident.h
src/internal.cc
src/ip/IpAddress.cc [moved from lib/IPAddress.cc with 88% similarity]
src/ip/IpAddress.h [moved from include/IPAddress.h with 86% similarity]
src/ip/IpIntercept.cc
src/ip/IpIntercept.h
src/ip/Makefile.am
src/ip/QosConfig.cc
src/ip/QosConfig.h
src/ip/stubQosConfig.cc
src/ip/testIpAddress.cc [moved from lib/tests/testIPAddress.cc with 92% similarity]
src/ip/testIpAddress.h [moved from lib/tests/testIPAddress.h with 94% similarity]
src/ipc.cc
src/ipc_win32.cc
src/ipcache.cc
src/neighbors.cc
src/pconn.cc
src/pconn.h
src/protos.h
src/redirect.cc
src/send-announce.cc
src/snmp_agent.cc
src/snmp_core.cc
src/squid.h
src/structs.h
src/tests/stub_comm.cc
src/tools.cc
src/tunnel.cc
src/unlinkd.cc
src/wccp.cc
src/wccp2.cc
src/win32.cc
tools/Makefile.am
tools/cachemgr.cc
tools/squidclient.cc

index ff3a26b9368f916575d1ad7cfe61ffe726a40ed5..f90fc200bbff643ec678dd73a7df5e6604b8504f 100644 (file)
@@ -1,11 +1,9 @@
 ## Process this file with automake to produce Makefile.in
 #
-# $Id: Makefile.am,v 1.27 2006/05/11 01:36:57 hno Exp $
-#
 
 AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects 1.5 foreign
 DIST_SUBDIRS   = lib snmplib scripts src icons errors contrib doc helpers test-suite tools
-SUBDIRS                = lib @makesnmplib@ scripts src icons errors doc helpers test-suite tools
+SUBDIRS                = lib @makesnmplib@ scripts src/ip src icons errors doc helpers test-suite tools
 
 DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]*
 DEFAULT_PINGER         = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'`
index 79dcfef618eec2b86e13641934707cea46ed1bab..f11105b80cec51ca07b7064411dffff5eee534b0 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * $Id: List.h,v 1.8 2008/02/26 21:49:33 amosjeffries Exp $
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
index 87e9d4190ed4711a90aa2c7fcf35128f26ba1f1b..eefc2d5fbb019ca8e6f67f9d7f8051078a9e58af 100644 (file)
@@ -74,7 +74,6 @@ libmiscutil_a_SOURCES = \
        hash.c \
        heap.c \
        html_quote.c \
-       IPAddress.cc \
        iso3307.c \
        md5.c \
        radix.c \
@@ -130,9 +129,6 @@ CLEANFILES += testHeaders.c
 tests_testAll_SOURCES= \
        tests/testArray.h \
        tests/testArray.cc \
-       tests/testIPAddress.h \
-       tests/testIPAddress.cc \
-       IPAddress.cc \
        tests/testRFC1035.h \
        tests/testRFC1035.cc \
        tests/testMain.cc \
index 1e395911286f72061d81aa494ccd9c3743e7a174..54ab4032f835e7225955b99a349d9cf820df58ae 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: ACLARP.cc,v 1.29 2008/02/05 22:38:24 amosjeffries Exp $
- *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
  *
 #include <squid_windows.h>
 #endif
 #include "squid.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 #ifdef _SQUID_WIN32_
 
 struct arpreq {
 
-    IPAddress arp_pa;   /* protocol address */
+    IpAddress arp_pa;   /* protocol address */
 
     struct sockaddr arp_ha;   /* hardware address */
     int arp_flags;            /* flags */
@@ -84,7 +81,7 @@ struct arpreq {
 #endif
 static void aclParseArpList(SplayNode<acl_arp_data *> **curlist);
 static int decode_eth(const char *asc, char *eth);
-static int aclMatchArp(SplayNode<acl_arp_data *> **dataptr, IPAddress &c);
+static int aclMatchArp(SplayNode<acl_arp_data *> **dataptr, IpAddress &c);
 static SplayNode<acl_arp_data *>::SPLAYCMP aclArpCompare;
 static SplayNode<acl_arp_data *>::SPLAYWALKEE aclDumpArpListWalkee;
 
@@ -242,12 +239,12 @@ ACLARP::match(ACLChecklist *checklist)
 /* aclMatchArp */
 /***************/
 int
-aclMatchArp(SplayNode<acl_arp_data *> **dataptr, IPAddress &c)
+aclMatchArp(SplayNode<acl_arp_data *> **dataptr, IpAddress &c)
 {
     struct arpreq arpReq;
     struct sockaddr_in *sa = NULL;
 
-    IPAddress ipAddr = c;
+    IpAddress ipAddr = c;
 
 #if defined(_SQUID_LINUX_)
 
index a2bffe626e54c68f513b20ce687361aaeaeda5ca..1879be32aefe4acf67296c99aa965c90a0775b9a 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * $Id: ACLASN.h,v 1.10 2008/02/26 21:49:34 amosjeffries Exp $
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
@@ -39,9 +36,9 @@
 #include "CbDataList.h"
 #include "ACLStrategised.h"
 #include "ACLChecklist.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
-SQUIDCEXTERN int asnMatchIp(CbDataList<int> *, IPAddress &);
+SQUIDCEXTERN int asnMatchIp(CbDataList<int> *, IpAddress &);
 
 /// \ingroup ACLAPI
 SQUIDCEXTERN void asnInit(void);
@@ -50,7 +47,7 @@ SQUIDCEXTERN void asnInit(void);
 SQUIDCEXTERN void asnFreeMemory(void);
 
 /// \ingroup ACLAPI
-class ACLASN : public ACLData<IPAddress>
+class ACLASN : public ACLData<IpAddress>
 {
 
 public:
@@ -58,18 +55,18 @@ public:
 
     virtual ~ACLASN();
 
-    virtual bool match(IPAddress);
+    virtual bool match(IpAddress);
     virtual wordlist *dump();
     virtual void parse();
     bool empty() const;
-    virtual ACLData<IPAddress> *clone() const;
+    virtual ACLData<IpAddress> *clone() const;
     virtual void prepareForUse();
 
 private:
     static ACL::Prototype SourceRegistryProtoype;
-    static ACLStrategised<IPAddress> SourceRegistryEntry_;
+    static ACLStrategised<IpAddress> SourceRegistryEntry_;
     static ACL::Prototype DestinationRegistryProtoype;
-    static ACLStrategised<IPAddress> DestinationRegistryEntry_;
+    static ACLStrategised<IpAddress> DestinationRegistryEntry_;
     CbDataList<int> *data;
 };
 
index 3e2f422283453983bff2c0a36bee28932ed91dc2..a514cadf5c1cdcf2c4b0eb668b3b95454cd57d40 100644 (file)
@@ -123,11 +123,11 @@ public:
 
     const acl_access *accessList;
 
-    IPAddress src_addr;
+    IpAddress src_addr;
 
-    IPAddress dst_addr;
+    IpAddress dst_addr;
 
-    IPAddress my_addr;
+    IpAddress my_addr;
 
     struct peer *dst_peer;
 
index 0c2dd11d8f979876d35cb1e41092320bd4d5d44d..7586d4c8ad80ac711d78b4c4230a14768e93cbd0 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * $Id: ACLDestinationASN.h,v 1.4 2008/02/26 21:49:34 amosjeffries Exp $
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
 
 #include "ACLASN.h"
 #include "ACLStrategy.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 /// \ingroup ACLAPI
-class ACLDestinationASNStrategy : public ACLStrategy<IPAddress>
+class ACLDestinationASNStrategy : public ACLStrategy<IpAddress>
 {
 
 public:
index 9206ee47f9c91d608cbdb239a8e60266ba3530ab..0e44e903cbe3df2bf071bdf121eeda2e17e39ab5 100644 (file)
@@ -127,7 +127,7 @@ acl_ip_data::toStr(char *buf, int len) const
 int
 aclIpAddrNetworkCompare(acl_ip_data * const &p, acl_ip_data * const &q)
 {
-    IPAddress A = p->addr1;
+    IpAddress A = p->addr1;
 
     /* apply netmask */
     A.ApplyMask(q->mask);
@@ -191,7 +191,7 @@ acl_ip_data::NetworkCompare(acl_ip_data * const & a, acl_ip_data * const &b)
  * This function should NOT be called if 'asc' is a hostname!
  */
 bool
-acl_ip_data::DecodeMask(const char *asc, IPAddress &mask, int ctype)
+acl_ip_data::DecodeMask(const char *asc, IpAddress &mask, int ctype)
 {
     char junk;
     int a1 = 0;
@@ -237,7 +237,7 @@ acl_ip_data::FactoryParse(const char *t)
     LOCAL_ARRAY(char, mask, 256);
     acl_ip_data *r = NULL;
     acl_ip_data **Q = NULL;
-    IPAddress temp;
+    IpAddress temp;
     char c;
     unsigned int changed;
     acl_ip_data *q = new acl_ip_data;
@@ -294,13 +294,13 @@ acl_ip_data::FactoryParse(const char *t)
         /*
          * Note, must use plain xgetaddrinfo() here because at startup
          * ipcache hasn't been initialized
-         * TODO: offload this to one of the IPAddress lookups.
+         * TODO: offload this to one of the IpAddress lookups.
          */
 
         debugs(28, 5, "aclIpParseIpData: Lookup Host/IP " << addr1);
         struct addrinfo *hp = NULL, *x = NULL;
         struct addrinfo hints;
-        IPAddress *prev_addr = NULL;
+        IpAddress *prev_addr = NULL;
 
         memset(&hints, 0, sizeof(struct addrinfo));
 
@@ -442,7 +442,7 @@ ACLIP::empty () const
 }
 
 int
-ACLIP::match(IPAddress &clientip)
+ACLIP::match(IpAddress &clientip)
 {
     static acl_ip_data ClientAddress;
     /*
@@ -462,4 +462,4 @@ ACLIP::match(IPAddress &clientip)
 
 acl_ip_data::acl_ip_data () :addr1(), addr2(), mask(), next (NULL) {}
 
-acl_ip_data::acl_ip_data (IPAddress const &anAddress1, IPAddress const &anAddress2, IPAddress const &aMask, acl_ip_data *aNext) : addr1(anAddress1), addr2(anAddress2), mask(aMask), next(aNext) {}
+acl_ip_data::acl_ip_data (IpAddress const &anAddress1, IpAddress const &anAddress2, IpAddress const &aMask, acl_ip_data *aNext) : addr1(anAddress1), addr2(anAddress2), mask(aMask), next(aNext) {}
index e5ea68deafca571bd26fbe1dc6b2b32dc4a8f121..74f89757570ae40890845c410f099493acdc8054 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * $Id$
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
@@ -37,7 +34,7 @@
 
 #include "ACL.h"
 #include "splay.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 /// \ingroup ACLAPI
 class acl_ip_data
@@ -50,20 +47,20 @@ public:
 
     acl_ip_data ();
 
-    acl_ip_data (IPAddress const &, IPAddress const &, IPAddress const &, acl_ip_data *);
+    acl_ip_data (IpAddress const &, IpAddress const &, IpAddress const &, acl_ip_data *);
     void toStr(char *buf, int len) const;
 
-    IPAddress addr1;
+    IpAddress addr1;
 
-    IPAddress addr2;
+    IpAddress addr2;
 
-    IPAddress mask; /**< \todo This should perhapse be stored as a CIDR range now instead of a full IP mask. */
+    IpAddress mask; /**< \todo This should perhapse be stored as a CIDR range now instead of a full IP mask. */
 
     acl_ip_data *next;         /**< used for parsing, not for storing */
 
 private:
 
-    static bool DecodeMask(const char *asc, IPAddress &mask, int string_format_type);
+    static bool DecodeMask(const char *asc, IpAddress &mask, int string_format_type);
 };
 
 MEMPROXY_CLASS_INLINE(acl_ip_data);
@@ -91,7 +88,7 @@ public:
 
 protected:
 
-    int match(IPAddress &);
+    int match(IpAddress &);
     IPSplay *data;
 
 private:
index 9935ea3f5fa57282982ac34cbb25139c2c242b5b..9e5262156fd395b4789fafd65778dc28d24e0fa4 100644 (file)
@@ -117,7 +117,7 @@ ACLMaxUserIP::parse()
 int
 ACLMaxUserIP::match(AuthUserRequest * auth_user_request,
 
-                    IPAddress const &src_addr)
+                    IpAddress const &src_addr)
 {
     /*
      * the logic for flush the ip list when the limit is hit vs keep
index 42ce6ca85c207a9faca59ceddaff07c7121463aa..2cf425a12af6ed15c01e2695a1e85c7293bb3acd 100644 (file)
@@ -67,7 +67,7 @@ private:
     static Prototype RegistryProtoype;
     static ACLMaxUserIP RegistryEntry_;
 
-    int match(AuthUserRequest *, IPAddress const &);
+    int match(AuthUserRequest *, IpAddress const &);
     char const *class_;
     int maximum;
 
index e03517cf69310af12d94d9a13b13783b7dc18491..486f56b41d70f722b0bedb2109e731eb4527adac 100644 (file)
@@ -1,8 +1,4 @@
-
 /*
- * $Id: ACLSourceASN.h,v 1.3 2007/12/14 23:11:45 amosjeffries Exp $
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
@@ -42,9 +38,9 @@
 class ACLChecklist;
 
 #include "ACLStrategy.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
-class ACLSourceASNStrategy : public ACLStrategy<IPAddress>
+class ACLSourceASNStrategy : public ACLStrategy<IpAddress>
 {
 
 public:
index 6c7905c7a89af9cb95b947ae51eec671c78bda08..3719223fe0954547d5adaad884307681044c469b 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * $Id: AccessLogEntry.h,v 1.9 2008/02/26 00:15:48 rousskov Exp $
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
@@ -36,7 +33,7 @@
 #include "HttpVersion.h"
 #include "HttpRequestMethod.h"
 #include "HierarchyLogEntry.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 #include "HttpRequestMethod.h"
 
 /* forward decls */
@@ -92,7 +89,7 @@ public:
         {;
         }
 
-        IPAddress caddr;
+        IpAddress caddr;
         int64_t requestSize;
         int64_t replySize;
         int64_t highOffset;
index 5c002c5f7ab296e72e37f75443a26ba5fa694c95..ef74003972a57cd6b08f2d9e4a43f5347925280e 100644 (file)
@@ -239,7 +239,7 @@ AuthUser::clearIp()
 }
 
 void
-AuthUser::removeIp(IPAddress ipaddr)
+AuthUser::removeIp(IpAddress ipaddr)
 {
     auth_user_ip_t *ipdata = (auth_user_ip_t *) ip_list.head;
 
@@ -262,7 +262,7 @@ AuthUser::removeIp(IPAddress ipaddr)
 }
 
 void
-AuthUser::addIp(IPAddress ipaddr)
+AuthUser::addIp(IpAddress ipaddr)
 {
     auth_user_ip_t *ipdata = (auth_user_ip_t *) ip_list.head;
     int found = 0;
index 50629125006024ffaa7cbb8c85a09afdd46fe1ae..c2ca4fea8b37365cd510e12e64ab5a9528b85288 100644 (file)
@@ -41,7 +41,7 @@ class AuthUserHashPointer;
 /* for auth_type_t */
 #include "enums.h"
 
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 #include "dlink.h"
 
 /**
@@ -85,8 +85,8 @@ public:
     _SQUID_INLINE_ char const *username() const;
     _SQUID_INLINE_ void username(char const *);
     void clearIp();
-    void removeIp(IPAddress);
-    void addIp(IPAddress);
+    void removeIp(IpAddress);
+    void addIp(IpAddress);
     _SQUID_INLINE_ void addRequest(AuthUserRequest *);
 
     void lock();
index aef630dd4885ec5a4dd10555fa39269dfa04a920..f878ea716e5dcb658eb91181c72a1f423ecac771 100644 (file)
@@ -200,7 +200,7 @@ AuthUserRequest::denyMessage(char const * const default_message)
 }
 
 static void
-authenticateAuthUserRequestSetIp(AuthUserRequest * auth_user_request, IPAddress &ipaddr)
+authenticateAuthUserRequestSetIp(AuthUserRequest * auth_user_request, IpAddress &ipaddr)
 {
     AuthUser *auth_user = auth_user_request->user();
 
@@ -211,7 +211,7 @@ authenticateAuthUserRequestSetIp(AuthUserRequest * auth_user_request, IPAddress
 }
 
 void
-authenticateAuthUserRequestRemoveIp(AuthUserRequest * auth_user_request, IPAddress const &ipaddr)
+authenticateAuthUserRequestRemoveIp(AuthUserRequest * auth_user_request, IpAddress const &ipaddr)
 {
     AuthUser *auth_user = auth_user_request->user();
 
@@ -328,7 +328,7 @@ authTryGetUser (AuthUserRequest **auth_user_request, ConnStateData * conn, HttpR
  * Caller is responsible for locking and unlocking their *auth_user_request!
  */
 auth_acl_t
-AuthUserRequest::authenticate(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IPAddress &src_addr)
+AuthUserRequest::authenticate(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IpAddress &src_addr)
 {
     const char *proxy_auth;
     assert(headertype != 0);
@@ -503,7 +503,7 @@ AuthUserRequest::authenticate(AuthUserRequest ** auth_user_request, http_hdr_typ
 
 auth_acl_t
 
-AuthUserRequest::tryToAuthenticateAndSetAuthUser(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IPAddress &src_addr)
+AuthUserRequest::tryToAuthenticateAndSetAuthUser(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IpAddress &src_addr)
 {
     /* If we have already been called, return the cached value */
     AuthUserRequest *t = authTryGetUser (auth_user_request, conn, request);
index 0787703c0de611a3e10dc45a5f1bc45b00ad4329..95f2d4df72fd387da657ee0e0a02050c8df91054 100644 (file)
@@ -48,7 +48,7 @@ struct AuthUserIP {
     dlink_node node;
     /* IP addr this user authenticated from */
 
-    IPAddress ipaddr;
+    IpAddress ipaddr;
     time_t ip_expiretime;
 };
 
@@ -108,7 +108,7 @@ public:
 
     virtual void user(AuthUser *aUser) {_auth_user=aUser;}
 
-    static auth_acl_t tryToAuthenticateAndSetAuthUser(AuthUserRequest **, http_hdr_type, HttpRequest *, ConnStateData *, IPAddress &);
+    static auth_acl_t tryToAuthenticateAndSetAuthUser(AuthUserRequest **, http_hdr_type, HttpRequest *, ConnStateData *, IpAddress &);
     static void addReplyAuthHeader(HttpReply * rep, AuthUserRequest * auth_user_request, HttpRequest * request, int accelerated, int internal);
 
     AuthUserRequest();
@@ -146,7 +146,7 @@ public:
 
 private:
 
-    static auth_acl_t authenticate(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IPAddress &src_addr);
+    static auth_acl_t authenticate(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IpAddress &src_addr);
 
     /** return a message on the 407 error pages */
     char *message;
@@ -176,7 +176,7 @@ extern void authenticateFixHeader(HttpReply *, AuthUserRequest *, HttpRequest *,
 extern void authenticateAddTrailer(HttpReply *, AuthUserRequest *, HttpRequest *, int);
 
 /// \ingroup AuthAPI
-extern void authenticateAuthUserRequestRemoveIp(AuthUserRequest *, IPAddress const &);
+extern void authenticateAuthUserRequestRemoveIp(AuthUserRequest *, IpAddress const &);
 /// \ingroup AuthAPI
 extern void authenticateAuthUserRequestClearIp(AuthUserRequest *);
 /// \ingroup AuthAPI
index 1694d25e1c107da77f007f26cd2d1b39dbfe8a84..ccecf4a671d5df3fee10bc758b66ea85e9e79b7f 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: CompositePoolNode.h,v 1.10 2008/02/26 21:49:34 amosjeffries Exp $
- *
  * DEBUG: section 77    Delay Pools
  * AUTHOR: Robert Collins <robertc@squid-cache.org>
  * Based upon original delay pools code by
@@ -46,7 +44,7 @@
 #include "DelayPools.h"
 #include "DelayIdComposite.h"
 #include "CommRead.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 class StoreEntry;
 
@@ -78,7 +76,7 @@ public:
     public:
         CompositeSelectionDetails() {}
 
-        IPAddress src_addr;
+        IpAddress src_addr;
         AuthUserRequest *user;
         String tag;
     };
@@ -88,5 +86,5 @@ protected:
     DeferredReadManager deferredReads;
 };
 
-#endif
+#endif /* DELAY_POOLS */
 #endif /* COMPOSITEPOOLNODE_H */
index 4706b29e47c9cfe9feb3b3c73e46750dc2528afa..5a69bcd78eaee3ec994b2a01877953ac865ab1c4 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: ConnectionDetail.h,v 1.4 2007/12/14 23:11:45 amosjeffries Exp $
- *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Robert Collins
  *
@@ -37,7 +35,7 @@
 #ifndef _SQUIDCONNECTIONDETAIL_H_
 #define _SQUIDCONNECTIONDETAIL_H_
 
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 class ConnectionDetail
 {
@@ -46,9 +44,9 @@ public:
 
     ConnectionDetail();
 
-    IPAddress me;
+    IpAddress me;
 
-    IPAddress peer;
+    IpAddress peer;
 };
 
 #endif
index a3dd1a33a10178452bcb5b4d9821fb201702cd44..8ae0e941cb57f4709ddabe32b808c0d030186b61 100644 (file)
@@ -157,7 +157,7 @@ DiskdIOStrategy::init()
     char skey1[32];
     char skey2[32];
     char skey3[32];
-    IPAddress localhost;
+    IpAddress localhost;
 
     ikey = (getpid() << 10) + (instanceID << 2);
     ikey &= 0x7fffffff;
index 13f28bcee8a6132d4ca69b2eddb313f7ef1b6e3c..38a9fb58f76fddcfd169c002d3d37f3cb8ed7ac9 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: ESI.cc,v 1.30 2008/02/26 21:49:34 amosjeffries Exp $
- *
  * DEBUG: section 86    ESI processing
  * AUTHOR: Robert Collins
  *
@@ -59,7 +56,7 @@
 #include "ESIExpression.h"
 #include "HttpRequest.h"
 #include "MemBuf.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 /* quick reference on behaviour here.
  * The ESI specification 1.0 requires the ESI processor to be able to
@@ -1435,7 +1432,7 @@ ESIContext::freeResources ()
     /* don't touch incoming, it's a pointer into buffered anyway */
 }
 
-extern ErrorState *clientBuildError (err_type, http_status, char const *, IPAddress &, HttpRequest *);
+extern ErrorState *clientBuildError (err_type, http_status, char const *, IpAddress &, HttpRequest *);
 
 
 /* This can ONLY be used before we have sent *any* data to the client */
index a8a7e0f4ef9709464da5fc49f0392e5e56499d9d..86c67a6f86a42867e1803b5f14a4f98cd003b47e 100644 (file)
@@ -105,7 +105,7 @@ private:
     ConnStateData *pinned_connection;
 
 public:
-    IPAddress host_addr;
+    IpAddress host_addr;
 
     AuthUserRequest *auth_user_request;
 
@@ -125,13 +125,13 @@ public:
 
     int max_forwards;
 
-    IPAddress client_addr;
+    IpAddress client_addr;
 
 #if FOLLOW_X_FORWARDED_FOR
-    IPAddress indirect_client_addr;
+    IpAddress indirect_client_addr;
 #endif /* FOLLOW_X_FORWARDED_FOR */
 
-    IPAddress my_addr;
+    IpAddress my_addr;
 
     HierarchyLogEntry hier;
 
index f0958a2708bd651bea2470b5ce9a899a5b3197da..1be3a0ceb5735659d0d33cac8e691f2a1a580b59 100644 (file)
@@ -66,7 +66,7 @@ void ICAPXaction::start()
 // TODO: obey service-specific, OPTIONS-reported connection limit
 void ICAPXaction::openConnection()
 {
-    IPAddress client_addr;
+    IpAddress client_addr;
 
     Must(connection < 0);
 
@@ -94,7 +94,7 @@ void ICAPXaction::openConnection()
 
     disableRetries(); // we only retry pconn failures
 
-    IPAddress outgoing;
+    IpAddress outgoing;
     connection = comm_open(SOCK_STREAM, 0, outgoing,
                            COMM_NONBLOCKING, s.cfg().uri.buf());
 
@@ -153,7 +153,7 @@ void ICAPXaction::closeConnection()
         }
 
         if (reuseConnection) {
-            IPAddress client_addr;
+            IpAddress client_addr;
             debugs(93,3, HERE << "pushing pconn" << status());
             AsyncCall::Pointer call = NULL;
             commSetTimeout(connection, -1, call);
index 058da11df6aa6532aa7fab83baa09720aa8b1560..fbe72ba4c0694aa1cd49614a7a0ef4d12be66d6f 100644 (file)
--- a/src/ICP.h
+++ b/src/ICP.h
@@ -68,7 +68,7 @@ struct _icp_common_t {
     _icp_common_t();
     _icp_common_t(char *buf, unsigned int len);
 
-    void handleReply(char *buf, IPAddress &from);
+    void handleReply(char *buf, IpAddress &from);
     static _icp_common_t *createMessage(icp_opcode opcode, int flags, const char *url, int reqnum, int pad);
     icp_opcode getOpCode() const;
 #endif
@@ -99,7 +99,7 @@ public:
     HttpRequest *request;
     int fd;
 
-    IPAddress from;
+    IpAddress from;
     char *url;
 };
 
@@ -107,7 +107,7 @@ public:
 
 /// \ingroup ServerProtocolICPAPI
 struct icpUdpData {
-    IPAddress address;
+    IpAddress address;
     void *msg;
     size_t len;
     icpUdpData *next;
@@ -122,25 +122,25 @@ struct icpUdpData {
 };
 
 /// \ingroup ServerProtocolICPAPI
-HttpRequest* icpGetRequest(char *url, int reqnum, int fd, IPAddress &from);
+HttpRequest* icpGetRequest(char *url, int reqnum, int fd, IpAddress &from);
 
 /// \ingroup ServerProtocolICPAPI
-int icpAccessAllowed(IPAddress &from, HttpRequest * icp_request);
+int icpAccessAllowed(IpAddress &from, HttpRequest * icp_request);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const IPAddress &from);
+SQUIDCEXTERN void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const IpAddress &from);
 
 /// \ingroup ServerProtocolICPAPI
 extern icp_opcode icpGetCommonOpcode();
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN int icpUdpSend(int, const IPAddress &, icp_common_t *, log_type, int);
+SQUIDCEXTERN int icpUdpSend(int, const IpAddress &, icp_common_t *, log_type, int);
 
 /// \ingroup ServerProtocolICPAPI
 SQUIDCEXTERN log_type icpLogFromICPCode(icp_opcode opcode);
 
 /// \ingroup ServerProtocolICPAPI
-void icpDenyAccess(IPAddress &from, char *url, int reqnum, int fd);
+void icpDenyAccess(IpAddress &from, char *url, int reqnum, int fd);
 
 /// \ingroup ServerProtocolICPAPI
 SQUIDCEXTERN PF icpHandleUdp;
@@ -149,7 +149,7 @@ SQUIDCEXTERN PF icpHandleUdp;
 SQUIDCEXTERN PF icpUdpSendQueue;
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN void icpHandleIcpV3(int, IPAddress &, char *, int);
+SQUIDCEXTERN void icpHandleIcpV3(int, IpAddress &, char *, int);
 
 /// \ingroup ServerProtocolICPAPI
 SQUIDCEXTERN int icpCheckUdpHit(StoreEntry *, HttpRequest * request);
index 1bc4044d2969d0594d7885ac918a216dd29d1f1c..9e16c4ebb2884e471806e6e9a626a336aa277d30 100644 (file)
@@ -1,8 +1,6 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.am,v 1.201 2008/02/26 00:19:29 rousskov Exp $
-#
 #  Uncomment and customize the following to suit your needs:
 #
 
@@ -247,11 +245,18 @@ cf_gen_SOURCES = \
        cf_gen.cc \
        defines.h \
        debug.cc \
-       ip/stubQosConfig.cc \
        time.cc
 
 nodist_cf_gen_SOURCES = globals.cc
 nodist_cf_gen_HEADER = cf_gen_defines.h
+cf_gen_LDADD= \
+       libsquid.la \
+       libauth.la \
+       ip/libip.la \
+       -L../lib -lmiscutil \
+       @XTRA_LIBS@ \
+       @EPOLL_LIBS@ \
+       @MINGW_LIBS@
 cf_gen.$(OBJEXT): cf_gen_defines.h
 
 all_FSMODULES = \
@@ -747,8 +752,8 @@ recv_announce_SOURCES = recv-announce.cc SquidNew.cc
 ## client_db wants SNMP_SOURCE
 ## snmp_core wants ACLStringData
 ## SwapDir wants ConfigOption
-## tools.cc wants libip.la
-## client_side.cc wants libip.la
+## tools.cc wants ip/libip.la
+## client_side.cc wants ip/libip.la
 ufsdump_SOURCES = \
        debug.cc \
        int.cc \
@@ -958,7 +963,7 @@ sysconf_DATA = \
 data_DATA = \
        mib.txt
 
-LDADD = libsquid.la libauth.la -L../lib -lmiscutil @XTRA_LIBS@ @EPOLL_LIBS@ @MINGW_LIBS@
+LDADD = libsquid.la libauth.la ip/libip.la -L../lib -lmiscutil @XTRA_LIBS@ @EPOLL_LIBS@ @MINGW_LIBS@
 
 EXTRA_DIST = \
        cf_gen_defines \
@@ -1217,7 +1222,6 @@ tests_testAuth_SOURCES = \
        tests/stub_store.cc HttpHeaderTools.cc HttpHeader.cc acl.cc mem.cc \
        MemBuf.cc HttpHdrContRange.cc Packer.cc ACLChecklist.cc HttpHdrCc.cc HttpHdrSc.cc \
        HttpHdrScTarget.cc url.cc ACLProxyAuth.cc ACLRegexData.cc ACLUserData.cc \
-       ip/stubQosConfig.cc \
        StatHist.cc HttpHdrRange.cc ETag.cc tests/stub_errorpage.cc \
        tests/stub_HttpRequest.cc tests/stub_DelayId.cc \
        tests/stub_MemObject.cc mem_node.cc \
@@ -1243,6 +1247,7 @@ nodist_tests_testAuth_SOURCES = \
 tests_testAuth_LDADD= \
        libsquid.la \
        libauth.la \
+       ip/libip.la \
        @AUTH_LINKOBJS@ @AUTH_OBJS@ \
        -L../lib -lmiscutil \
        @REGEXLIB@ \
@@ -1294,7 +1299,6 @@ tests_testACLMaxUserIP_SOURCES= \
        mem_node.cc \
        Packer.cc \
        Parsing.cc \
-       ip/stubQosConfig.cc \
        StatHist.cc \
        stmem.cc \
        String.cc \
@@ -1317,6 +1321,7 @@ nodist_tests_testACLMaxUserIP_SOURCES= \
 tests_testACLMaxUserIP_LDADD= \
        libsquid.la \
        libauth.la \
+       ip/libip.la \
        -L../lib -lmiscutil \
        @REGEXLIB@ \
        @SQUID_CPPUNIT_LIBS@ \
@@ -1506,6 +1511,7 @@ tests_testDiskIO_SOURCES = \
 nodist_tests_testDiskIO_SOURCES= \
        $(SWAP_TEST_GEN_SOURCES)
 tests_testDiskIO_LDADD = \
+       ip/libip.la \
        @DISK_LIBS@ \
        $(SWAP_TEST_LDADD) \
        SquidConfig.o
@@ -2215,6 +2221,7 @@ nodist_tests_testStore_SOURCES= \
 tests_testStore_LDADD= \
        libsquid.la \
        libauth.la \
+       ip/libip.la \
        -L../lib -lmiscutil \
        @REGEXLIB@ \
        @SQUID_CPPUNIT_LIBS@ \
@@ -2227,7 +2234,6 @@ tests_testStore_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
 # libsquid pulls in SquidConfig and children. stub them.
 tests_testString_SOURCES = \
        mem.cc \
-       ip/stubQosConfig.cc \
        String.cc \
        tests/testMain.cc \
        tests/testString.cc \
@@ -2238,6 +2244,7 @@ nodist_tests_testString_SOURCES = \
        $(TESTSOURCES)
 tests_testString_LDADD = \
        libsquid.la \
+       ip/libip.la \
        -L../lib -lmiscutil \
        @REGEXLIB@ \
        @SQUID_CPPUNIT_LIBS@ \
@@ -2309,6 +2316,7 @@ nodist_tests_testUfs_SOURCES = \
        $(SWAP_TEST_GEN_SOURCES)
 tests_testUfs_LDADD = \
        libsquid.la \
+       ip/libip.la \
        $(SWAP_TEST_LDADD) \
        @SSLLIB@
 tests_testUfs_LDFLAGS = $(LIBADD_DL)
index 8939e40e1d31e8b735fb2a6f849aa4b736b3905c..b56e9db50b6c07584d9d0e7b1c33456ddc4cf96b 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: PeerSelectState.h,v 1.3 2007/12/14 23:11:45 amosjeffries Exp $
- *
  * AUTHOR: Robert Collins
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -38,7 +35,7 @@
 
 #include "cbdata.h"
 #include "PingData.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 class ps_state
 {
@@ -55,16 +52,16 @@ public:
     void *callback_data;
     FwdServer *servers;
     /*
-     * Why are these IPAddress instead of peer *?  Because a
+     * Why are these IpAddress instead of peer *?  Because a
      * peer structure can become invalid during the peer selection
      * phase, specifically after a reconfigure.  Thus we need to lookup
      * the peer * based on the address when we are finally ready to
      * reference the peer structure.
      */
 
-    IPAddress first_parent_miss;
+    IpAddress first_parent_miss;
 
-    IPAddress closest_parent_miss;
+    IpAddress closest_parent_miss;
     /*
      * ->hit can be peer* because it should only be
      * accessed during the thread when it is set
index e1d14093eb1bd26593b4bf27bc54622d0fab19af..863f87d4f7e49ac6209f6e5ee9a7c904c08bacaf 100644 (file)
@@ -13,7 +13,7 @@ struct http_port_list {
 
     http_port_list *next;
 
-    IPAddress s;
+    IpAddress s;
     char *protocol;            /* protocol name */
     char *name;                /* visible name */
     char *defaultsite;         /* default web site */
index 21dbe11c4b09c3c0fc6439d4c319712cd081e05e..b9a3d43f40dd742b427a5b7037e8e2a49955b5e3 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: SquidTime.h,v 1.4 2007/12/14 23:11:45 amosjeffries Exp $
- *
  * DEBUG: section 21    Time Functions
  * AUTHOR: Harvest Derived
  *
 #ifndef   SQUID_TIME_H
 #define   SQUID_TIME_H
 
-#include "squid.h"
+#include "config.h"
+
+#if HAVE_TIME_H
+#include <time.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
 
 /* globals for accessing time */
 extern struct timeval current_time;
index 79538901618ceb0dc01a99bdfb9bdc84adc54eb4..d855478a02247db0493d56883fcab6469df7fd32 100644 (file)
@@ -59,9 +59,9 @@ class m_ADDR
 {
 public:
     uint8_t len;
-    IPAddress addr;
+    IpAddress addr;
 
-    m_ADDR() : len(sizeof(IPAddress)) {};
+    m_ADDR() : len(sizeof(IpAddress)) {};
 };
 
 /* END of definitions for radix tree entries */
@@ -126,7 +126,7 @@ static OBJH asnStats;
 /* PUBLIC */
 
 int
-asnMatchIp(CbDataList<int> *data, IPAddress &addr)
+asnMatchIp(CbDataList<int> *data, IpAddress &addr)
 {
     struct squid_radix_node *rn;
     as_info *e;
@@ -392,8 +392,8 @@ asnAddNet(char *as_string, int as_number)
     CbDataList<int> *q = NULL;
     as_info *asinfo = NULL;
 
-    IPAddress mask;
-    IPAddress addr;
+    IpAddress mask;
+    IpAddress addr;
     char *t;
     int bitl;
 
@@ -511,8 +511,8 @@ printRadixNode(struct squid_radix_node *rn, void *_sentry)
     CbDataList<int> *q;
     as_info *asinfo;
     char buf[MAX_IPSTRLEN];
-    IPAddress addr;
-    IPAddress mask;
+    IpAddress addr;
+    IpAddress mask;
 
     assert(e);
     assert(e->e_info);
@@ -540,7 +540,7 @@ ACLASN::~ACLASN()
 
 bool
 
-ACLASN::match(IPAddress toMatch)
+ACLASN::match(IpAddress toMatch)
 {
     return asnMatchIp(data, toMatch);
 }
@@ -583,7 +583,7 @@ ACLASN::parse()
     }
 }
 
-ACLData<IPAddress> *
+ACLData<IpAddress> *
 ACLASN::clone() const
 {
     if (data)
@@ -594,18 +594,18 @@ ACLASN::clone() const
 
 /* explicit template instantiation required for some systems */
 
-template class ACLStrategised<IPAddress>;
+template class ACLStrategised<IpAddress>;
 
 ACL::Prototype ACLASN::SourceRegistryProtoype(&ACLASN::SourceRegistryEntry_, "src_as");
 
-ACLStrategised<IPAddress> ACLASN::SourceRegistryEntry_(new ACLASN, ACLSourceASNStrategy::Instance(), "src_as");
+ACLStrategised<IpAddress> ACLASN::SourceRegistryEntry_(new ACLASN, ACLSourceASNStrategy::Instance(), "src_as");
 
 ACL::Prototype ACLASN::DestinationRegistryProtoype(&ACLASN::DestinationRegistryEntry_, "dst_as");
 
-ACLStrategised<IPAddress> ACLASN::DestinationRegistryEntry_(new ACLASN, ACLDestinationASNStrategy::Instance(), "dst_as");
+ACLStrategised<IpAddress> ACLASN::DestinationRegistryEntry_(new ACLASN, ACLDestinationASNStrategy::Instance(), "dst_as");
 
 int
-ACLSourceASNStrategy::match (ACLData<IPAddress> * &data, ACLChecklist *checklist)
+ACLSourceASNStrategy::match (ACLData<IpAddress> * &data, ACLChecklist *checklist)
 {
     return data->match(checklist->src_addr);
 }
@@ -638,7 +638,7 @@ ACLDestinationASNStrategy::match (ACLData<MatchType> * &data, ACLChecklist *chec
         debugs(28, 3, "asnMatchAcl: Can't yet compare '" << "unknown" /*name*/ << "' ACL for '" << checklist->request->GetHost() << "'");
         checklist->changeState (DestinationIPLookup::Instance());
     } else {
-        IPAddress noaddr;
+        IpAddress noaddr;
         noaddr.SetNoAddr();
         return data->match(noaddr);
     }
index 342e879f18c177f9fbc4a5b44bd9343d83dfdde7..2dbe88b18b946805f2fea30c0ed62bdd1ebccf6e 100644 (file)
@@ -645,7 +645,7 @@ AuthDigestUserRequest::authenticate(HttpRequest * request, ConnStateData * conn,
             } else {
                 const char *useragent = request->header.getStr(HDR_USER_AGENT);
 
-                static IPAddress last_broken_addr;
+                static IpAddress last_broken_addr;
                 static int seen_broken_client = 0;
 
                 if (!seen_broken_client) {
index dac99b8f1709ad99a1697d93d275c64781d54be8..c48cceaf2cd4a7315ec86a594763eebe2332f1b4 100644 (file)
@@ -142,11 +142,11 @@ static void dump_denyinfo(StoreEntry * entry, const char *name, acl_deny_info_li
 static void free_denyinfo(acl_deny_info_list ** var);
 
 #if USE_WCCPv2
-static void parse_IPAddress_list(IPAddress_list **);
-static void dump_IPAddress_list(StoreEntry *, const char *, const IPAddress_list *);
-static void free_IPAddress_list(IPAddress_list **);
+static void parse_IpAddress_list(IpAddress_list **);
+static void dump_IpAddress_list(StoreEntry *, const char *, const IpAddress_list *);
+static void free_IpAddress_list(IpAddress_list **);
 #if CURRENTLY_UNUSED
-static int check_null_IPAddress_list(const IPAddress_list *);
+static int check_null_IpAddress_list(const IpAddress_list *);
 #endif /* CURRENTLY_UNUSED */
 #endif /* USE_WCCPv2 */
 
@@ -974,14 +974,14 @@ free_acl_access(acl_access ** head)
 }
 
 static void
-dump_address(StoreEntry * entry, const char *name, IPAddress &addr)
+dump_address(StoreEntry * entry, const char *name, IpAddress &addr)
 {
     char buf[MAX_IPSTRLEN];
     storeAppendPrintf(entry, "%s %s\n", name, addr.NtoA(buf,MAX_IPSTRLEN) );
 }
 
 static void
-parse_address(IPAddress *addr)
+parse_address(IpAddress *addr)
 {
     char *token = strtok(NULL, w_space);
 
@@ -1001,7 +1001,7 @@ parse_address(IPAddress *addr)
 }
 
 static void
-free_address(IPAddress *addr)
+free_address(IpAddress *addr)
 {
     addr->SetEmpty();
 }
@@ -2750,15 +2750,15 @@ parseNeighborType(const char *s)
 
 #if USE_WCCPv2
 void
-parse_IPAddress_list_token(IPAddress_list ** head, char *token)
+parse_IpAddress_list_token(IpAddress_list ** head, char *token)
 {
     char *t;
     char *host;
     char *tmp;
 
-    IPAddress ipa;
+    IpAddress ipa;
     unsigned short port;
-    IPAddress_list *s;
+    IpAddress_list *s;
 
     host = NULL;
     port = 0;
@@ -2804,24 +2804,24 @@ parse_IPAddress_list_token(IPAddress_list ** head, char *token)
     while (*head)
         head = &(*head)->next;
 
-    s = static_cast<IPAddress_list *>(xcalloc(1, sizeof(*s)));
+    s = static_cast<IpAddress_list *>(xcalloc(1, sizeof(*s)));
     s->s = ipa;
 
     *head = s;
 }
 
 static void
-parse_IPAddress_list(IPAddress_list ** head)
+parse_IpAddress_list(IpAddress_list ** head)
 {
     char *token;
 
     while ((token = strtok(NULL, w_space))) {
-        parse_IPAddress_list_token(head, token);
+        parse_IpAddress_list_token(head, token);
     }
 }
 
 static void
-dump_IPAddress_list(StoreEntry * e, const char *n, const IPAddress_list * s)
+dump_IpAddress_list(StoreEntry * e, const char *n, const IpAddress_list * s)
 {
     char ntoabuf[MAX_IPSTRLEN];
 
@@ -2834,7 +2834,7 @@ dump_IPAddress_list(StoreEntry * e, const char *n, const IPAddress_list * s)
 }
 
 static void
-free_IPAddress_list(IPAddress_list ** head)
+free_IpAddress_list(IpAddress_list ** head)
 {
     if (*head) delete *head;
     *head = NULL;
@@ -2845,7 +2845,7 @@ free_IPAddress_list(IPAddress_list ** head)
  * be used by icp_port and htcp_port
  */
 static int
-check_null_IPAddress_list(const IPAdress_list * s)
+check_null_IpAddress_list(const IPAdress_list * s)
 {
     return NULL == s;
 }
index 6a459ccb772da7c8162996598ef742902a67a2c5..bb2754d77e451d427c1de9daa42e4b18e5c09172 100644 (file)
@@ -42,7 +42,7 @@ QosConfig
 refreshpattern
 removalpolicy
 size_t
-IPAddress_list
+IpAddress_list
 string
 string
 time_t
index 9e8105cbab36d27f3e0038ab156c1d06693964c2..482113aa9c849435fb1b19ddd95d30706293ba22 100644 (file)
@@ -4024,7 +4024,7 @@ DOC_START
 DOC_END
 
 NAME: wccp2_router
-TYPE: IPAddress_list
+TYPE: IpAddress_list
 LOC: Config.Wccp2.router
 DEFAULT: none
 IFDEF: USE_WCCPv2
index 587f7c74a7c7a98f8ade3c0a7e56e3ec4e0c0fcd..d3a991321ce0345ac1c39cbca966325f62f84c3f 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: cf_gen.cc,v 1.62 2007/09/17 20:21:23 hno Exp $
- *
  * DEBUG: none          Generate squid.conf.default and cf_parser.h
  * AUTHOR: Max Okumoto
  *
  *                      administrator.
  *****************************************************************************/
 
-#include "squid.h"
-#include "SquidTime.h"
+//#include "squid.h"
+#include "config.h"
+#include "assert.h"
+//#include "SquidTime.h"
 #include "cf_gen_defines.h"
+#include "util.h"
+
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STRING_H
+#include <ctype.h>
+#endif
 
 #define MAX_LINE       1024    /* longest configuration line */
 #define _PATH_PARSER           "cf_parser.h"
index 709e305f2895dc29145de1746b0bfe6d8a66a723..40f862464302dc3b12d90dda652530eb1a40dd55 100644 (file)
@@ -42,7 +42,7 @@
 
 static hash_table *client_table = NULL;
 
-static ClientInfo *clientdbAdd(const IPAddress &addr);
+static ClientInfo *clientdbAdd(const IpAddress &addr);
 static FREE clientdbFreeItem;
 static void clientdbStartGC(void);
 static void clientdbScheduledGC(void *);
@@ -56,7 +56,7 @@ static int cleanup_removed;
 
 static ClientInfo *
 
-clientdbAdd(const IPAddress &addr)
+clientdbAdd(const IpAddress &addr)
 {
     ClientInfo *c;
     char *buf = new char[MAX_IPSTRLEN];
@@ -94,7 +94,7 @@ clientdbInit(void)
 }
 
 void
-clientdbUpdate(const IPAddress &addr, log_type ltype, protocol_t p, size_t size)
+clientdbUpdate(const IpAddress &addr, log_type ltype, protocol_t p, size_t size)
 {
     char key[MAX_IPSTRLEN];
     ClientInfo *c;
@@ -138,7 +138,7 @@ clientdbUpdate(const IPAddress &addr, log_type ltype, protocol_t p, size_t size)
  * -1.  To get the current value, simply call with delta = 0.
  */
 int
-clientdbEstablished(const IPAddress &addr, int delta)
+clientdbEstablished(const IpAddress &addr, int delta)
 {
     char key[MAX_IPSTRLEN];
     ClientInfo *c;
@@ -165,7 +165,7 @@ clientdbEstablished(const IPAddress &addr, int delta)
 #define CUTOFF_SECONDS 3600
 int
 
-clientdbCutoffDenied(const IPAddress &addr)
+clientdbCutoffDenied(const IpAddress &addr)
 {
     char key[MAX_IPSTRLEN];
     int NR;
@@ -384,8 +384,8 @@ clientdbStartGC(void)
 
 #if SQUID_SNMP
 
-IPAddress *
-client_entry(IPAddress *current)
+IpAddress *
+client_entry(IpAddress *current)
 {
     ClientInfo *c = NULL;
     char key[MAX_IPSTRLEN];
index 89583cb6b74a725cfc99b76e6441904c4cfebdc1..828a375be8dcf7b66ce18f7f57c7f7e0c7247c66 100644 (file)
@@ -166,7 +166,7 @@ static void connNoteUseOfBuffer(ConnStateData* conn, size_t byteCount);
 static int connKeepReadingIncompleteRequest(ConnStateData * conn);
 static void connCancelIncompleteRequests(ConnStateData * conn);
 
-static ConnStateData *connStateCreate(const IPAddress &peer, const IPAddress &me, int fd, http_port_list *port);
+static ConnStateData *connStateCreate(const IpAddress &peer, const IpAddress &me, int fd, http_port_list *port);
 
 
 int
@@ -2766,7 +2766,7 @@ okToAccept()
 }
 
 ConnStateData *
-connStateCreate(const IPAddress &peer, const IPAddress &me, int fd, http_port_list *port)
+connStateCreate(const IpAddress &peer, const IpAddress &me, int fd, http_port_list *port)
 {
     ConnStateData *result = new ConnStateData;
 
@@ -2779,7 +2779,7 @@ connStateCreate(const IPAddress &peer, const IPAddress &me, int fd, http_port_li
     result->port = cbdataReference(port);
 
     if (port->intercepted || port->spoof_client_ip) {
-        IPAddress client, dst;
+        IpAddress client, dst;
 
         if (IpInterceptor.NatLookup(fd, me, peer, client, dst) == 0) {
             result->me = client;
index d1a768df80f56c78a5470c5b0de2a8c6e8d5c8f7..317c6dd02fa1cbf63d92536f503eba74cac3860c 100644 (file)
@@ -173,11 +173,11 @@ public:
      */
     ClientSocketContext::Pointer currentobject;
 
-    IPAddress peer;
+    IpAddress peer;
 
-    IPAddress me;
+    IpAddress me;
 
-    IPAddress log_addr;
+    IpAddress log_addr;
     char rfc931[USER_IDENT_SZ];
     int nrequests;
 
index f449f65742f927a0af6d2175160b25210f317c72..6e21f2a7d748cca46f6541d0b10a17e7961ec388 100644 (file)
@@ -64,7 +64,7 @@ CBDATA_CLASS_INIT(clientReplyContext);
 
 /* Local functions */
 extern "C" CSS clientReplyStatus;
-extern ErrorState *clientBuildError(err_type, http_status, char const *, IPAddress &, HttpRequest *);
+extern ErrorState *clientBuildError(err_type, http_status, char const *, IpAddress &, HttpRequest *);
 
 /* privates */
 
@@ -93,7 +93,7 @@ clientReplyContext::clientReplyContext(ClientHttpRequest *clientContext) : http
 void
 clientReplyContext::setReplyToError(
     err_type err, http_status status, const HttpRequestMethod& method, char const *uri,
-    IPAddress &addr, HttpRequest * failedrequest, char *unparsedrequest,
+    IpAddress &addr, HttpRequest * failedrequest, char *unparsedrequest,
     AuthUserRequest * auth_user_request)
 {
     ErrorState *errstate =
@@ -1749,7 +1749,7 @@ clientReplyContext::next() const
 void
 clientReplyContext::sendBodyTooLargeError()
 {
-    IPAddress tmp_noaddr;
+    IpAddress tmp_noaddr;
     tmp_noaddr.SetNoAddr(); // TODO: make a global const
     ErrorState *err = clientBuildError(ERR_TOO_BIG, HTTP_FORBIDDEN, NULL,
                                        http->getConn() != NULL ? http->getConn()->peer : tmp_noaddr,
@@ -1817,7 +1817,7 @@ clientReplyContext::processReplyAccessResult(bool accessAllowed)
         if (page_id == ERR_NONE)
             page_id = ERR_ACCESS_DENIED;
 
-        IPAddress tmp_noaddr;
+        IpAddress tmp_noaddr;
         tmp_noaddr.SetNoAddr();
         err = clientBuildError(page_id, HTTP_FORBIDDEN, NULL,
                                http->getConn() != NULL ? http->getConn()->peer : tmp_noaddr,
@@ -2051,7 +2051,7 @@ clientReplyContext::createStoreEntry(const HttpRequestMethod& m, request_flags f
 
 ErrorState *
 clientBuildError(err_type page_id, http_status status, char const *url,
-                 IPAddress &src_addr, HttpRequest * request)
+                 IpAddress &src_addr, HttpRequest * request)
 {
     ErrorState *err = errorCon(page_id, status, request);
     err->src_addr = src_addr;
index ffaacdb0a648b78e001adb6c78d965686e305ffb..71d51199d1e47aa852c5c64a1136e5f923404d49 100644 (file)
@@ -1,8 +1,4 @@
-
 /*
- * $Id: client_side_reply.h,v 1.21 2008/02/08 18:31:02 rousskov Exp $
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
@@ -40,9 +36,9 @@
 #include "clientStream.h"
 #include "StoreClient.h"
 #include "client_side_request.h"
-#include "IPAddress.h"
 
 class ErrorState;
+class IpAddress;
 
 /* XXX make static method */
 
@@ -76,7 +72,7 @@ public:
     int storeOKTransferDone() const;
     int storeNotOKTransferDone() const;
 
-    void setReplyToError(err_type, http_status, const HttpRequestMethod&, char const *, IPAddress &, HttpRequest *, char *, AuthUserRequest *);
+    void setReplyToError(err_type, http_status, const HttpRequestMethod&, char const *, IpAddress &, HttpRequest *, char *, AuthUserRequest *);
     void createStoreEntry(const HttpRequestMethod& m, request_flags flags);
     void removeStoreReference(store_client ** scp, StoreEntry ** ep);
     void removeClientStoreReference(store_client **scp, ClientHttpRequest *http);
index 49a4646a2e171ceece0eddec5bfe826475b1b4dd..57a1395bca5d9c46a1076827242d6dc315f936e9 100644 (file)
@@ -583,7 +583,7 @@ ClientRequestContext::clientAccessCheckDone(int answer)
         clientStreamNode *node = (clientStreamNode *)http->client_stream.tail->prev->data;
         clientReplyContext *repContext = dynamic_cast<clientReplyContext *>(node->data.getRaw());
         assert (repContext);
-        IPAddress tmpnoaddr;
+        IpAddress tmpnoaddr;
         tmpnoaddr.SetNoAddr();
         repContext->setReplyToError(page_id, status,
                                     http->request->method, NULL,
@@ -1459,7 +1459,7 @@ ClientHttpRequest::handleAdaptationFailure(bool bypassable)
     // The original author of the code also wanted to pass an errno to
     // setReplyToError, but it seems unlikely that the errno reflects the
     // true cause of the error at this point, so I did not pass it.
-    IPAddress noAddr;
+    IpAddress noAddr;
     noAddr.SetNoAddr();
     ConnStateData * c = getConn();
     repContext->setReplyToError(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR,
index 4b032cbff537b364aeb71e12e8c7c6e7f0e138cf..e4a079243f178965e89459f292c55d197c0370f3 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: comm.cc,v 1.447 2008/02/26 21:49:34 amosjeffries Exp $
- *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
  *
@@ -47,9 +44,9 @@
 #include "pconn.h"
 #include "SquidTime.h"
 #include "CommCalls.h"
-#include "IPAddress.h"
 #include "DescriptorSet.h"
 #include "icmp/net_db.h"
+#include "ip/IpAddress.h"
 #include "ip/IpIntercept.h"
 
 #if defined(_SQUID_CYGWIN_)
@@ -209,10 +206,10 @@ public:
 // defaults given by client
     char *host;
     u_short default_port;
-    IPAddress default_addr;
+    IpAddress default_addr;
     // NP: CANNOT store the default addr:port together as it gets set/reset differently.
 
-    IPAddress S;
+    IpAddress S;
     AsyncCall::Pointer callback;
 
     int fd;
@@ -498,7 +495,7 @@ comm_read_cancel(int fd, AsyncCall::Pointer &callback)
  * synchronous wrapper around udp socket functions
  */
 int
-comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, IPAddress &from)
+comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, IpAddress &from)
 {
     statCounter.syscalls.sock.recvfroms++;
     int x = 0;
@@ -522,7 +519,7 @@ comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, IPAddress &from)
 int
 comm_udp_recv(int fd, void *buf, size_t len, int flags)
 {
-    IPAddress nul;
+    IpAddress nul;
     return comm_udp_recvfrom(fd, buf, len, flags, nul);
 }
 
@@ -549,7 +546,7 @@ comm_has_incomplete_write(int fd)
 u_short
 comm_local_port(int fd)
 {
-    IPAddress temp;
+    IpAddress temp;
     struct addrinfo *addr = NULL;
     fde *F = &fd_table[fd];
 
@@ -607,7 +604,7 @@ commBind(int s, struct addrinfo &inaddr)
 int
 comm_open(int sock_type,
           int proto,
-          IPAddress &addr,
+          IpAddress &addr,
           int flags,
           const char *note)
 {
@@ -672,7 +669,7 @@ comm_set_transparent(int fd)
 int
 comm_openex(int sock_type,
             int proto,
-            IPAddress &addr,
+            IpAddress &addr,
             int flags,
             unsigned char TOS,
             const char *note)
@@ -940,7 +937,7 @@ int
 ConnectStateData::commResetFD()
 {
     struct addrinfo *AI = NULL;
-    IPAddress nul;
+    IpAddress nul;
     int new_family = AF_UNSPEC;
 
 // XXX: do we have to check this?
@@ -1189,7 +1186,7 @@ int commSetTimeout(int fd, int timeout, AsyncCall::Pointer &callback)
 }
 
 int
-comm_connect_addr(int sock, const IPAddress &address)
+comm_connect_addr(int sock, const IpAddress &address)
 {
     comm_err_t status = COMM_OK;
     fde *F = &fd_table[sock];
@@ -1608,7 +1605,7 @@ _comm_close(int fd, char const *file, int line)
 /* Send a udp datagram to specified TO_ADDR. */
 int
 comm_udp_sendto(int fd,
-                const IPAddress &to_addr,
+                const IpAddress &to_addr,
                 const void *buf,
                 int len)
 {
index 55678480d926722fe81d9cf4e64074886e4971bf..006a820b60d67d8b4fc1ece4057307feb9e2f860 100644 (file)
@@ -6,7 +6,7 @@
 #include "AsyncCall.h"
 #include "StoreIOBuffer.h"
 #include "Array.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 #define COMMIO_FD_READCB(fd)    (&commfd_table[(fd)].readcb)
 #define COMMIO_FD_WRITECB(fd)   (&commfd_table[(fd)].writecb)
@@ -49,20 +49,20 @@ SQUIDCEXTERN void comm_lingering_close(int fd);
 SQUIDCEXTERN void commConnectStart(int fd, const char *, u_short, CNCB *, void *);
 void commConnectStart(int fd, const char *, u_short, AsyncCall::Pointer &cb);
 
-SQUIDCEXTERN int comm_connect_addr(int sock, const IPAddress &addr);
+SQUIDCEXTERN int comm_connect_addr(int sock, const IpAddress &addr);
 SQUIDCEXTERN void comm_init(void);
 SQUIDCEXTERN void comm_exit(void);
 
-SQUIDCEXTERN int comm_open(int, int, IPAddress &, int, const char *note);
+SQUIDCEXTERN int comm_open(int, int, IpAddress &, int, const char *note);
 
-SQUIDCEXTERN int comm_openex(int, int, IPAddress &, int, unsigned char TOS, const char *);
+SQUIDCEXTERN int comm_openex(int, int, IpAddress &, int, unsigned char TOS, const char *);
 SQUIDCEXTERN u_short comm_local_port(int fd);
 SQUIDCEXTERN int comm_set_tos(int fd, int tos);
 
 SQUIDCEXTERN void commSetSelect(int, unsigned int, PF *, void *, time_t);
 SQUIDCEXTERN void commResetSelect(int);
 
-SQUIDCEXTERN int comm_udp_sendto(int sock, const IPAddress &to, const void *buf, int buflen);
+SQUIDCEXTERN int comm_udp_sendto(int sock, const IpAddress &to, const void *buf, int buflen);
 extern void comm_write(int fd, const char *buf, int len, IOCB *callback, void *callback_data, FREE *func);
 extern void comm_write(int fd, const char *buf, int size, AsyncCall::Pointer &callback, FREE * free_func = NULL);
 SQUIDCEXTERN void comm_write_mbuf(int fd, MemBuf *mb, IOCB * handler, void *handler_data);
@@ -98,7 +98,7 @@ extern void comm_read(int fd, char *buf, int len, IOCB *handler, void *data);
 extern void comm_read(int fd, char *buf, int len, AsyncCall::Pointer &callback);
 extern void comm_read_cancel(int fd, IOCB *callback, void *data);
 extern void comm_read_cancel(int fd, AsyncCall::Pointer &callback);
-extern int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, IPAddress &from);
+extern int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, IpAddress &from);
 extern int comm_udp_recv(int fd, void *buf, size_t len, int flags);
 extern ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags);
 extern bool comm_has_incomplete_write(int);
index 766bb51894271be7ea075a06c49d8372ec83a21a..befd7bb9285caee57b2a7733feba7389dd52c08e 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: delay_pools.cc,v 1.51 2008/02/26 21:49:34 amosjeffries Exp $
- *
  * DEBUG: section 77    Delay Pools
  * AUTHOR: Robert Collins <robertc@squid-cache.org>
  * Based upon original delay pools code by
@@ -66,7 +64,7 @@
 #include "DelayBucket.h"
 #include "DelayUser.h"
 #include "DelayTagged.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 /// \ingroup DelayPoolsInternal
 long DelayPools::MemoryUsed = 0;
@@ -161,7 +159,7 @@ protected:
 
     virtual char const *label() const = 0;
 
-    virtual unsigned int makeKey (IPAddress &src_addr) const = 0;
+    virtual unsigned int makeKey (IpAddress &src_addr) const = 0;
 
     DelaySpec spec;
 
@@ -193,7 +191,7 @@ public:
 protected:
     virtual char const *label() const {return "Individual";}
 
-    virtual unsigned int makeKey (IPAddress &src_addr) const;
+    virtual unsigned int makeKey (IpAddress &src_addr) const;
 
 };
 
@@ -208,7 +206,7 @@ public:
 protected:
     virtual char const *label() const {return "Network";}
 
-    virtual unsigned int makeKey (IPAddress &src_addr) const;
+    virtual unsigned int makeKey (IpAddress &src_addr) const;
 };
 
 /* don't use remote storage for these */
@@ -252,9 +250,9 @@ protected:
 
     virtual char const *label() const {return "Individual";}
 
-    virtual unsigned int makeKey (IPAddress &src_addr) const;
+    virtual unsigned int makeKey (IpAddress &src_addr) const;
 
-    unsigned char makeHostKey (IPAddress &src_addr) const;
+    unsigned char makeHostKey (IpAddress &src_addr) const;
 
     DelaySpec spec;
     VectorMap<unsigned char, ClassCBucket> buckets;
@@ -861,7 +859,7 @@ VectorPool::Id::bytesIn(int qty)
 }
 
 unsigned int
-IndividualPool::makeKey (IPAddress &src_addr) const
+IndividualPool::makeKey (IpAddress &src_addr) const
 {
     /* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
     if ( !src_addr.IsIPv4() )
@@ -888,7 +886,7 @@ ClassCNetPool::operator delete (void *address)
 }
 
 unsigned int
-ClassCNetPool::makeKey (IPAddress &src_addr) const
+ClassCNetPool::makeKey (IpAddress &src_addr) const
 {
     /* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
     if ( !src_addr.IsIPv4() )
@@ -962,7 +960,7 @@ ClassCHostPool::keyAllocated (unsigned char const key) const
 }
 
 unsigned char
-ClassCHostPool::makeHostKey (IPAddress &src_addr) const
+ClassCHostPool::makeHostKey (IpAddress &src_addr) const
 {
     /* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
     if ( !src_addr.IsIPv4() )
@@ -975,7 +973,7 @@ ClassCHostPool::makeHostKey (IPAddress &src_addr) const
 }
 
 unsigned int
-ClassCHostPool::makeKey (IPAddress &src_addr) const
+ClassCHostPool::makeKey (IpAddress &src_addr) const
 {
     /* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
     if ( !src_addr.IsIPv4() )
index ac9c862aff522f9c64c4a637a4ca1be1b225b26b..e3942e81a2f03a5bcb19fa90a9883256d24a0e7a 100644 (file)
@@ -133,7 +133,7 @@ struct _nsvc {
 };
 
 struct _ns {
-    IPAddress S;
+    IpAddress S;
     int nqueries;
     int nreplies;
     nsvc *vc;
@@ -176,7 +176,7 @@ static void idnsSendQuery(idns_query * q);
 static IOCB idnsReadVCHeader;
 static void idnsDoSendQueryVC(nsvc *vc);
 
-static int idnsFromKnownNameserver(IPAddress const &from);
+static int idnsFromKnownNameserver(IpAddress const &from);
 static idns_query *idnsFindQuery(unsigned short id);
 static void idnsGrokReply(const char *buf, size_t sz);
 static PF idnsRead;
@@ -187,7 +187,7 @@ static void idnsRcodeCount(int, int);
 static void
 idnsAddNameserver(const char *buf)
 {
-    IPAddress A;
+    IpAddress A;
 
     if (!(A = buf)) {
         debugs(78, 0, "WARNING: rejecting '" << buf << "' as a name server, because it is not a numeric IP address");
@@ -744,7 +744,7 @@ idnsInitVC(int ns)
     nameservers[ns].vc = vc;
     vc->ns = ns;
 
-    IPAddress addr;
+    IpAddress addr;
 
     if (!Config.Addrs.udp_outgoing.IsNoAddr())
         addr = Config.Addrs.udp_outgoing;
@@ -848,7 +848,7 @@ idnsSendQuery(idns_query * q)
 }
 
 static int
-idnsFromKnownNameserver(IPAddress const &from)
+idnsFromKnownNameserver(IpAddress const &from)
 {
     int i;
 
@@ -1124,7 +1124,7 @@ idnsRead(int fd, void *data)
     int max = INCOMING_DNS_MAX;
     static char rbuf[SQUID_UDP_SO_RCVBUF];
     int ns;
-    IPAddress from;
+    IpAddress from;
 
     debugs(78, 3, "idnsRead: starting with FD " << fd);
 
@@ -1135,7 +1135,7 @@ idnsRead(int fd, void *data)
      *  The cause of this is still unknown, however copying the data appears
      *  to allow it to be passed further without this erasure.
      */
-    IPAddress bugbypass;
+    IpAddress bugbypass;
 
     while (max--) {
         len = comm_udp_recvfrom(fd, rbuf, SQUID_UDP_SO_RCVBUF, 0, bugbypass);
@@ -1339,7 +1339,7 @@ idnsInit(void)
     if (DnsSocket < 0) {
         int port;
 
-        IPAddress addr;
+        IpAddress addr;
 
         if (!Config.Addrs.udp_outgoing.IsNoAddr())
             addr = Config.Addrs.udp_outgoing;
@@ -1520,7 +1520,7 @@ idnsALookup(const char *name, IDNSCB * callback, void *data)
 }
 
 void
-idnsPTRLookup(const IPAddress &addr, IDNSCB * callback, void *data)
+idnsPTRLookup(const IpAddress &addr, IDNSCB * callback, void *data)
 {
     idns_query *q;
 
index 87b80e9af5ad821909cc1b2fe6d9f9044613ad61..39c7b8c546a5e27b76bda343d07242fc9243f90d 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: dnsserver.cc,v 1.74 2008/02/26 21:49:34 amosjeffries Exp $
- *
  * DEBUG: section 0     DNS Resolver
  * AUTHOR: Harvest Derived
  *
@@ -166,7 +163,7 @@ usage: dnsserver -Dhv -s nameserver
  \endverbatim
  */
 
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 #if LIBRESOLV_DNS_TTL_HACK
 /// \ingroup dnsserver
@@ -195,7 +192,7 @@ lookup(const char *buf)
     int ttl = 0;
     int retry = 0;
     unsigned int i = 0;
-    IPAddress ipa;
+    IpAddress ipa;
     char ntoabuf[MAX_IPSTRLEN];
     struct addrinfo hints;
     struct addrinfo *AI = NULL;
@@ -392,7 +389,7 @@ main(int argc, char *argv[])
 #endif
 #if HAVE_RES_INIT
 
-    IPAddress ipa;
+    IpAddress ipa;
     int opt_s = 0;
 #ifdef _SQUID_RES_NSADDR_LIST
 
index 35e556e6dd997f3a520d29c21a09e9238a0540d6..b73564124f25ab9b168822e19ef10e59d092dc2a 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: errorpage.h,v 1.6 2008/02/26 21:49:34 amosjeffries Exp $
- *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
  *
@@ -38,7 +36,7 @@
 
 #include "squid.h"
 #include "cbdata.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 /**
  \defgroup ErrorPageAPI Error Pages API
@@ -125,7 +123,7 @@ public:
     char *dnsserver_msg;
     time_t ttl;
 
-    IPAddress src_addr;
+    IpAddress src_addr;
     char *redirect_url;
     ERCB *callback;
     void *callback_data;
index 52b2ff132f58109476799e475bfc0b57a72b537d..ba7efeea85f5c8e20617bb4ea9ee97c81ada4e6a 100644 (file)
@@ -128,7 +128,7 @@ public:
         QUOTE_METHOD_URL
     } quote;
 
-    IPAddress local_addr;
+    IpAddress local_addr;
 };
 
 struct _external_acl_format {
index 582d7b746dad157080db472344c18f95ecf904a8..3b503d2b51e0e903db4d9173b8c85ae3c590726f 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
@@ -1,8 +1,4 @@
-
 /*
- * $Id: fde.h,v 1.15 2008/02/12 23:22:13 rousskov Exp $
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
@@ -35,7 +31,7 @@
 #define SQUID_FDE_H
 
 #include "comm.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 class PconnPool;
 
@@ -59,7 +55,7 @@ public:
     unsigned int type;
     u_short remote_port;
 
-    IPAddress local_addr;
+    IpAddress local_addr;
     unsigned char tos;
     int sock_family;
     char ipaddr[MAX_IPSTRLEN];            /* dotted decimal address of peer */
@@ -124,7 +120,7 @@ private:
         halfClosedReader = NULL;
         // XXX: the following memset may corrupt or leak new or changed members
         memset(this, 0, sizeof(fde));
-        local_addr.SetEmpty(); // IPAddress likes to be setup nicely.
+        local_addr.SetEmpty(); // IpAddress likes to be setup nicely.
     }
 
 };
index 0c5ebd4e219dd52405c99d67fe565a6f72126f0b..87efed8b29ac5e7b0c2bd151768d4d6ba2440e6a 100644 (file)
@@ -770,10 +770,10 @@ FwdState::connectStart()
     int ctimeout;
     int ftimeout = Config.Timeout.forward - (squid_curtime - start_t);
 
-    IPAddress outgoing;
+    IpAddress outgoing;
     unsigned short tos;
 
-    IPAddress client_addr;
+    IpAddress client_addr;
     assert(fs);
     assert(server_fd == -1);
     debugs(17, 3, "fwdConnectStart: " << url);
@@ -904,7 +904,7 @@ FwdState::connectStart()
     if (!fs->_peer && request->flags.spoof_client_ip) {
         // try to set the outgoing address using TPROXY v2
         // if it fails we abort any further TPROXY actions on this connection
-        if (IpInterceptor.SetTproxy2OutgoingAddr(int fd, const IPAddress &src) == -1) {
+        if (IpInterceptor.SetTproxy2OutgoingAddr(int fd, const IpAddress &src) == -1) {
             request->flags.spoof_client_ip = 0;
         }
     }
@@ -1185,7 +1185,7 @@ FwdState::reforwardableStatus(http_status s)
  * \item  address of the client for which we made the connection
  */
 void
-FwdState::pconnPush(int fd, const peer *_peer, const HttpRequest *req, const char *domain, IPAddress &client_addr)
+FwdState::pconnPush(int fd, const peer *_peer, const HttpRequest *req, const char *domain, IpAddress &client_addr)
 {
     if (_peer) {
         fwdPconnPool->push(fd, _peer->name, _peer->http_port, domain, client_addr);
@@ -1302,12 +1302,12 @@ fwdServerFree(FwdServer * fs)
     memFree(fs, MEM_FWD_SERVER);
 }
 
-static IPAddress
+static IpAddress
 aclMapAddr(acl_address * head, ACLChecklist * ch)
 {
     acl_address *l;
 
-    IPAddress addr;
+    IpAddress addr;
 
     for (l = head; l; l = l->next) {
         if (ch->matchAclListFast(l->aclList))
@@ -1335,7 +1335,7 @@ aclMapTOS(acl_tos * head, ACLChecklist * ch)
     return 0;
 }
 
-IPAddress
+IpAddress
 getOutgoingAddr(HttpRequest * request, struct peer *dst_peer)
 {
     ACLChecklist ch;
index d82dc188642fdff5cf6e339e36ae8efd05fbd8cd..065ad08bcc6857af6302679e3008ce9109c15ded 100644 (file)
@@ -7,7 +7,7 @@ class ErrorState;
 class HttpRequest;
 
 #include "comm.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 class FwdServer
 {
@@ -44,7 +44,7 @@ public:
     bool checkRetry();
     bool checkRetriable();
     void dispatch();
-    void pconnPush(int fd, const peer *_peer, const HttpRequest *req, const char *domain, IPAddress &client_addr);
+    void pconnPush(int fd, const peer *_peer, const HttpRequest *req, const char *domain, IpAddress &client_addr);
 
     bool dontRetry() { return flags.dont_retry; }
 
@@ -100,7 +100,7 @@ private:
         unsigned int forward_completed:1;
     } flags;
 
-    IPAddress src; /* Client address for this connection. Needed for transparent operations. */
+    IpAddress src; /* Client address for this connection. Needed for transparent operations. */
 };
 
 #endif
index 21e74c2477af0f3b3cb4c2773ac5bdd8b369203b..f0a758b029cc21a578610a041a5bcdc36eb24ea9 100644 (file)
@@ -516,7 +516,7 @@ fqdncacheHandleReply(void *data, rfc1035_rr * answers, int na, const char *error
  *                     and does not affect the FQDN cache.
  */
 void
-fqdncache_nbgethostbyaddr(IPAddress &addr, FQDNH * handler, void *handlerData)
+fqdncache_nbgethostbyaddr(IpAddress &addr, FQDNH * handler, void *handlerData)
 {
     fqdncache_entry *f = NULL;
     char name[MAX_IPSTRLEN];
@@ -634,7 +634,7 @@ fqdncache_init(void)
  *
  */
 const char *
-fqdncache_gethostbyaddr(IPAddress &addr, int flags)
+fqdncache_gethostbyaddr(IpAddress &addr, int flags)
 {
     char name[MAX_IPSTRLEN];
     fqdncache_entry *f = NULL;
@@ -736,7 +736,7 @@ dummy_handler(const char *bufnotused, void *datanotused)
 
 /// \ingroup FQDNCacheAPI
 const char *
-fqdnFromAddr(IPAddress &addr)
+fqdnFromAddr(IpAddress &addr)
 {
     const char *n;
     static char buf[MAX_IPSTRLEN];
index c8c67962e446d4f43cf8fc577615f20055fb6375..9ca5faaa12dcc9416182160ca0b41565b4761302 100644 (file)
@@ -2329,7 +2329,7 @@ ftpReadEPSV(FtpStateData* ftpState)
     char h1, h2, h3, h4;
     int n;
     u_short port;
-    IPAddress ipa_remote;
+    IpAddress ipa_remote;
     int fd = ftpState->data.fd;
     char *buf;
     debugs(9, 3, HERE);
@@ -2442,7 +2442,7 @@ ftpReadEPSV(FtpStateData* ftpState)
 static void
 ftpSendPassive(FtpStateData * ftpState)
 {
-    IPAddress addr;
+    IpAddress addr;
     struct addrinfo *AI = NULL;
 
     /** Checks the server control channel is still available before running. */
@@ -2606,7 +2606,7 @@ ftpReadPasv(FtpStateData * ftpState)
     int p1, p2;
     int n;
     u_short port;
-    IPAddress ipa_remote;
+    IpAddress ipa_remote;
     int fd = ftpState->data.fd;
     char *buf;
     LOCAL_ARRAY(char, ipaddr, 1024);
@@ -2712,7 +2712,7 @@ ftpOpenListenSocket(FtpStateData * ftpState, int fallback)
 {
     int fd;
 
-    IPAddress addr;
+    IpAddress addr;
     struct addrinfo *AI = NULL;
     int on = 1;
     int x = 0;
@@ -2778,7 +2778,7 @@ ftpSendPORT(FtpStateData * ftpState)
 {
     int fd;
 
-    IPAddress ipa;
+    IpAddress ipa;
     struct addrinfo *AI = NULL;
     unsigned char *addrptr;
     unsigned char *portptr;
@@ -2849,7 +2849,7 @@ static void
 ftpSendEPRT(FtpStateData * ftpState)
 {
     int fd;
-    IPAddress addr;
+    IpAddress addr;
     struct addrinfo *AI = NULL;
     char buf[MAX_IPSTRLEN];
 
index 0b1e5d189bba4694743ae9cdaab3c1137b104e4d..df18240282543013a81b6777a4c53d7383d7e9bd 100644 (file)
@@ -122,8 +122,8 @@ extern "C"
 
     extern struct acl_deny_info_list *DenyInfoList;    /* NULL */
 
-//MOVED:icp_v2.cc    extern IPAddress theOutICPAddr;
-//MOVED:snmp_core.cc    extern IPAddress theOutSNMPAddr;
+//MOVED:icp_v2.cc    extern IpAddress theOutICPAddr;
+//MOVED:snmp_core.cc    extern IpAddress theOutSNMPAddr;
 
     extern struct timeval squid_start;
     extern int shutting_down;  /* 0 */
index 43332d4baefa465a4f54a133e429012206d6266f..6369927494190c28cd5cbc8336b6dd1173c18cb4 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: helper.h,v 1.12 2008/02/26 21:49:34 amosjeffries Exp $
- *
  * DEBUG: section 84    Helper process maintenance
  * AUTHOR: Harvest Derived?
  *
@@ -38,7 +35,7 @@
 
 #include "squid.h"
 #include "cbdata.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 class helper_request;
 
@@ -65,7 +62,7 @@ struct _helper {
     int n_running;
     int n_active;
     int ipc_type;
-    IPAddress addr;
+    IpAddress addr;
     unsigned int concurrency;
     time_t last_queue_warn;
     time_t last_restart;
@@ -87,7 +84,7 @@ struct _helper_stateful {
     int n_running;
     int n_active;
     int ipc_type;
-    IPAddress addr;
+    IpAddress addr;
     MemAllocator *datapool;
     HLPSAVAIL *IsAvailable;
     HLPSONEQ *OnEmptyQueue;
@@ -105,7 +102,7 @@ struct _helper_stateful {
 struct _helper_server {
     int index;
     int pid;
-    IPAddress addr;
+    IpAddress addr;
     int rfd;
     int wfd;
     MemBuf *wqueue;
@@ -141,7 +138,7 @@ class helper_stateful_request;
 struct _helper_stateful_server {
     int index;
     int pid;
-    IPAddress addr;
+    IpAddress addr;
     int rfd;
     int wfd;
     /* MemBuf wqueue; */
index 1d8feaf91bad3556046ae08a5bc06156168bf799..4a7527417a152e76d5d41f195654a85e3442b4f9 100644 (file)
@@ -152,7 +152,7 @@ public:
     void checkHit();
     void checkedHit(StoreEntry *e);
 
-    void setFrom (IPAddress &from);
+    void setFrom (IpAddress &from);
     void setDataHeader (htcpDataHeader *);
     char *method;
     char *uri;
@@ -163,7 +163,7 @@ public:
 private:
     HttpRequest *checkHitRequest;
 
-    IPAddress from; // was a ptr. return to such IFF needed. otherwise copy should do.
+    IpAddress from; // was a ptr. return to such IFF needed. otherwise copy should do.
     htcpDataHeader *dhdr;
 };
 
@@ -231,7 +231,7 @@ static int htcpOutSocket = -1;
 static u_int32_t queried_id[N_QUERIED_KEYS];
 static cache_key queried_keys[N_QUERIED_KEYS][SQUID_MD5_DIGEST_LENGTH];
 
-static IPAddress queried_addr[N_QUERIED_KEYS];
+static IpAddress queried_addr[N_QUERIED_KEYS];
 static MemAllocator *htcpDetailPool = NULL;
 
 static int old_squid_format = 0;
@@ -250,24 +250,24 @@ static ssize_t htcpBuildTstOpData(char *buf, size_t buflen, htcpStuff * stuff);
 static void htcpFreeSpecifier(htcpSpecifier * s);
 static void htcpFreeDetail(htcpDetail * s);
 
-static void htcpHandleMsg(char *buf, int sz, IPAddress &from);
+static void htcpHandleMsg(char *buf, int sz, IpAddress &from);
 
-static void htcpHandleMon(htcpDataHeader *, char *buf, int sz, IPAddress &from);
+static void htcpHandleMon(htcpDataHeader *, char *buf, int sz, IpAddress &from);
 
-static void htcpHandleNop(htcpDataHeader *, char *buf, int sz, IPAddress &from);
+static void htcpHandleNop(htcpDataHeader *, char *buf, int sz, IpAddress &from);
 
-static void htcpHandleSet(htcpDataHeader *, char *buf, int sz, IPAddress &from);
+static void htcpHandleSet(htcpDataHeader *, char *buf, int sz, IpAddress &from);
 
-static void htcpHandleTst(htcpDataHeader *, char *buf, int sz, IPAddress &from);
+static void htcpHandleTst(htcpDataHeader *, char *buf, int sz, IpAddress &from);
 static void htcpRecv(int fd, void *data);
 
-static void htcpSend(const char *buf, int len, IPAddress &to);
+static void htcpSend(const char *buf, int len, IpAddress &to);
 
-static void htcpTstReply(htcpDataHeader *, StoreEntry *, htcpSpecifier *, IPAddress &);
+static void htcpTstReply(htcpDataHeader *, StoreEntry *, htcpSpecifier *, IpAddress &);
 
-static void htcpHandleTstRequest(htcpDataHeader *, char *buf, int sz, IPAddress &from);
+static void htcpHandleTstRequest(htcpDataHeader *, char *buf, int sz, IpAddress &from);
 
-static void htcpHandleTstResponse(htcpDataHeader *, char *, int, IPAddress &);
+static void htcpHandleTstResponse(htcpDataHeader *, char *, int, IpAddress &);
 
 static void
 htcpHexdump(const char *tag, const char *s, int sz)
@@ -590,7 +590,7 @@ htcpBuildPacket(char *buf, size_t buflen, htcpStuff * stuff)
 
 static void
 
-htcpSend(const char *buf, int len, IPAddress &to)
+htcpSend(const char *buf, int len, IpAddress &to)
 {
     int x;
 
@@ -614,7 +614,7 @@ htcpSend(const char *buf, int len, IPAddress &to)
 
 void
 
-htcpSpecifier::setFrom (IPAddress &aSocket)
+htcpSpecifier::setFrom (IpAddress &aSocket)
 {
     from = aSocket;
 }
@@ -845,7 +845,7 @@ htcpUnpackDetail(char *buf, int sz)
 
 static int
 
-htcpAccessCheck(acl_access * acl, htcpSpecifier * s, IPAddress &from)
+htcpAccessCheck(acl_access * acl, htcpSpecifier * s, IpAddress &from)
 {
     ACLChecklist checklist;
     checklist.src_addr = from;
@@ -858,7 +858,7 @@ htcpAccessCheck(acl_access * acl, htcpSpecifier * s, IPAddress &from)
 }
 
 static void
-htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, IPAddress &from)
+htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, IpAddress &from)
 {
     htcpStuff stuff;
     static char pkt[8192];
@@ -946,7 +946,7 @@ htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, IPAddr
 
 static void
 
-htcpClrReply(htcpDataHeader * dhdr, int purgeSucceeded, IPAddress &from)
+htcpClrReply(htcpDataHeader * dhdr, int purgeSucceeded, IpAddress &from)
 {
     htcpStuff stuff;
     static char pkt[8192];
@@ -983,7 +983,7 @@ htcpClrReply(htcpDataHeader * dhdr, int purgeSucceeded, IPAddress &from)
 
 static void
 
-htcpHandleNop(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleNop(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
 {
     debugs(31, 3, "htcpHandleNop: Unimplemented");
 }
@@ -1080,7 +1080,7 @@ htcpClrStore(const htcpSpecifier * s)
 
 static void
 
-htcpHandleTst(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleTst(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
 {
     debugs(31, 3, "htcpHandleTst: sz = " << sz);
 
@@ -1095,12 +1095,12 @@ HtcpReplyData::HtcpReplyData() : hdr(hoHtcpReply)
 
 static void
 
-htcpHandleTstResponse(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleTstResponse(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
 {
     htcpReplyData htcpReply;
     cache_key *key = NULL;
 
-    IPAddress *peer;
+    IpAddress *peer;
     htcpDetail *d = NULL;
     char *t;
 
@@ -1167,7 +1167,7 @@ htcpHandleTstResponse(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
 
 static void
 
-htcpHandleTstRequest(htcpDataHeader * dhdr, char *buf, int sz, IPAddress &from)
+htcpHandleTstRequest(htcpDataHeader * dhdr, char *buf, int sz, IpAddress &from)
 {
     /* buf should be a SPECIFIER */
     htcpSpecifier *s;
@@ -1222,21 +1222,21 @@ htcpSpecifier::checkedHit(StoreEntry *e)
 
 static void
 
-htcpHandleMon(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleMon(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
 {
     debugs(31, 3, "htcpHandleMon: Unimplemented");
 }
 
 static void
 
-htcpHandleSet(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleSet(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
 {
     debugs(31, 3, "htcpHandleSet: Unimplemented");
 }
 
 static void
 
-htcpHandleClr(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleClr(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
 {
     htcpSpecifier *s;
     /* buf[0/1] is reserved and reason */
@@ -1319,7 +1319,7 @@ htcpForwardClr(char *buf, int sz)
  * hands it off to other functions to break apart message-specific data.
  */
 static void
-htcpHandleMsg(char *buf, int sz, IPAddress &from)
+htcpHandleMsg(char *buf, int sz, IpAddress &from)
 {
     htcpHeader htcpHdr;
     htcpDataHeader hdr;
@@ -1439,7 +1439,7 @@ htcpRecv(int fd, void *data)
 {
     static char buf[8192];
     int len;
-    static IPAddress from;
+    static IpAddress from;
 
     /* Receive up to 8191 bytes, leaving room for a null */
 
@@ -1469,7 +1469,7 @@ htcpInit(void)
         return;
     }
 
-    IPAddress incomingAddr = Config.Addrs.udp_incoming;
+    IpAddress incomingAddr = Config.Addrs.udp_incoming;
     incomingAddr.SetPort(Config.Port.htcp);
 
     enter_suid();
@@ -1488,7 +1488,7 @@ htcpInit(void)
     debugs(31, 1, "Accepting HTCP messages on port " << Config.Port.htcp << ", FD " << htcpInSocket << ".");
 
     if (!Config.Addrs.udp_outgoing.IsNoAddr()) {
-        IPAddress outgoingAddr = Config.Addrs.udp_outgoing;
+        IpAddress outgoingAddr = Config.Addrs.udp_outgoing;
         outgoingAddr.SetPort(Config.Port.htcp);
 
         enter_suid();
index fc65b9f4f56257ac4dacfcb3a368bf19b5483e93..1e8479b1f284d168a9b6c03664429e53710174fa 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * $Id: htcp.h,v 1.7 2008/02/26 21:49:35 amosjeffries Exp $
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
 #define SQUID_HTCP_H
 
 #if USE_HTCP
+
 #include "HttpHeader.h"
-#include "IPAddress.h"
+
+class IpAddress;
 
 /// \ingroup ServerProtocolHTCP
 class HtcpReplyData
@@ -60,7 +59,7 @@ public:
 typedef class HtcpReplyData htcpReplyData;
 
 /// \ingroup ServerProtocolHTCP
-SQUIDCEXTERN void neighborsHtcpReply(const cache_key *, htcpReplyData *, const IPAddress &);
+SQUIDCEXTERN void neighborsHtcpReply(const cache_key *, htcpReplyData *, const IpAddress &);
 
 /// \ingroup ServerProtocolHTCP
 SQUIDCEXTERN void htcpInit(void);
index 60bbc74c3c02b69c4efcb49e10f418e58c47a422..999cc9a26cb65695190120857fd46823583dd4f8 100644 (file)
@@ -1207,7 +1207,7 @@ void
 HttpStateData::processReplyBody()
 {
     AsyncCall::Pointer call;
-    IPAddress client_addr;
+    IpAddress client_addr;
     bool ispinned = false;
 
     if (!flags.headers_parsed) {
index 38c0c0419446090e6b1306f4622f10e7c61e3286..313561182916fb40cde1bec35188780b5d958a68 100644 (file)
@@ -107,7 +107,7 @@ Icmp::ipHops(int ttl)
 }
 
 void
-Icmp::Log(const IPAddress &addr, const u_int8_t type, const char* pkt_str, const int rtt, const int hops)
+Icmp::Log(const IpAddress &addr, const u_int8_t type, const char* pkt_str, const int rtt, const int hops)
 {
     debugs(42, 2, "pingerLog: " << std::setw(9) << current_time.tv_sec  <<
            "." << std::setfill('0') << std::setw(6) <<
index d5fa09ae7261182f79d707a4ceec11c66e7ef7be..d9b9715c04310bb30b53a928966d27a36d8b808a 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: ICMP.h,v 1.1 2007/12/14 23:11:45 amosjeffries Exp $
- *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels, Amos Jeffries
  *
@@ -35,7 +33,7 @@
 #define _INCLUDE_ICMP_H
 
 #include "config.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 #define PINGER_PAYLOAD_SZ      8192
 
@@ -49,7 +47,7 @@
 
 /* This is a line-data format struct. DO NOT alter. */
 struct pingerEchoData {
-    IPAddress to;
+    IpAddress to;
     unsigned char opcode;
     int psize;
     char payload[PINGER_PAYLOAD_SZ];
@@ -57,7 +55,7 @@ struct pingerEchoData {
 
 /* This is a line-data format struct. DO NOT alter. */
 struct pingerReplyData {
-    IPAddress from;
+    IpAddress from;
     unsigned char opcode;
     int rtt;
     int hops;
@@ -111,7 +109,7 @@ public:
      *                Content longer than MAX_PAYLOAD will be truncated.
      \param len       Length of the payload in bytes if any is to be sent or 0.
      */
-    virtual void SendEcho(IPAddress &to, int opcode, const char *payload=NULL, int len=0) =0;
+    virtual void SendEcho(IpAddress &to, int opcode, const char *payload=NULL, int len=0) =0;
 
     /// Handle ICMP responses.
     virtual void Recv(void) =0;
@@ -139,7 +137,7 @@ protected:
     int ipHops(int ttl);
 
     /// Log the packet.
-    void Log(const IPAddress &addr, const u_int8_t type, const char* pkt_str, const int rtt, const int hops);
+    void Log(const IpAddress &addr, const u_int8_t type, const char* pkt_str, const int rtt, const int hops);
 
     /* no use wasting memory */
     int icmp_sock;
index 04e1cf41862e5bb3ba921a69c26b1f2301adfe51..68d19cdf23b1680ad6e3d09ea8f9eb2f1483c666 100644 (file)
@@ -90,7 +90,7 @@ Icmp4::Open(void)
 }
 
 void
-Icmp4::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
+Icmp4::SendEcho(IpAddress &to, int opcode, const char *payload, int len)
 {
     int x;
     LOCAL_ARRAY(char, pkt, MAX_PKT4_SZ);
index 6c45b92002bf92b50e9586ed4c34f35b8b02ff12..6b19db03d9562e76878ebaf968936d7ab8400196 100644 (file)
@@ -36,7 +36,6 @@
 
 #include "config.h"
 #include "Icmp.h"
-#include "IPAddress.h"
 
 #if HAVE_NETINET_IN_SYSTM_H
 #include <netinet/in_systm.h>
@@ -171,7 +170,7 @@ public:
     virtual int Open();
 
 #if USE_ICMP
-    virtual void SendEcho(IPAddress &, int, const char*, int);
+    virtual void SendEcho(IpAddress &, int, const char*, int);
     virtual void Recv(void);
 #endif
 };
index 430d699f378693254236df3799fb432c8c27b3b5..c34bc8ff136f03ac671205ac73ea2b0185855031 100644 (file)
@@ -133,7 +133,7 @@ Icmp6::Open(void)
  * Generates an RFC 4443 Icmp6 ECHO Packet and sends into the network.
  */
 void
-Icmp6::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
+Icmp6::SendEcho(IpAddress &to, int opcode, const char *payload, int len)
 {
     int x;
     LOCAL_ARRAY(char, pkt, MAX_PKT6_SZ);
index 4ec9cd3394688fd6ac3a1ff9400fcaf90ddb5d61..edcc5ddea3534adfb7230f77155ab090d86ae2ce 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: ICMPv6.h,v 1.1 2007/12/14 23:11:45 amosjeffries Exp $
- *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels, Amos Jeffries
  *
@@ -39,7 +37,6 @@
 #if USE_IPV6
 
 #include "Icmp.h"
-#include "IPAddress.h"
 
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
@@ -79,7 +76,7 @@ public:
     virtual int Open();
 
 #if USE_ICMP
-    virtual void SendEcho(IPAddress &, int, const char*, int);
+    virtual void SendEcho(IpAddress &, int, const char*, int);
     virtual void Recv(void);
 #endif
 };
index 3b12228c539c0da435093f59f8c367c190921f90..b010f6bd7911f755b11636c4618cabb7ad857c92 100644 (file)
@@ -62,7 +62,7 @@ public:
 
 private:
     // unused in IcmpPinger
-    virtual void SendEcho(IPAddress &to, int opcode, const char *payload, int len) {};
+    virtual void SendEcho(IpAddress &to, int opcode, const char *payload, int len) {};
 
     /**
      * Control channel(s) to squid.
index 4928ff39508f5da4bcf9b6e7ce9cbb82a412f262..cea847e471bf343cf62a4df7372b49de34e65f04 100644 (file)
@@ -69,7 +69,7 @@ IcmpSquid::~IcmpSquid()
 #if USE_ICMP
 
 void
-IcmpSquid::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
+IcmpSquid::SendEcho(IpAddress &to, int opcode, const char *payload, int len)
 {
     static pingerEchoData pecho;
     int x, slen;
@@ -141,7 +141,7 @@ IcmpSquid::Recv()
     int n;
     static int fail_count = 0;
     pingerReplyData preply;
-    static IPAddress F;
+    static IpAddress F;
 
     commSetSelect(icmp_sock, COMM_SELECT_READ, icmpSquidRecv, NULL, 0);
     memset(&preply, '\0', sizeof(pingerReplyData));
@@ -196,7 +196,7 @@ IcmpSquid::Recv()
 #endif /* USE_ICMP */
 
 void
-IcmpSquid::DomainPing(IPAddress &to, const char *domain)
+IcmpSquid::DomainPing(IpAddress &to, const char *domain)
 {
 #if USE_ICMP
     debugs(37, 4, HERE << "'" << domain << "' (" << to << ")");
@@ -211,7 +211,7 @@ IcmpSquid::Open(void)
     const char *args[2];
     int rfd;
     int wfd;
-    IPAddress localhost;
+    IpAddress localhost;
 
     /* User configured disabled. */
     if (!Config.pinger.enable) {
index 42502343d9ded35d37a0feeb87359e674ed6566c..108e0810876280dec5dae18b175192b430b4c51f 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: ICMPSquid.h,v 1.1 2007/12/14 23:11:45 amosjeffries Exp $
- *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels, Amos Jeffries
  *
@@ -36,7 +34,6 @@
 
 #include "config.h"
 #include "Icmp.h"
-#include "IPAddress.h"
 
 /**
  * Implements a non-blocking pseudo-ICMP engine for squid internally.
@@ -55,10 +52,10 @@ public:
     virtual int Open();
     virtual void Close();
 
-    void DomainPing(IPAddress &to, const char *domain);
+    void DomainPing(IpAddress &to, const char *domain);
 
 #if USE_ICMP
-    virtual void SendEcho(IPAddress &to, int opcode, const char* payload=NULL, int len=0);
+    virtual void SendEcho(IpAddress &to, int opcode, const char* payload=NULL, int len=0);
     virtual void Recv(void);
 #endif
 };
index aae47e9d04eee3235544bd964ed5e67498f89be2..dbdc3debd02318851ca1d3fe6d6e847fbb3d0e94 100644 (file)
@@ -65,12 +65,12 @@ nodist_pinger_SOURCES = \
        ../globals.cc \
        ../time.cc \
        ../SquidConfig.cc \
-       ../SquidNew.cc \
-       ../ip/stubQosConfig.cc
+       ../SquidNew.cc
 
 pinger_LDFLAGS = $(LIBADD_DL)
 pinger_LDADD=\
        libicmp-core.la \
+       ../ip/libip.la \
        $(top_builddir)/lib/libmiscutil.a
 pinger_DEPENDENCIES= \
        libicmp-core.la \
@@ -123,6 +123,7 @@ testIcmp_LDADD=\
        @SQUID_CPPUNIT_LIBS@ \
        @SQUID_CPPUNIT_LA@ \
        libicmp-core.la \
+       ../ip/libip.la \
        $(top_builddir)/lib/libmiscutil.a
 testIcmp_DEPENDENCIES= @SQUID_CPPUNIT_LA@ \
        libicmp-core.la \
index 301ed4881a38dfb9b879cb73db52ced97dc3108f..b9a6d3b7e926401010052536583a449103fae289 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: net_db.cc,v 1.202 2008/01/07 17:12:28 hno Exp $
- *
  * DEBUG: section 38    Network Measurement Database
  * AUTHOR: Duane Wessels
  *
@@ -54,7 +52,7 @@
 #include "forward.h"
 #include "SquidTime.h"
 #include "wordlist.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 #if USE_ICMP
 #include "icmp/IcmpSquid.h"
@@ -83,10 +81,10 @@ typedef struct {
 static hash_table *addr_table = NULL;
 static hash_table *host_table = NULL;
 
-IPAddress networkFromInaddr(const IPAddress &a);
+IpAddress networkFromInaddr(const IpAddress &a);
 static void netdbRelease(netdbEntry * n);
 
-static void netdbHashInsert(netdbEntry * n, IPAddress &addr);
+static void netdbHashInsert(netdbEntry * n, IpAddress &addr);
 static void netdbHashDelete(const char *key);
 static void netdbHostInsert(netdbEntry * n, const char *hostname);
 static void netdbHostDelete(const net_db_name * x);
@@ -111,7 +109,7 @@ static void netdbExchangeDone(void *);
 static wordlist *peer_names = NULL;
 
 static void
-netdbHashInsert(netdbEntry * n, IPAddress &addr)
+netdbHashInsert(netdbEntry * n, IpAddress &addr)
 {
     networkFromInaddr(addr).NtoA(n->network, MAX_IPSTRLEN);
     n->hash.key = n->network;
@@ -247,7 +245,7 @@ netdbPurgeLRU(void)
 }
 
 static netdbEntry *
-netdbLookupAddr(const IPAddress &addr)
+netdbLookupAddr(const IpAddress &addr)
 {
     netdbEntry *n;
     char *key = new char[MAX_IPSTRLEN];
@@ -257,7 +255,7 @@ netdbLookupAddr(const IPAddress &addr)
 }
 
 static netdbEntry *
-netdbAdd(IPAddress &addr)
+netdbAdd(IpAddress &addr)
 {
     netdbEntry *n;
 
@@ -275,7 +273,7 @@ netdbAdd(IPAddress &addr)
 static void
 netdbSendPing(const ipcache_addrs * ia, void *data)
 {
-    IPAddress addr;
+    IpAddress addr;
     char *hostname = NULL;
     static_cast<generic_cbdata *>(data)->unwrap(&hostname);
     netdbEntry *n;
@@ -340,10 +338,10 @@ netdbSendPing(const ipcache_addrs * ia, void *data)
     xfree(hostname);
 }
 
-IPAddress
-networkFromInaddr(const IPAddress &in)
+IpAddress
+networkFromInaddr(const IpAddress &in)
 {
-    IPAddress out;
+    IpAddress out;
 
     out = in;
 #if USE_IPV6
@@ -536,7 +534,7 @@ netdbReloadState(void)
     netdbEntry *n;
     netdbEntry N;
 
-    IPAddress addr;
+    IpAddress addr;
     int count = 0;
 
     struct timeval start = current_time;
@@ -677,7 +675,7 @@ netdbFreeNameEntry(void *data)
 static void
 netdbExchangeHandleReply(void *data, StoreIOBuffer receivedData)
 {
-    IPAddress addr;
+    IpAddress addr;
 
     netdbExchangeState *ex = (netdbExchangeState *)data;
     int rec_sz = 0;
@@ -937,7 +935,7 @@ netdbPingSite(const char *hostname)
 }
 
 void
-netdbHandlePingReply(const IPAddress &from, int hops, int rtt)
+netdbHandlePingReply(const IpAddress &from, int hops, int rtt)
 {
 #if USE_ICMP
     netdbEntry *n;
@@ -984,7 +982,7 @@ netdbFreeMemory(void)
 
 #if 0 // AYJ: Looks to be unused code.
 int
-netdbHops(IPAddress &addr)
+netdbHops(IpAddress &addr)
 {
 #if USE_ICMP
     netdbEntry *n = netdbLookupAddr(addr);
@@ -1151,7 +1149,7 @@ netdbUpdatePeer(HttpRequest * r, peer * e, int irtt, int ihops)
 }
 
 void
-netdbExchangeUpdatePeer(IPAddress &addr, peer * e, double rtt, double hops)
+netdbExchangeUpdatePeer(IpAddress &addr, peer * e, double rtt, double hops)
 {
 #if USE_ICMP
     netdbEntry *n;
@@ -1193,7 +1191,7 @@ netdbExchangeUpdatePeer(IPAddress &addr, peer * e, double rtt, double hops)
 }
 
 void
-netdbDeleteAddrNetwork(IPAddress &addr)
+netdbDeleteAddrNetwork(IpAddress &addr)
 {
 #if USE_ICMP
     netdbEntry *n = netdbLookupAddr(addr);
@@ -1214,7 +1212,7 @@ netdbBinaryExchange(StoreEntry * s)
     HttpReply *reply = new HttpReply;
 #if USE_ICMP
 
-    IPAddress addr;
+    IpAddress addr;
 
     netdbEntry *n;
     int i;
index e79f51ef016cd0c76338c05ead7df53801fb283a..151f50de06975fafdef4b407c7a2f695657ff9e7 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "config.h"
 
-class IPAddress;
+class IpAddress;
 class StoreEntry;
 class HttpRequest;
 
@@ -13,12 +13,12 @@ class HttpRequest;
 
 SQUIDCEXTERN void netdbInit(void);
 
-SQUIDCEXTERN void netdbHandlePingReply(const IPAddress &from, int hops, int rtt);
+SQUIDCEXTERN void netdbHandlePingReply(const IpAddress &from, int hops, int rtt);
 SQUIDCEXTERN void netdbPingSite(const char *hostname);
 SQUIDCEXTERN void netdbDump(StoreEntry *);
 
 #if 0 // AYJ: Looks to be unused now.
-SQUIDCEXTERN int netdbHops(IPAddress &);
+SQUIDCEXTERN int netdbHops(IpAddress &);
 #endif
 
 SQUIDCEXTERN void netdbFreeMemory(void);
@@ -26,11 +26,11 @@ SQUIDCEXTERN int netdbHostHops(const char *host);
 SQUIDCEXTERN int netdbHostRtt(const char *host);
 SQUIDCEXTERN void netdbUpdatePeer(HttpRequest *, peer * e, int rtt, int hops);
 
-SQUIDCEXTERN void netdbDeleteAddrNetwork(IPAddress &addr);
+SQUIDCEXTERN void netdbDeleteAddrNetwork(IpAddress &addr);
 SQUIDCEXTERN void netdbBinaryExchange(StoreEntry *);
 SQUIDCEXTERN void netdbExchangeStart(void *);
 
-SQUIDCEXTERN void netdbExchangeUpdatePeer(IPAddress &, peer *, double, double);
+SQUIDCEXTERN void netdbExchangeUpdatePeer(IpAddress &, peer *, double, double);
 SQUIDCEXTERN peer *netdbClosestParent(HttpRequest *);
 SQUIDCEXTERN void netdbHostData(const char *host, int *samp, int *rtt, int *hops);
 
index a5df26d372fa1c55fa68a65a7dd52fcf9b22f471..75454553832dcf2ad27e19c6f4f4fce363754e6a 100644 (file)
@@ -16,7 +16,7 @@ public:
     virtual void Close() {};
 
     /// Construct ECHO request
-    virtual void SendEcho(IPAddress &to, int opcode, const char *payload, int len) {};
+    virtual void SendEcho(IpAddress &to, int opcode, const char *payload, int len) {};
 
     /// Handle ICMP responses.
     virtual void Recv(void) {};
index 47b7b4eec201388f6b94f3763eeec9c5c4fb2762..6b3f1a519ccb6168254245da65f86be309bdb9f8 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: icp_v2.cc,v 1.103 2008/02/26 21:49:35 amosjeffries Exp $
- *
  * DEBUG: section 12    Internet Cache Protocol (ICP)
  * AUTHOR: Duane Wessels
  *
 #include "wordlist.h"
 #include "SquidTime.h"
 #include "SwapDir.h"
-#include "IPAddress.h"
 #include "icmp/net_db.h"
+#include "ip/IpAddress.h"
 
 /// \ingroup ServerProtocolICPInternal2
-static void icpLogIcp(const IPAddress &, log_type, int, const char *, int);
+static void icpLogIcp(const IpAddress &, log_type, int, const char *, int);
 
 /// \ingroup ServerProtocolICPInternal2
-static void icpHandleIcpV2(int, IPAddress &, char *, int);
+static void icpHandleIcpV2(int, IpAddress &, char *, int);
 
 /// \ingroup ServerProtocolICPInternal2
 static void icpCount(void *, int, size_t, int);
@@ -70,7 +68,7 @@ static icpUdpData *IcpQueueHead = NULL;
 static icpUdpData *IcpQueueTail = NULL;
 
 /// \ingroup ServerProtocolICPInternal2
-IPAddress theOutICPAddr;
+IpAddress theOutICPAddr;
 
 /* icp_common_t */
 _icp_common_t::_icp_common_t() : opcode(ICP_INVALID), version(0), length(0), reqnum(0), flags(0), pad(0), shostid(0)
@@ -175,7 +173,7 @@ ICP2State::created(StoreEntry *newEntry)
 
 /// \ingroup ServerProtocolICPInternal2
 static void
-icpLogIcp(const IPAddress &caddr, log_type logcode, int len, const char *url, int delay)
+icpLogIcp(const IpAddress &caddr, log_type logcode, int len, const char *url, int delay)
 {
     AccessLogEntry al;
 
@@ -272,7 +270,7 @@ _icp_common_t::createMessage(
 
 int
 icpUdpSend(int fd,
-           const IPAddress &to,
+           const IpAddress &to,
            icp_common_t * msg,
            log_type logcode,
            int delay)
@@ -382,14 +380,14 @@ icpLogFromICPCode(icp_opcode opcode)
 }
 
 void
-icpCreateAndSend(icp_opcode opcode, int flags, char const *url, int reqnum, int pad, int fd, const IPAddress &from)
+icpCreateAndSend(icp_opcode opcode, int flags, char const *url, int reqnum, int pad, int fd, const IpAddress &from)
 {
     icp_common_t *reply = _icp_common_t::createMessage(opcode, flags, url, reqnum, pad);
     icpUdpSend(fd, from, reply, icpLogFromICPCode(opcode), 0);
 }
 
 void
-icpDenyAccess(IPAddress &from, char *url, int reqnum, int fd)
+icpDenyAccess(IpAddress &from, char *url, int reqnum, int fd)
 {
     debugs(12, 2, "icpDenyAccess: Access Denied for " << from << " by " << AclMatchedName << ".");
 
@@ -405,7 +403,7 @@ icpDenyAccess(IPAddress &from, char *url, int reqnum, int fd)
 }
 
 int
-icpAccessAllowed(IPAddress &from, HttpRequest * icp_request)
+icpAccessAllowed(IpAddress &from, HttpRequest * icp_request)
 {
     ACLChecklist checklist;
     checklist.src_addr = from;
@@ -427,7 +425,7 @@ icpGetUrlToSend(char *url)
 }
 
 HttpRequest *
-icpGetRequest(char *url, int reqnum, int fd, IPAddress &from)
+icpGetRequest(char *url, int reqnum, int fd, IpAddress &from)
 {
     if (strpbrk(url, w_space)) {
         url = rfc1738_escape(url);
@@ -445,7 +443,7 @@ icpGetRequest(char *url, int reqnum, int fd, IPAddress &from)
 }
 
 static void
-doV2Query(int fd, IPAddress &from, char *buf, icp_common_t header)
+doV2Query(int fd, IpAddress &from, char *buf, icp_common_t header)
 {
     int rtt = 0;
     int src_rtt = 0;
@@ -496,7 +494,7 @@ doV2Query(int fd, IPAddress &from, char *buf, icp_common_t header)
 }
 
 void
-_icp_common_t::handleReply(char *buf, IPAddress &from)
+_icp_common_t::handleReply(char *buf, IpAddress &from)
 {
     if (neighbors_do_private_keys && reqnum == 0) {
         debugs(12, 0, "icpHandleIcpV2: Neighbor " << from << " returned reqnum = 0");
@@ -513,7 +511,7 @@ _icp_common_t::handleReply(char *buf, IPAddress &from)
 }
 
 static void
-icpHandleIcpV2(int fd, IPAddress &from, char *buf, int len)
+icpHandleIcpV2(int fd, IpAddress &from, char *buf, int len)
 {
     if (len <= 0) {
         debugs(12, 3, "icpHandleIcpV2: ICP message is too small");
@@ -566,7 +564,7 @@ static void
 icpPktDump(icp_common_t * pkt)
 {
 
-    IPAddress a;
+    IpAddress a;
 
     debugs(12, 9, "opcode:     " << std::setw(3) << pkt->opcode  << " " << icp_opcode_str[pkt->opcode]);
     debugs(12, 9, "version: "<< std::left << std::setw(8) << pkt->version);
@@ -585,7 +583,7 @@ icpHandleUdp(int sock, void *data)
 {
     int *N = &incoming_sockets_accepted;
 
-    IPAddress from;
+    IpAddress from;
     LOCAL_ARRAY(char, buf, SQUID_UDP_SO_RCVBUF);
     int len;
     int icp_version;
@@ -652,7 +650,7 @@ icpConnectionsOpen(void)
 {
     u_int16_t port;
 
-    IPAddress addr;
+    IpAddress addr;
 
     struct addrinfo *xai = NULL;
     int x;
index c9759f9c2bcd0b91ae4ec14c7f4a2f47367bf1bf..26e40cb19ad9631b2e2717c4f7524b568feacb7a 100644 (file)
@@ -56,7 +56,7 @@ public:
 
 /// \ingroup ServerProtocolICPInternal3
 static void
-doV3Query(int fd, IPAddress &from, char *buf, icp_common_t header)
+doV3Query(int fd, IpAddress &from, char *buf, icp_common_t header)
 {
     /* We have a valid packet */
     char *url = buf + sizeof(icp_common_t) + sizeof(u_int32_t);
@@ -109,7 +109,7 @@ ICP3State::created(StoreEntry *newEntry)
 /// \ingroup ServerProtocolICPInternal3
 /* Currently Harvest cached-2.x uses ICP_VERSION_3 */
 void
-icpHandleIcpV3(int fd, IPAddress&from, char *buf, int len)
+icpHandleIcpV3(int fd, IpAddress&from, char *buf, int len)
 {
     if (len <= 0) {
         debugs(12, 3, "icpHandleIcpV3: ICP message is too small");
index aa6df075695e9e44ba3011a63f267e4b988affb8..45624cc5539b433a2ccd06712cb3879a69e67295 100644 (file)
@@ -51,9 +51,9 @@ typedef struct _IdentStateData {
     hash_link hash;            /* must be first */
     int fd;                    /* IDENT fd */
 
-    IPAddress me;
+    IpAddress me;
 
-    IPAddress my_peer;
+    IpAddress my_peer;
     IdentClient *clients;
     char buf[4096];
 } IdentStateData;
@@ -202,7 +202,7 @@ CBDATA_TYPE(IdentStateData);
  * start a TCP connection to the peer host on port 113
  */
 void
-identStart(IPAddress &me, IPAddress &my_peer, IDCB * callback, void *data)
+identStart(IpAddress &me, IpAddress &my_peer, IDCB * callback, void *data)
 {
     IdentStateData *state;
     int fd;
index a00043e97ad7cef8aec82cd626e6255211ff6cad..0c9f9bdcd1ab47789a479eb42d5218e9448a97cc 100644 (file)
 
 #include "cbdata.h"
 
-class IPAddress;
+class IpAddress;
 
 /// \ingroup IdentAPI
-SQUIDCEXTERN void identStart(IPAddress &me, IPAddress &my_peer, IDCB * callback, void *cbdata);
+SQUIDCEXTERN void identStart(IpAddress &me, IpAddress &my_peer, IDCB * callback, void *cbdata);
 
 /// \ingroup IdentAPI
 SQUIDCEXTERN void identInit(void);
index 68e62e69e1f9902c982d3a508a253a82ff4d4b09..d48ec98f4e35010a2ec935e90a20fdc904b716b8 100644 (file)
@@ -110,7 +110,7 @@ internalRemoteUri(const char *host, u_short port, const char *dir, const char *n
 
 #if USE_IPV6
     /* check for an IP address and format appropriately if found */
-    IPAddress test = lc_host;
+    IpAddress test = lc_host;
     if ( !test.IsAnyAddr() ) {
         test.ToHostname(lc_host,SQUIDHOSTNAMELEN);
     }
similarity index 88%
rename from lib/IPAddress.cc
rename to src/ip/IpAddress.cc
index 8bb88143da4a511116e65a1c4a72a3af35b73617..f9f3a174499412486e1a79bc6672da359a80652f 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: IPAddress.cc,v 1.4 2008/02/15 09:45:57 amosjeffries Exp $
- *
  * DEBUG: section 14   IP Storage and Handling
  * AUTHOR: Amos Jeffries
  *
@@ -16,7 +14,7 @@
  *  developed and/or copyrighted by other sources.  Please see the
  *  CREDITS file for full details.
  *
- *  This IPAddress code is copyright (C) 2007 by Treehouse Networks Ltd
+ *  This IpAddress code is copyright (C) 2007 by Treehouse Networks Ltd
  *  of New Zealand. It is published and Lisenced as an extension of
  *  squid under the same conditions as the main squid application.
  *
@@ -37,7 +35,7 @@
  */
 
 #include "config.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 #include "util.h"
 
 
@@ -63,7 +61,7 @@
 #ifndef SQUID_DEBUG
 #    define debugs(a,b,c)        //  drop.
 #else
-#warning "IPAddress built with Debugs!!"
+#warning "IpAddress built with Debugs!!"
 #    include "../src/Debug.h"
 #endif
 
@@ -91,7 +89,7 @@ static const unsigned int MAX_IP6_STRLEN = STRLEN_IP6R;
 #if USE_IPV6
 #define IASSERT(a,b)  \
        if(!(b)){       printf("assert \"%s\" at line %d\n", a, __LINE__); \
-               printf("IPAddress invalid? with IsIPv4()=%c, IsIPv6()=%c\n",(IsIPv4()?'T':'F'),(IsIPv6()?'T':'F')); \
+               printf("IpAddress invalid? with IsIPv4()=%c, IsIPv6()=%c\n",(IsIPv4()?'T':'F'),(IsIPv6()?'T':'F')); \
                printf("ADDRESS:"); \
                for(unsigned int i = 0; i < sizeof(m_SocketAddr.sin6_addr); i++) { \
                        printf(" %x", m_SocketAddr.sin6_addr.s6_addr[i]); \
@@ -100,24 +98,24 @@ static const unsigned int MAX_IP6_STRLEN = STRLEN_IP6R;
 #else
 #define IASSERT(a,b)  \
        if(!(b)){       printf("assert \"%s\" at line %d\n", a, __LINE__); \
-               printf("IPAddress invalid? with IsIPv4()=%c, IsIPv6()=%c\n",(IsIPv4()?'T':'F'),(IsIPv6()?'T':'F')); \
+               printf("IpAddress invalid? with IsIPv4()=%c, IsIPv6()=%c\n",(IsIPv4()?'T':'F'),(IsIPv6()?'T':'F')); \
                printf("ADDRESS: %x\n", (unsigned int)m_SocketAddr.sin_addr.s_addr); \
                assert(b); \
        }
 #endif
 
-IPAddress::IPAddress()
+IpAddress::IpAddress()
 {
     SetEmpty();
 }
 
-IPAddress::~IPAddress()
+IpAddress::~IpAddress()
 {
-    memset(this,0,sizeof(IPAddress));
+    memset(this,0,sizeof(IpAddress));
 }
 
 int
-IPAddress::GetCIDR() const
+IpAddress::GetCIDR() const
 {
     uint8_t shift,byte;
     uint8_t bit,caught;
@@ -166,7 +164,7 @@ IPAddress::GetCIDR() const
     return len;
 }
 
-const int IPAddress::ApplyMask(IPAddress const &mask_addr)
+const int IpAddress::ApplyMask(IpAddress const &mask_addr)
 {
     uint32_t *p1 = (uint32_t*)(&m_SocketAddr.sin6_addr);
     uint32_t const *p2 = (uint32_t const *)(&mask_addr.m_SocketAddr.sin6_addr);
@@ -186,7 +184,7 @@ const int IPAddress::ApplyMask(IPAddress const &mask_addr)
     return changes;
 }
 
-bool IPAddress::ApplyMask(const unsigned int cidr, int mtype)
+bool IpAddress::ApplyMask(const unsigned int cidr, int mtype)
 {
     uint8_t clearbits = 0;
     uint8_t* p = NULL;
@@ -239,12 +237,12 @@ bool IPAddress::ApplyMask(const unsigned int cidr, int mtype)
     return true;
 }
 
-bool IPAddress::IsSockAddr() const
+bool IpAddress::IsSockAddr() const
 {
     return (m_SocketAddr.sin6_port != 0);
 }
 
-bool IPAddress::IsIPv4() const
+bool IpAddress::IsIPv4() const
 {
 #if USE_IPV6
 
@@ -262,7 +260,7 @@ bool IPAddress::IsIPv4() const
 #endif
 }
 
-bool IPAddress::IsIPv6() const
+bool IpAddress::IsIPv6() const
 {
 #if USE_IPV6
 
@@ -279,7 +277,7 @@ bool IPAddress::IsIPv6() const
 #endif
 }
 
-bool IPAddress::IsAnyAddr() const
+bool IpAddress::IsAnyAddr() const
 {
 #if USE_IPV6
     return     m_SocketAddr.sin6_addr.s6_addr32[0] == 0
@@ -294,7 +292,7 @@ bool IPAddress::IsAnyAddr() const
 }
 
 /// NOTE: Does NOT clear the Port stored. Ony the Address and Type.
-void IPAddress::SetAnyAddr()
+void IpAddress::SetAnyAddr()
 {
 #if USE_IPV6
     memset(&m_SocketAddr.sin6_addr, 0, sizeof(struct in6_addr) );
@@ -303,13 +301,13 @@ void IPAddress::SetAnyAddr()
 #endif
 }
 
-/// NOTE: completely empties the IPAddress structure. Address, Port, Type, everything.
-void IPAddress::SetEmpty()
+/// NOTE: completely empties the IpAddress structure. Address, Port, Type, everything.
+void IpAddress::SetEmpty()
 {
     memset(&m_SocketAddr, 0, sizeof(m_SocketAddr) );
 }
 
-bool IPAddress::SetIPv4()
+bool IpAddress::SetIPv4()
 {
 #if USE_IPV6
 
@@ -336,7 +334,7 @@ bool IPAddress::SetIPv4()
 #endif
 }
 
-bool IPAddress::IsLocalhost() const
+bool IpAddress::IsLocalhost() const
 {
 #if USE_IPV6
     return    (   m_SocketAddr.sin6_addr.s6_addr32[0] == 0
@@ -359,7 +357,7 @@ bool IPAddress::IsLocalhost() const
 #endif
 }
 
-void IPAddress::SetLocalhost()
+void IpAddress::SetLocalhost()
 {
 #if USE_IPV6
     SetAnyAddr();
@@ -372,7 +370,7 @@ void IPAddress::SetLocalhost()
 #endif
 }
 
-bool IPAddress::IsNoAddr() const
+bool IpAddress::IsNoAddr() const
 {
     // IFF the address == 0xff..ff (all ones)
 #if USE_IPV6
@@ -387,7 +385,7 @@ bool IPAddress::IsNoAddr() const
 #endif
 }
 
-void IPAddress::SetNoAddr()
+void IpAddress::SetNoAddr()
 {
 #if USE_IPV6
     memset(&m_SocketAddr.sin6_addr, 0xFFFFFFFF, sizeof(struct in6_addr) );
@@ -400,7 +398,7 @@ void IPAddress::SetNoAddr()
 
 #if USE_IPV6
 
-bool IPAddress::GetReverseString6(char buf[MAX_IPSTRLEN], const struct in6_addr &dat) const
+bool IpAddress::GetReverseString6(char buf[MAX_IPSTRLEN], const struct in6_addr &dat) const
 {
     char *p = buf;
     unsigned char const *r = dat.s6_addr;
@@ -428,7 +426,7 @@ bool IPAddress::GetReverseString6(char buf[MAX_IPSTRLEN], const struct in6_addr
 
 #endif
 
-bool IPAddress::GetReverseString4(char buf[MAX_IPSTRLEN], const struct in_addr &dat) const
+bool IpAddress::GetReverseString4(char buf[MAX_IPSTRLEN], const struct in_addr &dat) const
 {
     unsigned int i = (unsigned int) ntohl(dat.s_addr);
     snprintf(buf, 32, "%u.%u.%u.%u.in-addr.arpa.",
@@ -439,7 +437,7 @@ bool IPAddress::GetReverseString4(char buf[MAX_IPSTRLEN], const struct in_addr &
     return true;
 }
 
-bool IPAddress::GetReverseString(char buf[MAX_IPSTRLEN], int show_type) const
+bool IpAddress::GetReverseString(char buf[MAX_IPSTRLEN], int show_type) const
 {
 
     if (show_type == AF_UNSPEC) {
@@ -468,29 +466,29 @@ bool IPAddress::GetReverseString(char buf[MAX_IPSTRLEN], int show_type) const
     return false;
 }
 
-IPAddress& IPAddress::operator =(const IPAddress &s)
+IpAddress& IpAddress::operator =(const IpAddress &s)
 {
-    memcpy(this, &s, sizeof(IPAddress));
+    memcpy(this, &s, sizeof(IpAddress));
     return *this;
 };
 
-IPAddress::IPAddress(const char*s)
+IpAddress::IpAddress(const char*s)
 {
     SetEmpty();
     operator=(s);
 }
 
-bool IPAddress::operator =(const char* s)
+bool IpAddress::operator =(const char* s)
 {
     return LookupHostIP(s, true);
 }
 
-bool IPAddress::GetHostByName(const char* s)
+bool IpAddress::GetHostByName(const char* s)
 {
     return LookupHostIP(s, false);
 }
 
-bool IPAddress::LookupHostIP(const char *s, bool nodns)
+bool IpAddress::LookupHostIP(const char *s, bool nodns)
 {
     int err = 0;
 
@@ -534,13 +532,13 @@ bool IPAddress::LookupHostIP(const char *s, bool nodns)
     return true;
 }
 
-IPAddress::IPAddress(struct sockaddr_in const &s)
+IpAddress::IpAddress(struct sockaddr_in const &s)
 {
     SetEmpty();
     operator=(s);
 };
 
-IPAddress& IPAddress::operator =(struct sockaddr_in const &s)
+IpAddress& IpAddress::operator =(struct sockaddr_in const &s)
 {
 #if USE_IPV6
     Map4to6((const in_addr)s.sin_addr, m_SocketAddr.sin6_addr);
@@ -557,7 +555,7 @@ IPAddress& IPAddress::operator =(struct sockaddr_in const &s)
     return *this;
 };
 
-IPAddress& IPAddress::operator =(const struct sockaddr_storage &s)
+IpAddress& IpAddress::operator =(const struct sockaddr_storage &s)
 {
 #if USE_IPV6
     /* some AF_* magic to tell socket types apart and what we need to do */
@@ -574,20 +572,20 @@ IPAddress& IPAddress::operator =(const struct sockaddr_storage &s)
     return *this;
 };
 
-void IPAddress::check4Mapped()
+void IpAddress::check4Mapped()
 {
     // obsolete.
     // TODO use this NOW to set the sin6_family properly on exporting. not on import.
 }
 
 #if USE_IPV6
-IPAddress::IPAddress(struct sockaddr_in6 const &s)
+IpAddress::IpAddress(struct sockaddr_in6 const &s)
 {
     SetEmpty();
     operator=(s);
 };
 
-IPAddress& IPAddress::operator =(struct sockaddr_in6 const &s)
+IpAddress& IpAddress::operator =(struct sockaddr_in6 const &s)
 {
     memcpy(&m_SocketAddr, &s, sizeof(struct sockaddr_in6));
 
@@ -598,13 +596,13 @@ IPAddress& IPAddress::operator =(struct sockaddr_in6 const &s)
 
 #endif
 
-IPAddress::IPAddress(struct in_addr const &s)
+IpAddress::IpAddress(struct in_addr const &s)
 {
     SetEmpty();
     operator=(s);
 };
 
-IPAddress& IPAddress::operator =(struct in_addr const &s)
+IpAddress& IpAddress::operator =(struct in_addr const &s)
 {
 #if USE_IPV6
     Map4to6((const in_addr)s, m_SocketAddr.sin6_addr);
@@ -624,13 +622,13 @@ IPAddress& IPAddress::operator =(struct in_addr const &s)
 
 #if USE_IPV6
 
-IPAddress::IPAddress(struct in6_addr const &s)
+IpAddress::IpAddress(struct in6_addr const &s)
 {
     SetEmpty();
     operator=(s);
 };
 
-IPAddress& IPAddress::operator =(struct in6_addr const &s)
+IpAddress& IpAddress::operator =(struct in6_addr const &s)
 {
 
     memcpy(&m_SocketAddr.sin6_addr, &s, sizeof(struct in6_addr));
@@ -644,34 +642,34 @@ IPAddress& IPAddress::operator =(struct in6_addr const &s)
 
 #endif
 
-IPAddress::IPAddress(const IPAddress &s)
+IpAddress::IpAddress(const IpAddress &s)
 {
     SetEmpty();
     operator=(s);
 }
 
-IPAddress::IPAddress(IPAddress *s)
+IpAddress::IpAddress(IpAddress *s)
 {
     SetEmpty();
     operator=(s);
 }
 
-IPAddress& IPAddress::operator =(IPAddress *s)
+IpAddress& IpAddress::operator =(IpAddress *s)
 {
-    IPAddress *tmp = NULL;
+    IpAddress *tmp = NULL;
     if (!s) return *this;
-    tmp = dynamic_cast<IPAddress*>(s);
+    tmp = dynamic_cast<IpAddress*>(s);
     if (!tmp) return *this;
     return operator=(*tmp);
 }
 
-IPAddress::IPAddress(const struct hostent &s)
+IpAddress::IpAddress(const struct hostent &s)
 {
     SetEmpty();
     operator=(s);
 }
 
-bool IPAddress::operator =(const struct hostent &s)
+bool IpAddress::operator =(const struct hostent &s)
 {
 
     struct in_addr* ipv4 = NULL;
@@ -717,13 +715,13 @@ bool IPAddress::operator =(const struct hostent &s)
     return true;
 }
 
-IPAddress::IPAddress(const struct addrinfo &s)
+IpAddress::IpAddress(const struct addrinfo &s)
 {
     SetEmpty();
     operator=(s);
 }
 
-bool IPAddress::operator =(const struct addrinfo &s)
+bool IpAddress::operator =(const struct addrinfo &s)
 {
 
     struct sockaddr_in* ipv4 = NULL;
@@ -792,7 +790,7 @@ bool IPAddress::operator =(const struct addrinfo &s)
     return true;
 }
 
-void IPAddress::GetAddrInfo(struct addrinfo *&dst, int force) const
+void IpAddress::GetAddrInfo(struct addrinfo *&dst, int force) const
 {
     if (dst == NULL) {
         dst = new addrinfo;
@@ -858,7 +856,7 @@ void IPAddress::GetAddrInfo(struct addrinfo *&dst, int force) const
         }
 }
 
-void IPAddress::InitAddrInfo(struct addrinfo *&ai) const
+void IpAddress::InitAddrInfo(struct addrinfo *&ai) const
 {
     if (ai == NULL) {
         ai = new addrinfo;
@@ -875,7 +873,7 @@ void IPAddress::InitAddrInfo(struct addrinfo *&ai) const
 
 }
 
-void IPAddress::FreeAddrInfo(struct addrinfo *&ai) const
+void IpAddress::FreeAddrInfo(struct addrinfo *&ai) const
 {
     if (ai == NULL) return;
 
@@ -891,7 +889,7 @@ void IPAddress::FreeAddrInfo(struct addrinfo *&ai) const
     ai = NULL;
 }
 
-int IPAddress::matchIPAddr(const IPAddress &rhs) const
+int IpAddress::matchIPAddr(const IpAddress &rhs) const
 {
 #if USE_IPV6
     uint8_t *l = (uint8_t*)m_SocketAddr.sin6_addr.s6_addr;
@@ -916,17 +914,17 @@ int IPAddress::matchIPAddr(const IPAddress &rhs) const
     return 0;
 }
 
-bool IPAddress::operator ==(const IPAddress &s) const
+bool IpAddress::operator ==(const IpAddress &s) const
 {
     return (0 == matchIPAddr(s));
 }
 
-bool IPAddress::operator !=(const IPAddress &s) const
+bool IpAddress::operator !=(const IpAddress &s) const
 {
     return ! ( operator==(s) );
 }
 
-bool IPAddress::operator <=(const IPAddress &rhs) const
+bool IpAddress::operator <=(const IpAddress &rhs) const
 {
     if (IsAnyAddr() && !rhs.IsAnyAddr())
         return true;
@@ -934,7 +932,7 @@ bool IPAddress::operator <=(const IPAddress &rhs) const
     return (matchIPAddr(rhs) <= 0);
 }
 
-bool IPAddress::operator >=(const IPAddress &rhs) const
+bool IpAddress::operator >=(const IpAddress &rhs) const
 {
     if (IsNoAddr() && !rhs.IsNoAddr())
         return true;
@@ -942,7 +940,7 @@ bool IPAddress::operator >=(const IPAddress &rhs) const
     return ( matchIPAddr(rhs) >= 0);
 }
 
-bool IPAddress::operator >(const IPAddress &rhs) const
+bool IpAddress::operator >(const IpAddress &rhs) const
 {
     if (IsNoAddr() && !rhs.IsNoAddr())
         return true;
@@ -950,7 +948,7 @@ bool IPAddress::operator >(const IPAddress &rhs) const
     return ( matchIPAddr(rhs) > 0);
 }
 
-bool IPAddress::operator <(const IPAddress &rhs) const
+bool IpAddress::operator <(const IpAddress &rhs) const
 {
     if (IsNoAddr() && !rhs.IsNoAddr())
         return true;
@@ -958,12 +956,12 @@ bool IPAddress::operator <(const IPAddress &rhs) const
     return ( matchIPAddr(rhs) < 0);
 }
 
-u_short IPAddress::GetPort() const
+u_short IpAddress::GetPort() const
 {
     return ntohs( m_SocketAddr.sin6_port );
 }
 
-u_short IPAddress::SetPort(u_short prt)
+u_short IpAddress::SetPort(u_short prt)
 {
     m_SocketAddr.sin6_port = htons(prt);
 
@@ -980,7 +978,7 @@ u_short IPAddress::SetPort(u_short prt)
  *
  * A copy of the buffer is also returned for simple immediate display.
  */
-char* IPAddress::NtoA(char* buf, const unsigned int blen, int force) const
+char* IpAddress::NtoA(char* buf, const unsigned int blen, int force) const
 {
     // Ensure we have a buffer.
     if (buf == NULL) {
@@ -1035,7 +1033,7 @@ char* IPAddress::NtoA(char* buf, const unsigned int blen, int force) const
     return buf;
 }
 
-unsigned int IPAddress::ToHostname(char *buf, const unsigned int blen) const {
+unsigned int IpAddress::ToHostname(char *buf, const unsigned int blen) const {
     char *p = buf;
 
     if (IsIPv6() && blen > 0) {
@@ -1065,7 +1063,7 @@ unsigned int IPAddress::ToHostname(char *buf, const unsigned int blen) const {
     return (p - buf);
 }
 
-char* IPAddress::ToURL(char* buf, unsigned int blen) const {
+char* IpAddress::ToURL(char* buf, unsigned int blen) const {
     char *p = buf;
 
     // Ensure we have a buffer.
@@ -1087,12 +1085,12 @@ char* IPAddress::ToURL(char* buf, unsigned int blen) const {
     return buf;
 }
 
-void IPAddress::GetSockAddr(struct sockaddr_storage &addr, const int family) const {
+void IpAddress::GetSockAddr(struct sockaddr_storage &addr, const int family) const {
     struct sockaddr_in *sin = NULL;
 
     if ( family == AF_INET && !IsIPv4()) {
         // FIXME INET6: caller using the wrong socket type!
-        debugs(14, DBG_CRITICAL, HERE << "IPAddress::GetSockAddr : Cannot convert non-IPv4 to IPv4. from " << *this);
+        debugs(14, DBG_CRITICAL, HERE << "IpAddress::GetSockAddr : Cannot convert non-IPv4 to IPv4. from " << *this);
         assert(false);
     }
 
@@ -1112,7 +1110,7 @@ void IPAddress::GetSockAddr(struct sockaddr_storage &addr, const int family) con
 #endif /* USE_IPV6 */
 }
 
-void IPAddress::GetSockAddr(struct sockaddr_in &buf) const {
+void IpAddress::GetSockAddr(struct sockaddr_in &buf) const {
 #if USE_IPV6
 
     if ( IsIPv4() ) {
@@ -1120,7 +1118,7 @@ void IPAddress::GetSockAddr(struct sockaddr_in &buf) const {
         buf.sin_port = m_SocketAddr.sin6_port;
         Map6to4( m_SocketAddr.sin6_addr, buf.sin_addr);
     } else {
-        debugs(14, DBG_CRITICAL, HERE << "IPAddress::GetSockAddr : Cannot convert non-IPv4 to IPv4. from " << *this );
+        debugs(14, DBG_CRITICAL, HERE << "IpAddress::GetSockAddr : Cannot convert non-IPv4 to IPv4. from " << *this );
 
         memset(&buf,0xFFFFFFFF,sizeof(struct sockaddr_in));
         assert(false);
@@ -1145,7 +1143,7 @@ void IPAddress::GetSockAddr(struct sockaddr_in &buf) const {
 
 #if USE_IPV6
 
-void IPAddress::GetSockAddr(struct sockaddr_in6 &buf) const {
+void IpAddress::GetSockAddr(struct sockaddr_in6 &buf) const {
     memcpy(&buf, &m_SocketAddr, sizeof(struct sockaddr_in6));
     /* maintain address family. It may have changed inside us. */
     buf.sin6_family = AF_INET6;
@@ -1160,7 +1158,7 @@ void IPAddress::GetSockAddr(struct sockaddr_in6 &buf) const {
 
 #if USE_IPV6
 
-void IPAddress::Map4to6(const struct in_addr &in, struct in6_addr &out) const {
+void IpAddress::Map4to6(const struct in_addr &in, struct in6_addr &out) const {
     /* check for special cases */
 
     if ( in.s_addr == 0x00000000) {
@@ -1192,7 +1190,7 @@ void IPAddress::Map4to6(const struct in_addr &in, struct in6_addr &out) const {
     }
 }
 
-void IPAddress::Map6to4(const struct in6_addr &in, struct in_addr &out) const {
+void IpAddress::Map6to4(const struct in6_addr &in, struct in_addr &out) const {
     /* ANYADDR */
     /* NOADDR */
     /* general */
@@ -1213,13 +1211,13 @@ void IPAddress::Map6to4(const struct in6_addr &in, struct in_addr &out) const {
 #endif
 
 #if USE_IPV6
-void IPAddress::GetInAddr(in6_addr &buf) const {
+void IpAddress::GetInAddr(in6_addr &buf) const {
     memcpy(&buf, &m_SocketAddr.sin6_addr, sizeof(struct in6_addr));
 }
 
 #endif
 
-bool IPAddress::GetInAddr(struct in_addr &buf) const {
+bool IpAddress::GetInAddr(struct in_addr &buf) const {
 
 #if USE_IPV6
     if ( IsIPv4() ) {
@@ -1237,7 +1235,7 @@ bool IPAddress::GetInAddr(struct in_addr &buf) const {
     // default:
     // non-compatible IPv6 Pure Address
 
-    debugs(14,1, HERE << "IPAddress::GetInAddr : Cannot convert non-IPv4 to IPv4. IPA=" << *this);
+    debugs(14,1, HERE << "IpAddress::GetInAddr : Cannot convert non-IPv4 to IPv4. IPA=" << *this);
     memset(&buf,0xFFFFFFFF,sizeof(struct in_addr));
     assert(false);
     return false;
similarity index 86%
rename from include/IPAddress.h
rename to src/ip/IpAddress.h
index 91c167afb15d97fdf294ec10a1381dcde9fa7e37..4c40ac2b2e1830f09e2a1894a74b876c83ce1c4f 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: IPAddress.h,v 1.3 2008/02/05 22:39:42 amosjeffries Exp $
- *
  * DEBUG: section 14    IP Storage and Handling
  * AUTHOR: Amos Jeffries
  *
@@ -16,7 +14,7 @@
  *  developed and/or copyrighted by other sources.  Please see the
  *  CREDITS file for full details.
  *
- *  This IPAddress code is copyright (C) 2007 by Treehouse Networks Ltd
+ *  This IpAddress code is copyright (C) 2007 by Treehouse Networks Ltd
  *  of New Zealand. It is published and Lisenced as an extension of
  *  squid under the same conditions as the main squid application.
  *
 /**
  * Holds and manipulates IPv4, IPv6, and Socket Addresses.
  */
-class IPAddress
+class IpAddress
 {
 
 public:
     /** @name Constructors and Destructor */
     /*@{*/
-    IPAddress();
-    IPAddress(const IPAddress &);
+    IpAddress();
+    IpAddress(const IpAddress &);
 
     /**
      * This constructor takes its own copy of the object pointed to for memory-safe usage later.
@@ -113,35 +111,35 @@ public:
      \deprecated Use of pointers can be nasty. Consider this a last-resort.
      *           Prefer the by-reference (&) version instead.
      */
-    IPAddress(IPAddress *);
+    IpAddress(IpAddress *);
 
-    IPAddress(const struct in_addr &);
+    IpAddress(const struct in_addr &);
 
-    IPAddress(const struct sockaddr_in &);
+    IpAddress(const struct sockaddr_in &);
 #if USE_IPV6
 
-    IPAddress(const struct in6_addr &);
+    IpAddress(const struct in6_addr &);
 
-    IPAddress(const struct sockaddr_in6 &);
+    IpAddress(const struct sockaddr_in6 &);
 #endif
 
-    IPAddress(const struct hostent &);
-    IPAddress(const struct addrinfo &);
-    IPAddress(const char*);
+    IpAddress(const struct hostent &);
+    IpAddress(const struct addrinfo &);
+    IpAddress(const char*);
     /// Default destructor.
-    ~IPAddress();
+    ~IpAddress();
     /*@}*/
 
     /** @name Assignment Operators */
     /*@{*/
-    IPAddress& operator =(const IPAddress &s);
-    IPAddress& operator =(IPAddress *s);
-    IPAddress& operator =(struct sockaddr_in const &s);
-    IPAddress& operator =(struct sockaddr_storage const &s);
-    IPAddress& operator =(struct in_addr const &s);
+    IpAddress& operator =(const IpAddress &s);
+    IpAddress& operator =(IpAddress *s);
+    IpAddress& operator =(struct sockaddr_in const &s);
+    IpAddress& operator =(struct sockaddr_storage const &s);
+    IpAddress& operator =(struct in_addr const &s);
 #if USE_IPV6
-    IPAddress& operator =(struct in6_addr const &s);
-    IPAddress& operator =(struct sockaddr_in6 const &s);
+    IpAddress& operator =(struct in6_addr const &s);
+    IpAddress& operator =(struct sockaddr_in6 const &s);
 #endif
     bool operator =(const struct hostent &s);
     bool operator =(const struct addrinfo &s);
@@ -150,12 +148,12 @@ public:
 
     /** @name Boolean Operators */
     /*@{*/
-    bool operator ==(IPAddress const &s) const;
-    bool operator !=(IPAddress const &s) const;
-    bool operator >=(IPAddress const &rhs) const;
-    bool operator <=(IPAddress const &rhs) const;
-    bool operator >(IPAddress const &rhs) const;
-    bool operator <(IPAddress const &rhs) const;
+    bool operator ==(IpAddress const &s) const;
+    bool operator !=(IpAddress const &s) const;
+    bool operator >=(IpAddress const &rhs) const;
+    bool operator <=(IpAddress const &rhs) const;
+    bool operator >(IpAddress const &rhs) const;
+    bool operator <(IpAddress const &rhs) const;
 
 public:
     /* methods */
@@ -182,7 +180,7 @@ public:
     bool IsSockAddr() const;
 
     /** Content-neutral test for whether the specific IP case ANY_ADDR is stored.
-     *  This is the default content of a new undefined IPAddress object.
+     *  This is the default content of a new undefined IpAddress object.
      \retval true IPv4 0.0.0.0
      \retval true IPv6 ::
      \retval false anything else.
@@ -197,7 +195,7 @@ public:
     bool IsNoAddr() const;
 
     /** Content-neutral test for whether the specific IP case LOCALHOST is stored.
-     *  This is the default content of a new undefined IPAddress object.
+     *  This is the default content of a new undefined IpAddress object.
      \retval true IPv4 127.0.0.1
      \retval true IPv6 ::1
      \retval false anything else.
@@ -251,7 +249,7 @@ public:
     /** Apply a mask to the stored address.
      \param mask Netmask format to be bit-mask-AND'd over the stored address.
      */
-    const int ApplyMask(const IPAddress &mask);
+    const int ApplyMask(const IpAddress &mask);
 
     /** Apply a mask to the stored address.
      *  CIDR will be converted appropriate to map the stored content.
@@ -309,10 +307,10 @@ public:
      \retval  1  IP rhs is greater (numerically) than that stored.
      \retval -1  IP rhs is less (numerically) than that stored.
      */
-    int matchIPAddr(const IPAddress &rhs) const;
+    int matchIPAddr(const IpAddress &rhs) const;
 
     /**
-     *  Get RFC 3493 addrinfo structure from the IPAddress data
+     *  Get RFC 3493 addrinfo structure from the IpAddress data
      *  for protocol-neutral socket operations.
      *  Should be passed a NULL pointer of type struct addrinfo* it will
      *  allocate memory for the structures involved. (see FreeAddrInfo to clear).
@@ -321,7 +319,7 @@ public:
      *  Some situations may also require an actual call to the system getaddrinfo()
      *  to pull relevant OS details for the socket.
      \par
-     *  IPAddress allocated objects MUST be destructed by IPAddress::FreeAddrInfo
+     *  IpAddress allocated objects MUST be destructed by IpAddress::FreeAddrInfo
      *  System getaddrinfo() allocated objects MUST be freed with system freeaddrinfo()
      \par
      *  Some OS require that IPv4 addresses are pre-mapped by the client.
@@ -337,7 +335,7 @@ public:
 #endif
 
     /**
-     *  Equivalent to the sysem call freeaddrinfo() but for IPAddress allocated data
+     *  Equivalent to the sysem call freeaddrinfo() but for IpAddress allocated data
      */
     void FreeAddrInfo(struct addrinfo *&ai) const;
 
@@ -370,17 +368,17 @@ public:
 
     void GetSockAddr(struct sockaddr_storage &addr, const int family) const;
 
-    /// \deprecated Deprecated for public use. Use IPAddress::GetAddrInfo()
+    /// \deprecated Deprecated for public use. Use IpAddress::GetAddrInfo()
     void GetSockAddr(struct sockaddr_in &) const;
 
-    /// \deprecated Deprecated for public use. Use IPAddress::GetAddrInfo()
+    /// \deprecated Deprecated for public use. Use IpAddress::GetAddrInfo()
     bool GetInAddr(struct in_addr &) const; /* false if could not convert IPv6 down to IPv4 */
 #if USE_IPV6
 
-    /// \deprecated Deprecated for public use. Use IPAddress::GetAddrInfo()
+    /// \deprecated Deprecated for public use. Use IpAddress::GetAddrInfo()
     void GetSockAddr(struct sockaddr_in6 &) const;
 
-    /// \deprecated Deprecated for public use. Use IPAddress::GetAddrInfo()
+    /// \deprecated Deprecated for public use. Use IpAddress::GetAddrInfo()
     void GetInAddr(struct in6_addr &) const;
 #endif
 
@@ -415,7 +413,7 @@ private:
 
 
 inline std::ostream &
-operator << (std::ostream &os, const IPAddress &ipa)
+operator << (std::ostream &os, const IpAddress &ipa)
 {
     char buf[MAX_IPSTRLEN];
     os << ipa.ToURL(buf,MAX_IPSTRLEN);
@@ -423,14 +421,14 @@ operator << (std::ostream &os, const IPAddress &ipa)
 }
 
 // WAS _sockaddr_in_list in an earlier incarnation
-class IPAddress_list
+class IpAddress_list
 {
 public:
-    IPAddress_list() { next = NULL; };
-    ~IPAddress_list() { if (next) delete next; next = NULL; };
+    IpAddress_list() { next = NULL; };
+    ~IpAddress_list() { if (next) delete next; next = NULL; };
 
-    IPAddress s;
-    IPAddress_list *next;
+    IpAddress s;
+    IpAddress_list *next;
 };
 
 
index b8565f794858100dd5725a4efff95ff8b9320824..8120c4ff1165ea78cb267d4f972db712e386ed77 100644 (file)
@@ -118,7 +118,7 @@ IpIntercept::StopInterception(const char *str)
 }
 
 int
-IpIntercept::NetfilterInterception(int fd, const IPAddress &me, IPAddress &dst, int silent)
+IpIntercept::NetfilterInterception(int fd, const IpAddress &me, IpAddress &dst, int silent)
 {
 #if LINUX_NETFILTER
     struct addrinfo *lookup = NULL;
@@ -149,7 +149,7 @@ IpIntercept::NetfilterInterception(int fd, const IPAddress &me, IPAddress &dst,
 }
 
 int
-IpIntercept::NetfilterTransparent(int fd, const IPAddress &me, IPAddress &client, int silent)
+IpIntercept::NetfilterTransparent(int fd, const IpAddress &me, IpAddress &client, int silent)
 {
 #if LINUX_NETFILTER
 
@@ -165,7 +165,7 @@ IpIntercept::NetfilterTransparent(int fd, const IPAddress &me, IPAddress &client
 }
 
 int
-IpIntercept::IpfwInterception(int fd, const IPAddress &me, IPAddress &dst, int silent)
+IpIntercept::IpfwInterception(int fd, const IpAddress &me, IpAddress &dst, int silent)
 {
 #if IPFW_TRANSPARENT
     struct addrinfo *lookup = NULL;
@@ -196,7 +196,7 @@ IpIntercept::IpfwInterception(int fd, const IPAddress &me, IPAddress &dst, int s
 }
 
 int
-IpIntercept::NatLookup(int fd, const IPAddress &me, const IPAddress &peer, IPAddress &client, IPAddress &dst)
+IpIntercept::NatLookup(int fd, const IpAddress &me, const IpAddress &peer, IpAddress &client, IpAddress &dst)
 {
 #if IPF_TRANSPARENT  /* --enable-ipf-transparent */
     client = me;
@@ -398,9 +398,9 @@ IpIntercept::NatLookup(int fd, const IPAddress &me, const IPAddress &peer, IPAdd
 }
 
 #if LINUX_TPROXY2
-IpIntercept::SetTproxy2OutgoingAddr(int fd, const IPAddress &src)
+IpIntercept::SetTproxy2OutgoingAddr(int fd, const IpAddress &src)
 {
-    IPAddress addr;
+    IpAddress addr;
     struct in_tproxy itp;
 
     src.GetInAddr(itp.v.addr.faddr);
index 5ce9400ec80222c748a71f8de46285944193921c..8e459a27ec98d74d269197338bbcdaf804268dbc 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef SQUID_IPINTERCEPTION_H
 #define SQUID_IPINTERCEPTION_H
 
-class IPAddress;
+class IpAddress;
 
 /* for time_t */
 #include "SquidTime.h"
@@ -27,12 +27,12 @@ public:
     ~IpIntercept() {};
 
     /** Perform NAT lookups */
-    int NatLookup(int fd, const IPAddress &me, const IPAddress &peer, IPAddress &client, IPAddress &dst);
+    int NatLookup(int fd, const IpAddress &me, const IpAddress &peer, IpAddress &client, IpAddress &dst);
 
 #if LINUX_TPROXY2
     // only relevant to TPROXY v2 connections.
     // which require the address be set specifically post-connect.
-    int SetTproxy2OutgoingAddr(int fd, const IPAddress &src);
+    int SetTproxy2OutgoingAddr(int fd, const IpAddress &src);
 #endif
 
     /**
@@ -87,7 +87,7 @@ private:
      \retval 0     Successfuly located the new address.
      \retval -1    An error occured during NAT lookups.
      */
-    int NetfilterInterception(int fd, const IPAddress &me, IPAddress &client, int silent);
+    int NetfilterInterception(int fd, const IpAddress &me, IpAddress &client, int silent);
 
     /**
      * perform Lookups on Netfilter fully-transparent interception targets (TPROXY).
@@ -96,7 +96,7 @@ private:
      \retval 0     Successfuly located the new address.
      \retval -1    An error occured during NAT lookups.
      */
-    int NetfilterTransparent(int fd, const IPAddress &me, IPAddress &dst, int silent);
+    int NetfilterTransparent(int fd, const IpAddress &me, IpAddress &dst, int silent);
 
     /**
      * perform Lookups on IPFW interception.
@@ -105,7 +105,7 @@ private:
      \retval 0     Successfuly located the new address.
      \retval -1    An error occured during NAT lookups.
      */
-    int IpfwInterception(int fd, const IPAddress &me, IPAddress &client, int silent);
+    int IpfwInterception(int fd, const IpAddress &me, IpAddress &client, int silent);
 
 
     int transparent_active;
index 46fae62f379c47d45f0cda4bd5a52bd79828ff12..e36db69f4b9897d9598344359add5546e7559b4f 100644 (file)
@@ -15,19 +15,18 @@ $(OBJS): $(top_srcdir)/include/version.h $(top_srcdir)/include/autoconf.h
 
 # IP Specific Configurations
 
-#EXTRA_PROGRAMS = \
-#      testIcmp
-
 noinst_LTLIBRARIES = libip.la
 
 libip_la_SOURCES = \
+       IpAddress.h \
+       IpAddress.cc \
        IpIntercept.h \
        IpIntercept.cc \
        QosConfig.h \
        QosConfig.cc
 
 
-check_PROGRAMS= testHeaders
+check_PROGRAMS= testHeaders testIpAddress
 TESTS= $(check_PROGRAMS)
 
 ## Special Universal .h dependency test script
@@ -39,3 +38,16 @@ testHeaders: $(top_srcdir)/src/ip/*.h
 testHeaders.c:
        touch testHeaders.c
 CLEANFILES += testHeaders.c
+
+
+testIpAddress_SOURCES= \
+       testIpAddress.cc \
+       testIpAddress.h
+nodist_testIpAddress_SOURCES= \
+       ../tests/testMain.cc
+testIpAddress_LDADD= \
+       libip.la \
+       -L$(top_builddir)/lib -lmiscutil \
+       @SQUID_CPPUNIT_LA@ \
+       @SQUID_CPPUNIT_LIBS@
+testIpAddress_LDFLAGS= $(LIBADD_DL)
index 3ce3687fd0584fd5ea83912f7f78a135473cbcd4..6a4d3530f91b759838eafa0d5487e03d2db18676 100644 (file)
@@ -3,7 +3,6 @@
 #if USE_ZPH_QOS
 
 #include "QosConfig.h"
-#include "Store.h"
 
 QosConfig::QosConfig() : 
        tos_local_hit(0),
@@ -42,28 +41,41 @@ QosConfig::parseConfigLine()
     }
 }
 
+/**
+ * NOTE: Due to the low-level nature of the library these
+ * objects are part of the dump function must be self-contained.
+ * which means no StoreEntry refrences. Just a basic char* buffer.
+ */
 void
-QosConfig::dumpConfigLine(StoreEntry * entry, const char *name) const
+QosConfig::dumpConfigLine(char *entry, const char *name) const
 {
-    storeAppendPrintf(entry, "%s", name);
+    char *p = entry;
+    snprintf(p, 10, "%s", name); // strlen("qos_flows ");
+    p += strlen(name);
 
     if (tos_local_hit >0) {
-        storeAppendPrintf(entry, " local-hit=%2x", tos_local_hit);
+        snprintf(p, 15, " local-hit=%2x", tos_local_hit);
+        p += 15;
     }
 
     if (tos_sibling_hit >0) {
-        storeAppendPrintf(entry, " sibling-hit=%2x", tos_sibling_hit);
+        snprintf(p, 17, " sibling-hit=%2x", tos_sibling_hit);
+        p += 17;
     }
     if (tos_parent_hit >0) {
-        storeAppendPrintf(entry, " parent-hit=%2x", tos_parent_hit);
+        snprintf(p, 16, " parent-hit=%2x", tos_parent_hit);
+        p += 16;
     }
     if (preserve_miss_tos != 0) {
-        storeAppendPrintf(entry, " disable-preserve-miss");
+        snprintf(p, 22, " disable-preserve-miss");
+        p += 22;
     }
     if (preserve_miss_tos && preserve_miss_tos_mask != 0) {
-        storeAppendPrintf(entry, " miss-mask=%2x", preserve_miss_tos_mask);
+        snprintf(p, 15, " miss-mask=%2x", preserve_miss_tos_mask);
+        p += 15;
     }
-    storeAppendPrintf(entry, "\n");
+    snprintf(p, 1, "\n");
+//    p += 1;
 }
 
 #endif /* USE_ZPH_QOS */
index 61d400a8d488237cdae14926f724ce65b72f692f..62294bf8c2e4e37ec29501564baf7e534dce5f7c 100644 (file)
@@ -5,8 +5,6 @@
 
 #if USE_ZPH_QOS
 
-class StoreEntry;
-
 class QosConfig
 {
 public:
@@ -21,13 +19,17 @@ public:
     ~QosConfig() {};
 
     void parseConfigLine();
-    void dumpConfigLine(StoreEntry *entry, const char *name) const;
+    void dumpConfigLine(char *entry, const char *name) const;
 };
 
 /* legacy parser access wrappers */
 #define parse_QosConfig(X)     (X)->parseConfigLine()
-#define dump_QosConfig(e,n,X)  (X).dumpConfigLine(e,n)
 #define free_QosConfig(X)
+#define dump_QosConfig(e,n,X) do { \
+               char temp[256]; /* random number. change as needed. max config line length. */ \
+               (X).dumpConfigLine(temp,n); \
+               storeAppendPrintf(e, "%s", temp); \
+       } while(0);
 
 #endif /* USE_ZPH_QOS */
 #endif /* SQUID_QOSCONFIG_H */
index dc7a666f6b190c6664b5a3ba3123906937f1833a..8cb2b863fa0303bb81e7d0d7e54abbedd2503915 100644 (file)
@@ -43,7 +43,7 @@ QosConfig::parseConfigLine()
 }
 
 void
-QosConfig::dumpConfigLine(StoreEntry * entry, const char *name) const
+QosConfig::dumpConfigLine(char *entry, const char *name) const
 {
     ; /* Not needed in stub */
 }
similarity index 92%
rename from lib/tests/testIPAddress.cc
rename to src/ip/testIpAddress.cc
index d442470b485d61520630dbf0f1aff57f49b6152f..8743519541a52810443965d7b29aad08ff19fe87 100644 (file)
@@ -7,16 +7,21 @@
 #include <netdb.h>
 #include <string>
 
-#include "testIPAddress.h"
-#include "IPAddress.h"
+#include "testIpAddress.h"
+#include "ip/IpAddress.h"
 
-CPPUNIT_TEST_SUITE_REGISTRATION( testIPAddress );
+CPPUNIT_TEST_SUITE_REGISTRATION( testIpAddress );
+
+/* so that we don't break POD dependency just for the test */
+struct timeval current_time;
+double current_dtime;
+time_t squid_curtime = 0;
 
 
 void
-testIPAddress::testDefaults()
+testIpAddress::testDefaults()
 {
-    IPAddress anIPA;
+    IpAddress anIPA;
 
     /* test stored values */
     CPPUNIT_ASSERT( anIPA.IsAnyAddr() );
@@ -32,7 +37,7 @@ testIPAddress::testDefaults()
 }
 
 void
-testIPAddress::testInAddrConstructor()
+testIpAddress::testInAddrConstructor()
 {
     struct in_addr inval;
     struct in_addr outval;
@@ -40,7 +45,7 @@ testIPAddress::testInAddrConstructor()
     inval.s_addr = htonl(0xC0A8640C);
     outval.s_addr = htonl(0x00000000);
 
-    IPAddress anIPA(inval);
+    IpAddress anIPA(inval);
 
     /* test stored values */
     CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );
@@ -55,7 +60,7 @@ testIPAddress::testInAddrConstructor()
 
 #if USE_IPV6
 void
-testIPAddress::testInAddr6Constructor()
+testIpAddress::testInAddr6Constructor()
 {
     struct in6_addr inval;
     struct in6_addr outval = IN6ADDR_ANY_INIT;
@@ -65,7 +70,7 @@ testIPAddress::testInAddr6Constructor()
     inval.s6_addr32[2] = htonl(0xFFFFFFFF);
     inval.s6_addr32[3] = htonl(0xFFFFFFFF);
 
-    IPAddress anIPA(inval);
+    IpAddress anIPA(inval);
 
     /* test stored values */
     CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );
@@ -80,7 +85,7 @@ testIPAddress::testInAddr6Constructor()
 #endif
 
 void
-testIPAddress::testSockAddrConstructor()
+testIpAddress::testSockAddrConstructor()
 {
     struct sockaddr_in insock;
     struct sockaddr_in outsock;
@@ -95,7 +100,7 @@ testIPAddress::testSockAddrConstructor()
     insock.sin_len = sizeof(struct sockaddr_in);
 #endif
 
-    IPAddress anIPA((const struct sockaddr_in)insock);
+    IpAddress anIPA((const struct sockaddr_in)insock);
 
     /* test stored values */
     CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );
@@ -110,7 +115,7 @@ testIPAddress::testSockAddrConstructor()
 
 #if USE_IPV6
 void
-testIPAddress::testSockAddr6Constructor()
+testIpAddress::testSockAddr6Constructor()
 {
     struct sockaddr_in6 insock;
     struct sockaddr_in6 outsock;
@@ -128,7 +133,7 @@ testIPAddress::testSockAddr6Constructor()
     insock.sin6_len = sizeof(struct sockaddr_in6);
 #endif
 
-    IPAddress anIPA((const struct sockaddr_in6)insock);
+    IpAddress anIPA((const struct sockaddr_in6)insock);
 
     /* test stored values */
     CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );
@@ -144,7 +149,7 @@ testIPAddress::testSockAddr6Constructor()
 
 
 void
-testIPAddress::testCopyConstructor()
+testIpAddress::testCopyConstructor()
 {
     struct sockaddr_in insock;
     struct sockaddr_in outsock;
@@ -159,8 +164,8 @@ testIPAddress::testCopyConstructor()
     insock.sin_len = sizeof(struct sockaddr_in);
 #endif
 
-    IPAddress inIPA(insock);
-    IPAddress outIPA(inIPA);
+    IpAddress inIPA(insock);
+    IpAddress outIPA(inIPA);
 
 
     /* test stored values */
@@ -175,7 +180,7 @@ testIPAddress::testCopyConstructor()
 }
 
 void
-testIPAddress::testHostentConstructor()
+testIpAddress::testHostentConstructor()
 {
     struct hostent *hp = NULL;
     struct in_addr outval;
@@ -186,7 +191,7 @@ testIPAddress::testHostentConstructor()
     hp = gethostbyname("192.168.100.12");
     CPPUNIT_ASSERT( hp != NULL /* gethostbyname failure.*/ );
 
-    IPAddress anIPA(*hp);
+    IpAddress anIPA(*hp);
 
     /* test stored values */
     CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );
@@ -200,14 +205,14 @@ testIPAddress::testHostentConstructor()
 }
 
 void
-testIPAddress::testStringConstructor()
+testIpAddress::testStringConstructor()
 {
     struct in_addr outval;
     struct in_addr expectval;
 
     expectval.s_addr = htonl(0xC0A8640C);
 
-    IPAddress anIPA = "192.168.100.12";
+    IpAddress anIPA = "192.168.100.12";
 
     /* test stored values */
     CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );
@@ -228,7 +233,7 @@ testIPAddress::testStringConstructor()
     expectv6.s6_addr32[2] = htonl(0x00000000);
     expectv6.s6_addr32[3] = htonl(0x00000045);
 
-    IPAddress bnIPA = "2000:800::45";
+    IpAddress bnIPA = "2000:800::45";
 
     /* test stored values */
     CPPUNIT_ASSERT( !bnIPA.IsAnyAddr() );
@@ -241,7 +246,7 @@ testIPAddress::testStringConstructor()
     CPPUNIT_ASSERT( memcmp( &expectv6, &outval6, sizeof(struct in6_addr)) == 0 );
 
     /* test IPv6 as an old netmask format. This is invalid but sometimes use. */
-    IPAddress cnIPA = "ffff:ffff:fff0::";
+    IpAddress cnIPA = "ffff:ffff:fff0::";
 
     expectv6.s6_addr32[0] = htonl(0xFFFFFFFF);
     expectv6.s6_addr32[1] = htonl(0xFFF00000);
@@ -261,9 +266,9 @@ testIPAddress::testStringConstructor()
 }
 
 void
-testIPAddress::testSetEmpty()
+testIpAddress::testSetEmpty()
 {
-    IPAddress anIPA;
+    IpAddress anIPA;
     struct in_addr inval;
 
     inval.s_addr = htonl(0xC0A8640C);
@@ -294,10 +299,10 @@ testIPAddress::testSetEmpty()
 }
 
 void
-testIPAddress::testBooleans()
+testIpAddress::testBooleans()
 {
-    IPAddress lhsIPA;
-    IPAddress rhsIPA;
+    IpAddress lhsIPA;
+    IpAddress rhsIPA;
     struct in_addr valLow;
     struct in_addr valHigh;
 
@@ -340,11 +345,11 @@ testIPAddress::testBooleans()
 }
 
 void
-testIPAddress::testNtoA()
+testIpAddress::testNtoA()
 {
     struct in_addr inval;
     char buf[MAX_IPSTRLEN];
-    IPAddress anIPA;
+    IpAddress anIPA;
 
     anIPA.SetAnyAddr();
 
@@ -372,7 +377,7 @@ testIPAddress::testNtoA()
 }
 
 void
-testIPAddress::testToURL_fromInAddr()
+testIpAddress::testToURL_fromInAddr()
 {
     char buf[MAX_IPSTRLEN];
     buf[0] = '\0';
@@ -380,7 +385,7 @@ testIPAddress::testToURL_fromInAddr()
 
     inval.s_addr = htonl(0xC0A8640C);
 
-    IPAddress anIPA(inval);
+    IpAddress anIPA(inval);
 
     /* test values */
     anIPA.ToURL(buf,MAX_IPSTRLEN);
@@ -396,7 +401,7 @@ testIPAddress::testToURL_fromInAddr()
     ip6val.s6_addr32[2] = htonl(0xFFFFFFFF);
     ip6val.s6_addr32[3] = htonl(0xFFFFFFFF);
 
-    IPAddress bnIPA(ip6val);
+    IpAddress bnIPA(ip6val);
 
     bnIPA.ToURL(buf,MAX_IPSTRLEN);
     CPPUNIT_ASSERT( memcmp("[c0a8:640c:ffff:ffff:ffff:ffff:ffff:ffff]", buf, 41) == 0 );
@@ -405,7 +410,7 @@ testIPAddress::testToURL_fromInAddr()
 }
 
 void
-testIPAddress::testToURL_fromSockAddr()
+testIpAddress::testToURL_fromSockAddr()
 {
     struct sockaddr_in sock;
     sock.sin_addr.s_addr = htonl(0xC0A8640C);
@@ -415,7 +420,7 @@ testIPAddress::testToURL_fromSockAddr()
     sock.sin_len = sizeof(struct sockaddr_in);
 #endif
 
-    IPAddress anIPA(sock);
+    IpAddress anIPA(sock);
     char buf[MAX_IPSTRLEN];
 
     /* test values */
@@ -437,7 +442,7 @@ testIPAddress::testToURL_fromSockAddr()
     ip6val.sin6_len = sizeof(struct sockaddr_in6);
 #endif
 
-    IPAddress bnIPA(ip6val);
+    IpAddress bnIPA(ip6val);
 
     bnIPA.ToURL(buf,MAX_IPSTRLEN);
     CPPUNIT_ASSERT( memcmp("[c0a8:640c:ffff:ffff:ffff:ffff:ffff:ffff]:80", buf, 44) == 0 );
@@ -447,14 +452,14 @@ testIPAddress::testToURL_fromSockAddr()
 }
 
 void
-testIPAddress::testGetReverseString()
+testIpAddress::testGetReverseString()
 {
     char buf[MAX_IPSTRLEN];
 
     struct in_addr ipv4val;
     ipv4val.s_addr = htonl(0xC0A8640C);
 
-    IPAddress v4IPA(ipv4val);
+    IpAddress v4IPA(ipv4val);
 
     /* test IPv4 output */
     v4IPA.GetReverseString(buf);
@@ -475,7 +480,7 @@ testIPAddress::testGetReverseString()
     ip6val.s6_addr32[2] = htonl(0xFFFFFFFF);
     ip6val.s6_addr32[3] = htonl(0xFFFFFFFF);
 
-    IPAddress v6IPA(ip6val);
+    IpAddress v6IPA(ip6val);
 
     /* test IPv6 output */
     v6IPA.GetReverseString(buf);
@@ -486,11 +491,11 @@ testIPAddress::testGetReverseString()
 }
 
 void
-testIPAddress::testMasking()
+testIpAddress::testMasking()
 {
     char buf[MAX_IPSTRLEN];
-    IPAddress anIPA;
-    IPAddress maskIPA;
+    IpAddress anIPA;
+    IpAddress maskIPA;
 
     /* Test Basic CIDR Routine */
     anIPA.SetAnyAddr();
@@ -529,7 +534,7 @@ testIPAddress::testMasking()
     CPPUNIT_ASSERT( memcmp("ffff:ffff:ffff:ffff:ffff::", buf, 26) == 0 );
 #endif
 
-    /* Test Network Bitmask from IPAddress */
+    /* Test Network Bitmask from IpAddress */
     anIPA.SetNoAddr();
     maskIPA = "255.255.240.0";
     CPPUNIT_ASSERT_EQUAL( 20 , maskIPA.GetCIDR() );
@@ -580,7 +585,7 @@ testIPAddress::testMasking()
 }
 
 void
-testIPAddress::testAddrInfo()
+testIpAddress::testAddrInfo()
 {
     struct addrinfo *expect;
     struct addrinfo *ipval = NULL;
@@ -590,7 +595,7 @@ testIPAddress::testAddrInfo()
 
     hints.ai_flags = AI_NUMERICHOST;
 
-    IPAddress anIP = "127.0.0.1";
+    IpAddress anIP = "127.0.0.1";
 
     /* assert this just to check that getaddrinfo is working properly */
     CPPUNIT_ASSERT( xgetaddrinfo("127.0.0.1", NULL, &hints, &expect ) == 0 );
@@ -677,7 +682,7 @@ testIPAddress::testAddrInfo()
 }
 
 void
-testIPAddress::testBugNullingDisplay()
+testIpAddress::testBugNullingDisplay()
 {
     // Weird Bug: address set to empty during string conversion somewhere.
     // initial string gets created and returned OK.
@@ -692,7 +697,7 @@ testIPAddress::testBugNullingDisplay()
 
     expectval.s_addr = htonl(0xC0A8640C);
 
-    IPAddress anIPA = "192.168.100.12";
+    IpAddress anIPA = "192.168.100.12";
 
 
     /* test stored values */
similarity index 94%
rename from lib/tests/testIPAddress.h
rename to src/ip/testIpAddress.h
index 740aca095b10e057b4c94d4b43fe5406b955b718..a223686f2bc4108422a37498424dc3209af7c49f 100644 (file)
@@ -7,9 +7,9 @@
  * test the IP storage type
  */
 
-class testIPAddress : public CPPUNIT_NS::TestFixture
+class testIpAddress : public CPPUNIT_NS::TestFixture
 {
-    CPPUNIT_TEST_SUITE( testIPAddress );
+    CPPUNIT_TEST_SUITE( testIpAddress );
     CPPUNIT_TEST( testDefaults );
     CPPUNIT_TEST( testInAddrConstructor );
 #if USE_IPV6
index 83c755946592750487e240e11808b246ea22b975..a6248a529092d19d8ccf207230b8858830131708 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: ipc.cc,v 1.48 2008/02/13 00:01:47 rousskov Exp $
- *
  * DEBUG: section 54    Interprocess Communication
  * AUTHOR: Duane Wessels
  *
@@ -36,7 +33,7 @@
 #include "squid.h"
 #include "comm.h"
 #include "fde.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 static const char *hello_string = "hi there\n";
 #define HELLO_BUF_SZ 32
@@ -75,11 +72,11 @@ PutEnvironment()
 }
 
 pid_t
-ipcCreate(int type, const char *prog, const char *const args[], const char *name, IPAddress &local_addr, int *rfd, int *wfd, void **hIpc)
+ipcCreate(int type, const char *prog, const char *const args[], const char *name, IpAddress &local_addr, int *rfd, int *wfd, void **hIpc)
 {
     pid_t pid;
-    IPAddress ChS;
-    IPAddress PaS;
+    IpAddress ChS;
+    IpAddress PaS;
     struct addrinfo *AI = NULL;
     int crfd = -1;
     int prfd = -1;
index 174669d1845ddf74db9ce249493ac83a748933fc..aa9c31dc456d611de3f8ad7e3c754e6debeeea72 100644 (file)
@@ -47,7 +47,7 @@ struct ipc_params {
     int type;
     int crfd;
     int cwfd;
-    IPAddress local_addr;
+    IpAddress local_addr;
     struct addrinfo PS;
     const char *prog;
     char **args;
@@ -105,7 +105,7 @@ PutEnvironment()
 }
 
 pid_t
-ipcCreate(int type, const char *prog, const char *const args[], const char *name, IPAddress &local_addr, int *rfd, int *wfd, void **hIpc)
+ipcCreate(int type, const char *prog, const char *const args[], const char *name, IpAddress &local_addr, int *rfd, int *wfd, void **hIpc)
 {
     unsigned long thread;
 
@@ -115,7 +115,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name
     DWORD ecode = 0;
     pid_t pid;
 
-    IPAddress tmp_addr;
+    IpAddress tmp_addr;
     struct addrinfo *aiCS = NULL;
     struct addrinfo *aiPS = NULL;
 
@@ -252,7 +252,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name
         return ipcCloseAllFD(prfd, pwfd, crfd, cwfd);
     }
 
-    /* NP: tmp_addr was left with eiether empty or aiCS in IPAddress format */
+    /* NP: tmp_addr was left with eiether empty or aiCS in IpAddress format */
     if (comm_connect_addr(pwfd, tmp_addr) == COMM_ERROR) {
         CloseHandle((HANDLE) thread);
         return ipcCloseAllFD(prfd, pwfd, -1, -1);
@@ -377,8 +377,8 @@ ipc_thread_1(void *in_params)
     int prfd_ipc = -1, pwfd_ipc = -1, crfd_ipc = -1, cwfd_ipc = -1;
     char *prog = NULL, *buf1 = NULL;
 
-    IPAddress PS_ipc;
-    IPAddress CS_ipc;
+    IpAddress PS_ipc;
+    IpAddress CS_ipc;
     struct addrinfo *aiPS_ipc = NULL;
     struct addrinfo *aiCS_ipc = NULL;
 
@@ -388,8 +388,8 @@ ipc_thread_1(void *in_params)
     int cwfd = params->cwfd;
     char **args = params->args;
 
-    IPAddress PS = params->PS;
-    IPAddress local_addr = params->local_addr;
+    IpAddress PS = params->PS;
+    IpAddress local_addr = params->local_addr;
 
     buf1 = (char *)xcalloc(1, 8192);
     strcpy(buf1, params->prog);
index 4a57e2ef91f94aa8c9b800ecb6d3b46539be6947..5834fbae2e74a24155323e16721c54d469dbb170 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: ipcache.cc,v 1.269 2008/02/26 21:49:35 amosjeffries Exp $
- *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
  *
@@ -40,7 +37,7 @@
 #include "SquidTime.h"
 #include "Store.h"
 #include "wordlist.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 /**
  \defgroup IPCacheAPI IP Cache API
@@ -420,7 +417,7 @@ ipcacheParse(ipcache_entry *i, const char *inbuf)
     if (ipcount > 0) {
         int j, k;
 
-        i->addrs.in_addrs = (IPAddress *)xcalloc(ipcount, sizeof(IPAddress));
+        i->addrs.in_addrs = (IpAddress *)xcalloc(ipcount, sizeof(IpAddress));
         for (int l = 0; l < ipcount; l++)
             i->addrs.in_addrs[l].SetEmpty(); // perform same init actions as constructor would.
         i->addrs.bad_mask = (unsigned char *)xcalloc(ipcount, sizeof(unsigned char));
@@ -555,7 +552,7 @@ ipcacheParse(ipcache_entry *i, rfc1035_rr * answers, int nr, const char *error_m
         return 0;
     }
 
-    i->addrs.in_addrs = (IPAddress *)xcalloc(na, sizeof(IPAddress));
+    i->addrs.in_addrs = (IpAddress *)xcalloc(na, sizeof(IpAddress));
     for (int l = 0; l < na; l++)
         i->addrs.in_addrs[l].SetEmpty(); // perform same init actions as constructor would.
     i->addrs.bad_mask = (unsigned char *)xcalloc(na, sizeof(unsigned char));
@@ -780,8 +777,8 @@ ipcache_init(void)
     memset(&lru_list, '\0', sizeof(lru_list));
     memset(&static_addrs, '\0', sizeof(ipcache_addrs));
 
-    static_addrs.in_addrs = (IPAddress *)xcalloc(1, sizeof(IPAddress));
-    static_addrs.in_addrs->SetEmpty(); // properly setup the IPAddress!
+    static_addrs.in_addrs = (IpAddress *)xcalloc(1, sizeof(IpAddress));
+    static_addrs.in_addrs->SetEmpty(); // properly setup the IpAddress!
     static_addrs.bad_mask = (unsigned char *)xcalloc(1, sizeof(unsigned char));
     ipcache_high = (long) (((float) Config.ipcache.size *
                             (float) Config.ipcache.high) / (float) 100);
@@ -952,7 +949,7 @@ stat_ipcache_get(StoreEntry * sentry)
 
 #if DNS_CNAME
 /**
- * Takes two IPAddress arrays and merges them into a single array
+ * Takes two IpAddress arrays and merges them into a single array
  * which is allocated dynamically to fit the number of unique addresses
  *
  \param aaddrs One list to merge
@@ -963,22 +960,22 @@ stat_ipcache_get(StoreEntry * sentry)
  \param outlen Size of list out
  */
 void
-ipcacheMergeIPLists(const IPAddress *aaddrs, const int alen,
-                    const IPAddress *baddrs, const int blen,
-                    IPAddress **out, int &outlen )
+ipcacheMergeIPLists(const IpAddress *aaddrs, const int alen,
+                    const IpAddress *baddrs, const int blen,
+                    IpAddress **out, int &outlen )
 {
     int fc=0, t=0, c=0;
 
-    IPAddress const *ip4ptrs[255];
+    IpAddress const *ip4ptrs[255];
 #if USE_IPV6
-    IPAddress const *ip6ptrs[255];
+    IpAddress const *ip6ptrs[255];
 #endif
     int num_ip4 = 0;
     int num_ip6 = 0;
 
-    memset(ip4ptrs, 0, sizeof(IPAddress*)*255);
+    memset(ip4ptrs, 0, sizeof(IpAddress*)*255);
 #if USE_IPV6
-    memset(ip6ptrs, 0, sizeof(IPAddress*)*255);
+    memset(ip6ptrs, 0, sizeof(IpAddress*)*255);
 #endif
 
     // for each unique address in list A - grab ptr
@@ -1041,7 +1038,7 @@ ipcacheMergeIPLists(const IPAddress *aaddrs, const int alen,
     debugs(14, 5, "ipcacheMergeIPLists: Merge " << alen << "+" << blen << " into " << fc << " unique IPs.");
 
     // copy the old IPs into the new list buffer.
-    (*out) = (IPAddress*)xcalloc(fc, sizeof(IPAddress));
+    (*out) = (IpAddress*)xcalloc(fc, sizeof(IpAddress));
     outlen=0;
 
     assert(out != NULL);
@@ -1072,7 +1069,7 @@ ipcacheHandleCnameRecurse(const ipcache_addrs *addrs, void *cbdata)
 #if DNS_CNAME
     ipcache_entry *i = NULL;
     char *pname = NULL;
-    IPAddress *tmpbuf = NULL;
+    IpAddress *tmpbuf = NULL;
     int fc = 0;
     int ttl = 0;
     generic_cbdata* gcb = (generic_cbdata*)cbdata;
@@ -1208,7 +1205,7 @@ ipcache_addrs *
 ipcacheCheckNumeric(const char *name)
 {
 
-    IPAddress ip;
+    IpAddress ip;
     /* check if it's already a IP address in text form. */
 
     /* it may be IPv6-wrapped */
@@ -1311,7 +1308,7 @@ ipcacheCycleAddr(const char *name, ipcache_addrs * ia)
  \param addr   specific addres to be marked bad
  */
 void
-ipcacheMarkBadAddr(const char *name, IPAddress &addr)
+ipcacheMarkBadAddr(const char *name, IpAddress &addr)
 {
     ipcache_entry *i;
     ipcache_addrs *ia;
@@ -1346,7 +1343,7 @@ ipcacheMarkBadAddr(const char *name, IPAddress &addr)
 
 /// \ingroup IPCacheAPI
 void
-ipcacheMarkGoodAddr(const char *name, IPAddress &addr)
+ipcacheMarkGoodAddr(const char *name, IpAddress &addr)
 {
     ipcache_entry *i;
     ipcache_addrs *ia;
@@ -1429,7 +1426,7 @@ ipcacheAddEntryFromHosts(const char *name, const char *ipaddr)
 {
     ipcache_entry *i;
 
-    IPAddress ip;
+    IpAddress ip;
 
     if (!(ip = ipaddr)) {
 #if USE_IPV6
@@ -1461,7 +1458,7 @@ ipcacheAddEntryFromHosts(const char *name, const char *ipaddr)
     i->addrs.cur = 0;
     i->addrs.badcount = 0;
 
-    i->addrs.in_addrs = (IPAddress *)xcalloc(1, sizeof(IPAddress));
+    i->addrs.in_addrs = (IpAddress *)xcalloc(1, sizeof(IpAddress));
     i->addrs.bad_mask = (unsigned char *)xcalloc(1, sizeof(unsigned char));
     i->addrs.in_addrs[0] = ip;
     i->addrs.bad_mask[0] = FALSE;
index 265e89aa383e34a1ba95a2aba4533267df403cac..b984761fad9c077b242bf613ba85ce9408aed72d 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: neighbors.cc,v 1.353 2008/02/11 22:44:50 rousskov Exp $
- *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
  *
@@ -46,8 +43,8 @@
 #include "PeerSelectState.h"
 #include "SquidTime.h"
 #include "Store.h"
-#include "IPAddress.h"
 #include "icmp/net_db.h"
+#include "ip/IpAddress.h"
 
 /* count mcast group peers every 15 minutes */
 #define MCAST_COUNT_RATE 900
@@ -69,7 +66,7 @@ static void peerCountMcastPeersStart(void *data);
 static void peerCountMcastPeersSchedule(peer * p, time_t when);
 static IRCB peerCountHandleIcpReply;
 
-static void neighborIgnoreNonPeer(const IPAddress &, icp_opcode);
+static void neighborIgnoreNonPeer(const IpAddress &, icp_opcode);
 static OBJH neighborDumpPeers;
 static OBJH neighborDumpNonPeers;
 static void dump_peers(StoreEntry * sentry, peer * peers);
@@ -97,7 +94,7 @@ neighborTypeStr(const peer * p)
 
 
 peer *
-whichPeer(const IPAddress &from)
+whichPeer(const IpAddress &from)
 {
     int j;
 
@@ -554,7 +551,7 @@ neighborsRegisterWithCacheManager()
 void
 neighbors_init(void)
 {
-    IPAddress nul;
+    IpAddress nul;
     struct addrinfo *AI = NULL;
     struct servent *sep = NULL;
     const char *me = getMyHostname();
@@ -964,7 +961,7 @@ neighborCountIgnored(peer * p)
 static peer *non_peers = NULL;
 
 static void
-neighborIgnoreNonPeer(const IPAddress &from, icp_opcode opcode)
+neighborIgnoreNonPeer(const IpAddress &from, icp_opcode opcode)
 {
     peer *np;
 
@@ -1024,7 +1021,7 @@ ignoreMulticastReply(peer * p, MemObject * mem)
  */
 void
 
-neighborsUdpAck(const cache_key * key, icp_common_t * header, const IPAddress &from)
+neighborsUdpAck(const cache_key * key, icp_common_t * header, const IpAddress &from)
 {
     peer *p = NULL;
     StoreEntry *entry;
@@ -1384,7 +1381,7 @@ peerProbeConnect(peer * p)
     if (squid_curtime - p->stats.last_connect_probe == 0)
         return ret;/* don't probe to often */
 
-    IPAddress temp(getOutgoingAddr(NULL,p));
+    IpAddress temp(getOutgoingAddr(NULL,p));
 
     fd = comm_open(SOCK_STREAM, IPPROTO_TCP, temp, COMM_NONBLOCKING, p->host);
 
@@ -1760,7 +1757,7 @@ dump_peers(StoreEntry * sentry, peer * peers)
 
 #if USE_HTCP
 void
-neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const IPAddress &from)
+neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const IpAddress &from)
 {
     StoreEntry *e = Store::Root().get(key);
     MemObject *mem = NULL;
index 6d1790e2a0d1a0147970199eeb072ab682880bb2..223e8022efb3bff41eeb519342cdd9019744f9fb 100644 (file)
@@ -177,7 +177,7 @@ IdleConnList::timeout(int fd, void *data)
 /* ========== PconnPool PRIVATE FUNCTIONS ============================================ */
 
 const char *
-PconnPool::key(const char *host, u_short port, const char *domain, IPAddress &client_address)
+PconnPool::key(const char *host, u_short port, const char *domain, IpAddress &client_address)
 {
     LOCAL_ARRAY(char, buf, SQUIDHOSTNAMELEN * 3 + 10);
     char ntoabuf[MAX_IPSTRLEN];
@@ -243,7 +243,7 @@ PconnPool::PconnPool(const char *aDescr) : table(NULL), descr(aDescr)
 }
 
 void
-PconnPool::push(int fd, const char *host, u_short port, const char *domain, IPAddress &client_address)
+PconnPool::push(int fd, const char *host, u_short port, const char *domain, IpAddress &client_address)
 {
 
     IdleConnList *list;
@@ -289,7 +289,7 @@ PconnPool::push(int fd, const char *host, u_short port, const char *domain, IPAd
  * transactions create persistent connections but are not retriable.
  */
 int
-PconnPool::pop(const char *host, u_short port, const char *domain, IPAddress &client_address, bool isRetriable)
+PconnPool::pop(const char *host, u_short port, const char *domain, IpAddress &client_address, bool isRetriable)
 {
     const char * aKey = key(host, port, domain, client_address);
 
index 836c04e912aa1063aef988de10236aa2f40628cd..60df8551a4912f46bab7d9e02c479b8f59b52bc6 100644 (file)
@@ -57,7 +57,7 @@ private:
 };
 
 
-class IPAddress;
+class IpAddress;
 class StoreEntry;
 class IdleConnLimit;
 
@@ -72,8 +72,8 @@ public:
     PconnPool(const char *);
 
     void moduleInit();
-    void push(int fd, const char *host, u_short port, const char *domain, IPAddress &client_address);
-    int pop(const char *host, u_short port, const char *domain, IPAddress &client_address, bool retriable);
+    void push(int fd, const char *host, u_short port, const char *domain, IpAddress &client_address);
+    int pop(const char *host, u_short port, const char *domain, IpAddress &client_address, bool retriable);
     void count(int uses);
     void dumpHist(StoreEntry *e);
     void dumpHash(StoreEntry *e);
@@ -81,7 +81,7 @@ public:
 
 private:
 
-    static const char *key(const char *host, u_short port, const char *domain, IPAddress &client_address);
+    static const char *key(const char *host, u_short port, const char *domain, IpAddress &client_address);
 
     int hist[PCONN_HIST_SZ];
     hash_table *table;
index 0193b48c8f3bd96c0d83e335ae6bafa7cf650213..57677f267ba0bc41c2ebf57b2fe719b48053b161 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * $Id: protos.h,v 1.557 2008/02/26 21:49:35 amosjeffries Exp $
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
@@ -37,7 +34,7 @@
  */
 #include "Packer.h"
 /* for routines still in this file that take CacheManager parameters */
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 /* for parameters that still need these */
 #include "enums.h"
 /* some parameters stil need this */
@@ -76,20 +73,20 @@ SQUIDCEXTERN void parse_wordlist(wordlist ** list);
 SQUIDCEXTERN void requirePathnameExists(const char *name, const char *path);
 SQUIDCEXTERN void parse_time_t(time_t * var);
 
-SQUIDCEXTERN void parse_IPAddress_list_token(IPAddress_list **, char *);
+SQUIDCEXTERN void parse_IpAddress_list_token(IpAddress_list **, char *);
 
 
 /* client_side.c - FD related client side routines */
 
 SQUIDCEXTERN void clientdbInit(void);
 
-SQUIDCEXTERN void clientdbUpdate(const IPAddress &, log_type, protocol_t, size_t);
+SQUIDCEXTERN void clientdbUpdate(const IpAddress &, log_type, protocol_t, size_t);
 
-SQUIDCEXTERN int clientdbCutoffDenied(const IPAddress &);
+SQUIDCEXTERN int clientdbCutoffDenied(const IpAddress &);
 SQUIDCEXTERN void clientdbDump(StoreEntry *);
 SQUIDCEXTERN void clientdbFreeMemory(void);
 
-SQUIDCEXTERN int clientdbEstablished(const IPAddress &, int);
+SQUIDCEXTERN int clientdbEstablished(const IpAddress &, int);
 SQUIDCEXTERN void clientOpenListenSockets(void);
 SQUIDCEXTERN void clientHttpConnectionsClose(void);
 SQUIDCEXTERN void httpRequestFree(void *);
@@ -142,7 +139,7 @@ SQUIDCEXTERN void idnsInit(void);
 SQUIDCEXTERN void idnsShutdown(void);
 SQUIDCEXTERN void idnsALookup(const char *, IDNSCB *, void *);
 
-SQUIDCEXTERN void idnsPTRLookup(const IPAddress &, IDNSCB *, void *);
+SQUIDCEXTERN void idnsPTRLookup(const IpAddress &, IDNSCB *, void *);
 
 SQUIDCEXTERN void fd_close(int fd);
 SQUIDCEXTERN void fd_open(int fd, unsigned int type, const char *);
@@ -161,14 +158,14 @@ SQUIDCEXTERN void file_map_bit_reset(fileMap *, int);
 SQUIDCEXTERN void filemapFreeMemory(fileMap *);
 
 
-SQUIDCEXTERN void fqdncache_nbgethostbyaddr(IPAddress &, FQDNH *, void *);
+SQUIDCEXTERN void fqdncache_nbgethostbyaddr(IpAddress &, FQDNH *, void *);
 
-SQUIDCEXTERN const char *fqdncache_gethostbyaddr(IPAddress &, int flags);
+SQUIDCEXTERN const char *fqdncache_gethostbyaddr(IpAddress &, int flags);
 SQUIDCEXTERN void fqdncache_init(void);
 SQUIDCEXTERN void fqdnStats(StoreEntry *);
 SQUIDCEXTERN void fqdncacheReleaseInvalid(const char *);
 
-SQUIDCEXTERN const char *fqdnFromAddr(IPAddress &);
+SQUIDCEXTERN const char *fqdnFromAddr(IpAddress &);
 SQUIDCEXTERN int fqdncacheQueueDrain(void);
 SQUIDCEXTERN void fqdncacheFreeMemory(void);
 SQUIDCEXTERN void fqdncache_restart(void);
@@ -298,10 +295,10 @@ SQUIDCEXTERN void snmpConnectionShutdown(void);
 SQUIDCEXTERN void snmpConnectionClose(void);
 SQUIDCEXTERN void snmpDebugOid(int lvl, oid * Name, snint Len);
 
-SQUIDCEXTERN void addr2oid(IPAddress &addr, oid *Dest);
-SQUIDCEXTERN void oid2addr(oid *Dest, IPAddress &addr, u_int code);
+SQUIDCEXTERN void addr2oid(IpAddress &addr, oid *Dest);
+SQUIDCEXTERN void oid2addr(oid *Dest, IpAddress &addr, u_int code);
 
-SQUIDCEXTERN IPAddress *client_entry(IPAddress *current);
+SQUIDCEXTERN IpAddress *client_entry(IpAddress *current);
 SQUIDCEXTERN variable_list *snmp_basicFn(variable_list *, snint *);
 SQUIDCEXTERN variable_list *snmp_confFn(variable_list *, snint *);
 SQUIDCEXTERN variable_list *snmp_sysFn(variable_list *, snint *);
@@ -342,9 +339,9 @@ SQUIDCEXTERN void ipcache_init(void);
 SQUIDCEXTERN void stat_ipcache_get(StoreEntry *);
 SQUIDCEXTERN void ipcacheCycleAddr(const char *name, ipcache_addrs *);
 
-SQUIDCEXTERN void ipcacheMarkBadAddr(const char *name, IPAddress &);
+SQUIDCEXTERN void ipcacheMarkBadAddr(const char *name, IpAddress &);
 
-SQUIDCEXTERN void ipcacheMarkGoodAddr(const char *name, IPAddress &);
+SQUIDCEXTERN void ipcacheMarkGoodAddr(const char *name, IpAddress &);
 SQUIDCEXTERN void ipcacheFreeMemory(void);
 SQUIDCEXTERN ipcache_addrs *ipcacheCheckNumeric(const char *name);
 SQUIDCEXTERN void ipcache_restart(void);
@@ -384,7 +381,7 @@ SQUIDCEXTERN int neighborsUdpPing(HttpRequest *,
                                   int *timeout);
 SQUIDCEXTERN void neighborAddAcl(const char *, const char *);
 
-SQUIDCEXTERN void neighborsUdpAck(const cache_key *, icp_common_t *, const IPAddress &);
+SQUIDCEXTERN void neighborsUdpAck(const cache_key *, icp_common_t *, const IpAddress &);
 SQUIDCEXTERN void neighborAdd(const char *, const char *, int, int, int, int, int);
 SQUIDCEXTERN void neighbors_init(void);
 #if USE_HTCP
@@ -411,7 +408,7 @@ SQUIDCEXTERN void peerConnectSucceded(peer *);
 SQUIDCEXTERN void dump_peer_options(StoreEntry *, peer *);
 SQUIDCEXTERN int peerHTTPOkay(const peer *, HttpRequest *);
 
-SQUIDCEXTERN peer *whichPeer(const IPAddress &from);
+SQUIDCEXTERN peer *whichPeer(const IpAddress &from);
 
 SQUIDCEXTERN void peerSelect(HttpRequest *, StoreEntry *, PSC *, void *data);
 SQUIDCEXTERN void peerSelectInit(void);
@@ -423,7 +420,7 @@ SQUIDCEXTERN void peerDigestNeeded(PeerDigest * pd);
 SQUIDCEXTERN void peerDigestNotePeerGone(PeerDigest * pd);
 SQUIDCEXTERN void peerDigestStatsReport(const PeerDigest * pd, StoreEntry * e);
 
-extern IPAddress getOutgoingAddr(HttpRequest * request, struct peer *dst_peer);
+extern IpAddress getOutgoingAddr(HttpRequest * request, struct peer *dst_peer);
 unsigned long getOutgoingTOS(HttpRequest * request);
 
 SQUIDCEXTERN void urnStart(HttpRequest *, StoreEntry *);
@@ -672,7 +669,7 @@ SQUIDCEXTERN pid_t ipcCreate(int type,
                              const char *prog,
                              const char *const args[],
                              const char *name,
-                             IPAddress &local_addr,
+                             IpAddress &local_addr,
                              int *rfd,
                              int *wfd,
                              void **hIpc);
index db2c006ced84775953e736aa14d205565727f7b4..8aaa2a0250bbbd36fa39b2434ff2269afb3b2298 100644 (file)
@@ -48,7 +48,7 @@ typedef struct {
     void *data;
     char *orig_url;
 
-    IPAddress client_addr;
+    IpAddress client_addr;
     const char *client_ident;
     const char *method_s;
     RH *handler;
index 8f11c92950857d8f9d9e63bbf4c96969ce7664d4..860e043faa2a1cc3ea0a875a52aeaaba6cc9d7bd 100644 (file)
@@ -60,7 +60,7 @@ send_announce(const ipcache_addrs * ia, void *junk)
     LOCAL_ARRAY(char, tbuf, 256);
     LOCAL_ARRAY(char, sndbuf, BUFSIZ);
 
-    IPAddress S;
+    IpAddress S;
     char *host = Config.Announce.host;
     char *file = NULL;
     u_short port = Config.Announce.port;
index d77edb6b0e840cc55982aae81d6252d01c9b34a7..a356020d2500e8c5e08e7a08521ab9d910be2ac8 100644 (file)
@@ -199,7 +199,7 @@ snmp_meshPtblFn(variable_list * Var, snint * ErrP)
 {
     variable_list *Answer = NULL;
 
-    IPAddress laddr;
+    IpAddress laddr;
     char *cp = NULL;
     peer *p = NULL;
     int cnt = 0;
index 05f4aa89920d129afa0fbfa41a5c53723cc8b194..71cd059529b2fa3303e72f910256afa4b61a3459 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: snmp_core.cc,v 1.82 2008/01/22 21:07:19 rousskov Exp $
- *
  * DEBUG: section 49    SNMP support
  * AUTHOR: Glenn Chisholm
  *
 #include "comm.h"
 #include "cache_snmp.h"
 #include "ACLChecklist.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 #define SNMP_REQUEST_SIZE 4096
 #define MAX_PROTOSTAT 5
 
-IPAddress theOutSNMPAddr;
+IpAddress theOutSNMPAddr;
 
 typedef struct _mib_tree_entry mib_tree_entry;
 typedef oid *(instance_Fn) (oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
@@ -482,7 +480,7 @@ void
 snmpHandleUdp(int sock, void *not_used)
 {
     LOCAL_ARRAY(char, buf, SNMP_REQUEST_SIZE);
-    IPAddress from;
+    IpAddress from;
     snmp_request_t *snmp_rq;
     int len;
 
@@ -870,8 +868,8 @@ static oid *
 client_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn)
 {
     oid *instance = NULL;
-    IPAddress laddr;
-    IPAddress *aux;
+    IpAddress laddr;
+    IpAddress *aux;
     int size = 0;
     int newshift = 0;
 
@@ -1105,7 +1103,7 @@ snmpSnmplibDebug(int lvl, char *buf)
    oid == 32.1.50.239.162.33.251.20.50.0.0.0.0.0.0.0.0.0.1
 */
 void
-addr2oid(IPAddress &addr, oid * Dest)
+addr2oid(IpAddress &addr, oid * Dest)
 {
     u_int i ;
     u_char *cp = NULL;
@@ -1145,7 +1143,7 @@ addr2oid(IPAddress &addr, oid * Dest)
    IPv6 adress : 20:01:32:ef:a2:21:fb:32:00:00:00:00:00:00:00:00:OO:01
 */
 void
-oid2addr(oid * id, IPAddress &addr, u_int size)
+oid2addr(oid * id, IpAddress &addr, u_int size)
 {
     struct in_addr iaddr;
     u_int i;
index bf0ae1b0431fe8cf11f26b22b2dcf22d74ded559..ea015a78390271b0ab43f00923fa7acc13350fa0 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: squid.h,v 1.272 2008/02/26 21:49:35 amosjeffries Exp $
- *
  * AUTHOR: Duane Wessels
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -377,7 +374,7 @@ extern "C"
 #include "profiling.h"
 #include "MemPool.h"
 
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 #if !HAVE_TEMPNAM
 #include "tempnam.h"
index 5d3d1df27afa820ba29f98459753b7a08724d60a..d64ba223fb46e0a682491df55b2c7de5e457d2eb 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * $Id: structs.h,v 1.575 2008/02/11 22:28:47 rousskov Exp $
- *
- *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *
@@ -73,7 +70,7 @@ struct _snmp_request_t {
     long reqid;
     int outlen;
 
-    IPAddress from;
+    IpAddress from;
 
     struct snmp_pdu *PDU;
     ACLChecklist *acl_checklist;
@@ -90,7 +87,7 @@ struct acl_address {
     acl_address *next;
     ACLList *aclList;
 
-    IPAddress addr;
+    IpAddress addr;
 };
 
 struct acl_tos {
@@ -223,18 +220,18 @@ struct SquidConfig {
 
     struct {
 
-        IPAddress router;
+        IpAddress router;
 
-        IPAddress address;
+        IpAddress address;
         int version;
     } Wccp;
 #endif
 #if USE_WCCPv2
 
     struct {
-        IPAddress_list *router;
+        IpAddress_list *router;
 
-        IPAddress address;
+        IpAddress address;
         int forwarding_method;
         int return_method;
         int assignment_method;
@@ -336,17 +333,17 @@ struct SquidConfig {
 
     struct {
 
-        IPAddress udp_incoming;
+        IpAddress udp_incoming;
 
-        IPAddress udp_outgoing;
+        IpAddress udp_outgoing;
 #if SQUID_SNMP
 
-        IPAddress snmp_incoming;
+        IpAddress snmp_incoming;
 
-        IPAddress snmp_outgoing;
+        IpAddress snmp_outgoing;
 #endif
         /* FIXME INET6 : this should really be a CIDR value */
-        IPAddress client_netmask;
+        IpAddress client_netmask;
     } Addrs;
     size_t tcpRcvBufsz;
     size_t udpMaxHitObjsz;
@@ -550,7 +547,7 @@ struct SquidConfig {
 
     struct {
 
-        IPAddress addr;
+        IpAddress addr;
         int ttl;
         unsigned short port;
         char *encode_key;
@@ -774,7 +771,7 @@ struct _http_state_flags {
 };
 
 struct _ipcache_addrs {
-    IPAddress *in_addrs;
+    IpAddress *in_addrs;
     unsigned char *bad_mask;
     unsigned char count;
     unsigned char cur;
@@ -816,7 +813,7 @@ struct peer {
     char *host;
     peer_t type;
 
-    IPAddress in_addr;
+    IpAddress in_addr;
 
     struct {
         int pings_sent;
@@ -906,7 +903,7 @@ struct peer {
 
     int tcp_up;                        /* 0 if a connect() fails */
 
-    IPAddress addresses[10];
+    IpAddress addresses[10];
     int n_addresses;
     int rr_count;
     peer *next;
@@ -1263,7 +1260,7 @@ struct _HttpHeaderStat {
 struct _ClientInfo {
     hash_link hash;            /* must be first */
 
-    IPAddress addr;
+    IpAddress addr;
 
     struct {
         int result_hist[LOG_TYPE_MAX];
index 3a463b31d9f4e3277a0dc1ef277bc1725405f337..4059701545f7a8a31de975cab2428e60e2f174bf 100644 (file)
@@ -133,7 +133,7 @@ commUnsetNonBlocking(int fd)
 /* bah, cheating on stub count */
 
 pid_t
-ipcCreate(int type, const char *prog, const char *const args[], const char *name, IPAddress &local_addr, int *rfd, int *wfd, void **hIpc)
+ipcCreate(int type, const char *prog, const char *const args[], const char *name, IpAddress &local_addr, int *rfd, int *wfd, void **hIpc)
 {
     fatal ("Not implemented");
     return -1;
index 293ab9a8bc4eb316565737241d16a005c07e92f5..a60fc32ba2920f966d60cae4d29ecdda60c41b00 100644 (file)
@@ -595,7 +595,7 @@ getMyHostname(void)
     LOCAL_ARRAY(char, host, SQUIDHOSTNAMELEN + 1);
     static int present = 0;
     struct addrinfo *AI = NULL;
-    IPAddress sa;
+    IpAddress sa;
 
     if (Config.visibleHostname != NULL)
         return Config.visibleHostname;
index 18cc3626f1ffa3b53b2b14d7548997702f093e78..6f239eedabfdb5742cbbf57b365efc35bed130c8 100644 (file)
@@ -637,7 +637,7 @@ tunnelStart(ClientHttpRequest * http, int64_t * size_ptr, int *status_ptr)
     statCounter.server.all.requests++;
     statCounter.server.other.requests++;
     /* Create socket. */
-    IPAddress temp = getOutgoingAddr(request,NULL);
+    IpAddress temp = getOutgoingAddr(request,NULL);
     sock = comm_openex(SOCK_STREAM,
                        IPPROTO_TCP,
                        temp,
index e5fedb9ef98baa51e8ccac166210958cc798d420..1d7f9504dccee39656173969bc167bc77c24d7d8 100644 (file)
@@ -192,7 +192,7 @@ void
 unlinkdInit(void)
 {
     const char *args[2];
-    IPAddress localhost;
+    IpAddress localhost;
 
     args[0] = "(unlinkd)";
     args[1] = NULL;
index cde240dac76f82423da54deffd24557c2cd3cb27..1adafc1fe62c30359bdc64b6f1260d54bec19dae 100644 (file)
@@ -59,7 +59,7 @@ struct wccp_here_i_am_t {
 };
 
 struct wccp_cache_entry_t {
-    IPAddress ip_addr;
+    IpAddress ip_addr;
     int revision;
     char hash[WCCP_HASH_SIZE];
     int reserved;
@@ -91,7 +91,7 @@ static int last_id;
 static int last_assign_buckets_change;
 static unsigned int number_caches;
 
-static IPAddress local_ip;
+static IpAddress local_ip;
 
 static PF wccpHandleUdp;
 static int wccpLowestIP(void);
@@ -203,7 +203,7 @@ static void
 wccpHandleUdp(int sock, void *not_used)
 {
 
-    IPAddress from;
+    IpAddress from;
     int len;
 
     debugs(80, 6, "wccpHandleUdp: Called.");
index 97587f7d13f153b13880fd4c1155d6f9f838102a..bb34d448044a84b70406faa1484802392883fe10 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: wccp2.cc,v 1.23 2008/02/09 03:48:05 swilton Exp $
- *
  * DEBUG: section 80    WCCP Support
  * AUTHOR: Steven Wilton
  *
@@ -39,7 +36,7 @@
 #include "Parsing.h"
 #include "Store.h"
 #include "SwapDir.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 #if USE_WCCPv2
 #if HAVE_NETDB_H
@@ -630,7 +627,7 @@ wccp2_check_security(struct wccp2_service_list_t *srv, char *security, char *pac
 void
 wccp2Init(void)
 {
-    IPAddress_list *s;
+    IpAddress_list *s;
     char *ptr;
     uint32_t service_flags;
 
@@ -1142,7 +1139,7 @@ wccp2HandleUdp(int sock, void *not_used)
     commSetSelect(sock, COMM_SELECT_READ, wccp2HandleUdp, NULL, 0);
 
     /* FIXME INET6 : drop conversion boundary */
-    IPAddress from_tmp;
+    IpAddress from_tmp;
 
     len = comm_udp_recvfrom(sock,
                             &wccp2_i_see_you,
@@ -1503,7 +1500,7 @@ wccp2HereIam(void *voidnotused)
 
     struct wccp2_mask_identity_info_t *wccp2_mask_identity_info_ptr;
 
-    IPAddress router;
+    IpAddress router;
 
     debugs(80, 6, "wccp2HereIam: Called");
 
@@ -1943,7 +1940,7 @@ wccp2AssignBuckets(void *voidnotused)
 
                 if (wccp2_numrouters > 1) {
                     /* FIXME INET6 : drop temp conversion */
-                    IPAddress tmp_rtr(router);
+                    IpAddress tmp_rtr(router);
                     comm_udp_sendto(theWccp2Connection,
                                     tmp_rtr,
                                     &wccp_packet,
index 9e437f0e5c1f2a6de7bac5c284ae15e40193d9cb..caf1af7ceae4de2a80199a452c57233bb07332d4 100644 (file)
@@ -55,9 +55,9 @@ int WIN32_pipe(int handles[2])
     int new_socket;
     fde *F = NULL;
 
-    IPAddress localhost;
-    IPAddress handle0;
-    IPAddress handle1;
+    IpAddress localhost;
+    IpAddress handle0;
+    IpAddress handle1;
     struct addrinfo *AI = NULL;
 
     localhost.SetLocalhost();
index 2fde95afc947c28bb1ee401327c2396ffcf6afcf..e898cc11c670ffc6d9625ae559ea691efabb738c 100644 (file)
@@ -1,15 +1,13 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.am,v 1.2 2006/05/11 12:25:39 hno Exp $
-#
 #  Uncomment and customize the following to suit your needs:
 #
 
 
 AUTOMAKE_OPTIONS = subdir-objects
 
-INCLUDES        = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/lib/libTrie/include
+INCLUDES        = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/lib/libTrie/include -I$(top_srcdir)/src
 INCLUDES       += @SQUID_CPPUNIT_INC@
 
 TESTS=$(check_PROGRAMS)
@@ -38,7 +36,7 @@ squidclient_SOURCES = squidclient.cc
 cachemgr__CGIEXT__SOURCES = cachemgr.cc
 cachemgr__CGIEXT__CXXFLAGS = -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CXXFLAGS)
 
-LDADD = -L../lib -lmiscutil $(XTRA_LIBS)
+LDADD = ../src/ip/libip.la -L../lib -lmiscutil $(XTRA_LIBS)
 
 EXTRA_DIST = \
        cachemgr.conf
index 2009e029c5cf73582728eb3160af3cbcf596bbb3..53a4333f514189d1fc56d3e029c8b8e612136945 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: cachemgr.cc,v 1.6 2007/12/14 23:11:53 amosjeffries Exp $
- *
  * DEBUG: section 0     CGI Cache Manager
  * AUTHOR: Duane Wessels
  *
@@ -133,7 +131,7 @@ extern "C"
 
 #include "assert.h"
 #include "util.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 #include "getfullhostname.h"
 
 #ifndef DEFAULT_CACHEMGR_CONFIG
@@ -795,7 +793,7 @@ process_request(cachemgr_request * req)
 
     char ipbuf[MAX_IPSTRLEN];
     struct addrinfo *AI = NULL;
-    IPAddress S;
+    IpAddress S;
     int s;
     int l;
 
index d7ff21dad9deec9ede4c106266fe27d84f1ead71..b2331aeed6ef2b8ac7fa41e8ff04ad746d9ea28c 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id: squidclient.cc,v 1.11 2008/02/26 21:49:46 amosjeffries Exp $
- *
  * DEBUG: section 0     WWW Client
  * AUTHOR: Harvest Derived
  *
@@ -86,7 +83,7 @@ using namespace Squid;
 #endif
 
 #include "util.h"
-#include "IPAddress.h"
+#include "ip/IpAddress.h"
 
 #ifndef BUFSIZ
 #define BUFSIZ         8192
@@ -101,9 +98,9 @@ using namespace Squid;
 typedef void SIGHDLR(int sig);
 
 /* Local functions */
-static int client_comm_bind(int, const IPAddress &);
+static int client_comm_bind(int, const IpAddress &);
 
-static int client_comm_connect(int, const IPAddress &, struct timeval *);
+static int client_comm_connect(int, const IpAddress &, struct timeval *);
 static void usage(const char *progname);
 
 static int Now(struct timeval *);
@@ -169,7 +166,7 @@ main(int argc, char *argv[])
     int opt_noaccept = 0;
     int opt_verbose = 0;
     const char *hostname, *localhost;
-    IPAddress iaddr;
+    IpAddress iaddr;
     char url[BUFSIZ], msg[MESSAGELEN], buf[BUFSIZ];
     char extra_hdrs[HEADERLEN];
     const char *method = "GET";
@@ -612,7 +609,7 @@ main(int argc, char *argv[])
 }
 
 static int
-client_comm_bind(int sock, const IPAddress &addr) {
+client_comm_bind(int sock, const IpAddress &addr) {
 
     int res;
 
@@ -630,7 +627,7 @@ client_comm_bind(int sock, const IPAddress &addr) {
 }
 
 static int
-client_comm_connect(int sock, const IPAddress &addr, struct timeval *tvp) {
+client_comm_connect(int sock, const IpAddress &addr, struct timeval *tvp) {
     int res;
     static struct addrinfo *AI = NULL;