From: Amos Jeffries Date: Wed, 7 Jan 2009 10:49:14 +0000 (+1300) Subject: Convert many IPAddress to IpAddress X-Git-Tag: SQUID_3_2_0_1~1269^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad61a2b4790650d1d2e9b000a05b99e9cefcd41a;p=thirdparty%2Fsquid.git Convert many IPAddress to IpAddress --- diff --git a/src/ACLARP.cc b/src/ACLARP.cc index 1e39591128..b2cc1a1a1b 100644 --- a/src/ACLARP.cc +++ b/src/ACLARP.cc @@ -40,13 +40,13 @@ #include #endif #include "squid.h" -#include "IPAddress.h" +#include "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 +84,7 @@ struct arpreq { #endif static void aclParseArpList(SplayNode **curlist); static int decode_eth(const char *asc, char *eth); -static int aclMatchArp(SplayNode **dataptr, IPAddress &c); +static int aclMatchArp(SplayNode **dataptr, IpAddress &c); static SplayNode::SPLAYCMP aclArpCompare; static SplayNode::SPLAYWALKEE aclDumpArpListWalkee; @@ -242,12 +242,12 @@ ACLARP::match(ACLChecklist *checklist) /* aclMatchArp */ /***************/ int -aclMatchArp(SplayNode **dataptr, IPAddress &c) +aclMatchArp(SplayNode **dataptr, IpAddress &c) { struct arpreq arpReq; struct sockaddr_in *sa = NULL; - IPAddress ipAddr = c; + IpAddress ipAddr = c; #if defined(_SQUID_LINUX_) diff --git a/src/ACLASN.h b/src/ACLASN.h index a2bffe626e..79e28968c4 100644 --- a/src/ACLASN.h +++ b/src/ACLASN.h @@ -39,9 +39,9 @@ #include "CbDataList.h" #include "ACLStrategised.h" #include "ACLChecklist.h" -#include "IPAddress.h" +#include "IpAddress.h" -SQUIDCEXTERN int asnMatchIp(CbDataList *, IPAddress &); +SQUIDCEXTERN int asnMatchIp(CbDataList *, IpAddress &); /// \ingroup ACLAPI SQUIDCEXTERN void asnInit(void); @@ -50,7 +50,7 @@ SQUIDCEXTERN void asnInit(void); SQUIDCEXTERN void asnFreeMemory(void); /// \ingroup ACLAPI -class ACLASN : public ACLData +class ACLASN : public ACLData { public: @@ -58,18 +58,18 @@ public: virtual ~ACLASN(); - virtual bool match(IPAddress); + virtual bool match(IpAddress); virtual wordlist *dump(); virtual void parse(); bool empty() const; - virtual ACLData *clone() const; + virtual ACLData *clone() const; virtual void prepareForUse(); private: static ACL::Prototype SourceRegistryProtoype; - static ACLStrategised SourceRegistryEntry_; + static ACLStrategised SourceRegistryEntry_; static ACL::Prototype DestinationRegistryProtoype; - static ACLStrategised DestinationRegistryEntry_; + static ACLStrategised DestinationRegistryEntry_; CbDataList *data; }; diff --git a/src/ACLChecklist.h b/src/ACLChecklist.h index 3e2f422283..a514cadf5c 100644 --- a/src/ACLChecklist.h +++ b/src/ACLChecklist.h @@ -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; diff --git a/src/ACLDestinationASN.h b/src/ACLDestinationASN.h index 0c2dd11d8f..22589d9cba 100644 --- a/src/ACLDestinationASN.h +++ b/src/ACLDestinationASN.h @@ -37,10 +37,10 @@ #include "ACLASN.h" #include "ACLStrategy.h" -#include "IPAddress.h" +#include "IpAddress.h" /// \ingroup ACLAPI -class ACLDestinationASNStrategy : public ACLStrategy +class ACLDestinationASNStrategy : public ACLStrategy { public: diff --git a/src/ACLIP.cc b/src/ACLIP.cc index 9206ee47f9..d7fc8795b8 100644 --- a/src/ACLIP.cc +++ b/src/ACLIP.cc @@ -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) {} diff --git a/src/ACLIP.h b/src/ACLIP.h index e5ea68deaf..4d1b7a5614 100644 --- a/src/ACLIP.h +++ b/src/ACLIP.h @@ -37,7 +37,7 @@ #include "ACL.h" #include "splay.h" -#include "IPAddress.h" +#include "IpAddress.h" /// \ingroup ACLAPI class acl_ip_data @@ -50,20 +50,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 +91,7 @@ public: protected: - int match(IPAddress &); + int match(IpAddress &); IPSplay *data; private: diff --git a/src/ACLMaxUserIP.cc b/src/ACLMaxUserIP.cc index 9935ea3f5f..9e5262156f 100644 --- a/src/ACLMaxUserIP.cc +++ b/src/ACLMaxUserIP.cc @@ -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 diff --git a/src/ACLMaxUserIP.h b/src/ACLMaxUserIP.h index 42ce6ca85c..2cf425a12a 100644 --- a/src/ACLMaxUserIP.h +++ b/src/ACLMaxUserIP.h @@ -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; diff --git a/src/ACLSourceASN.h b/src/ACLSourceASN.h index e03517cf69..820ad14ec5 100644 --- a/src/ACLSourceASN.h +++ b/src/ACLSourceASN.h @@ -42,9 +42,9 @@ class ACLChecklist; #include "ACLStrategy.h" -#include "IPAddress.h" +#include "IpAddress.h" -class ACLSourceASNStrategy : public ACLStrategy +class ACLSourceASNStrategy : public ACLStrategy { public: diff --git a/src/AccessLogEntry.h b/src/AccessLogEntry.h index 6c7905c7a8..bb022ad9b4 100644 --- a/src/AccessLogEntry.h +++ b/src/AccessLogEntry.h @@ -36,7 +36,7 @@ #include "HttpVersion.h" #include "HttpRequestMethod.h" #include "HierarchyLogEntry.h" -#include "IPAddress.h" +#include "IpAddress.h" #include "HttpRequestMethod.h" /* forward decls */ @@ -92,7 +92,7 @@ public: {; } - IPAddress caddr; + IpAddress caddr; int64_t requestSize; int64_t replySize; int64_t highOffset; diff --git a/src/AuthUser.cc b/src/AuthUser.cc index 5c002c5f7a..ef74003972 100644 --- a/src/AuthUser.cc +++ b/src/AuthUser.cc @@ -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; diff --git a/src/AuthUser.h b/src/AuthUser.h index 5062912500..ec063b8ad2 100644 --- a/src/AuthUser.h +++ b/src/AuthUser.h @@ -41,7 +41,7 @@ class AuthUserHashPointer; /* for auth_type_t */ #include "enums.h" -#include "IPAddress.h" +#include "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(); diff --git a/src/AuthUserRequest.cc b/src/AuthUserRequest.cc index aef630dd48..f878ea716e 100644 --- a/src/AuthUserRequest.cc +++ b/src/AuthUserRequest.cc @@ -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); diff --git a/src/AuthUserRequest.h b/src/AuthUserRequest.h index 0787703c0d..95f2d4df72 100644 --- a/src/AuthUserRequest.h +++ b/src/AuthUserRequest.h @@ -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 diff --git a/src/CompositePoolNode.h b/src/CompositePoolNode.h index 1694d25e1c..e4e0eb3fb4 100644 --- a/src/CompositePoolNode.h +++ b/src/CompositePoolNode.h @@ -46,7 +46,7 @@ #include "DelayPools.h" #include "DelayIdComposite.h" #include "CommRead.h" -#include "IPAddress.h" +#include "IpAddress.h" class StoreEntry; @@ -78,7 +78,7 @@ public: public: CompositeSelectionDetails() {} - IPAddress src_addr; + IpAddress src_addr; AuthUserRequest *user; String tag; }; diff --git a/src/ConnectionDetail.h b/src/ConnectionDetail.h index 4706b29e47..853a21b7d0 100644 --- a/src/ConnectionDetail.h +++ b/src/ConnectionDetail.h @@ -37,7 +37,7 @@ #ifndef _SQUIDCONNECTIONDETAIL_H_ #define _SQUIDCONNECTIONDETAIL_H_ -#include "IPAddress.h" +#include "IpAddress.h" class ConnectionDetail { @@ -46,9 +46,9 @@ public: ConnectionDetail(); - IPAddress me; + IpAddress me; - IPAddress peer; + IpAddress peer; }; #endif diff --git a/src/ESI.cc b/src/ESI.cc index 13f28bcee8..19f6b92a52 100644 --- a/src/ESI.cc +++ b/src/ESI.cc @@ -59,7 +59,7 @@ #include "ESIExpression.h" #include "HttpRequest.h" #include "MemBuf.h" -#include "IPAddress.h" +#include "IpAddress.h" /* quick reference on behaviour here. * The ESI specification 1.0 requires the ESI processor to be able to @@ -1435,7 +1435,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 */ diff --git a/src/HttpRequest.h b/src/HttpRequest.h index a8a7e0f4ef..86c67a6f86 100644 --- a/src/HttpRequest.h +++ b/src/HttpRequest.h @@ -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; diff --git a/src/ICP.h b/src/ICP.h index 058da11df6..fbe72ba4c0 100644 --- 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); diff --git a/src/PeerSelectState.h b/src/PeerSelectState.h index 8939e40e1d..18af8cf0ed 100644 --- a/src/PeerSelectState.h +++ b/src/PeerSelectState.h @@ -38,7 +38,7 @@ #include "cbdata.h" #include "PingData.h" -#include "IPAddress.h" +#include "IpAddress.h" class ps_state { @@ -55,16 +55,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 diff --git a/src/ProtoPort.h b/src/ProtoPort.h index e1d14093eb..863f87d4f7 100644 --- a/src/ProtoPort.h +++ b/src/ProtoPort.h @@ -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 */ diff --git a/src/asn.cc b/src/asn.cc index 7953890161..d855478a02 100644 --- a/src/asn.cc +++ b/src/asn.cc @@ -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 *data, IPAddress &addr) +asnMatchIp(CbDataList *data, IpAddress &addr) { struct squid_radix_node *rn; as_info *e; @@ -392,8 +392,8 @@ asnAddNet(char *as_string, int as_number) CbDataList *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 *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 * +ACLData * ACLASN::clone() const { if (data) @@ -594,18 +594,18 @@ ACLASN::clone() const /* explicit template instantiation required for some systems */ -template class ACLStrategised; +template class ACLStrategised; ACL::Prototype ACLASN::SourceRegistryProtoype(&ACLASN::SourceRegistryEntry_, "src_as"); -ACLStrategised ACLASN::SourceRegistryEntry_(new ACLASN, ACLSourceASNStrategy::Instance(), "src_as"); +ACLStrategised ACLASN::SourceRegistryEntry_(new ACLASN, ACLSourceASNStrategy::Instance(), "src_as"); ACL::Prototype ACLASN::DestinationRegistryProtoype(&ACLASN::DestinationRegistryEntry_, "dst_as"); -ACLStrategised ACLASN::DestinationRegistryEntry_(new ACLASN, ACLDestinationASNStrategy::Instance(), "dst_as"); +ACLStrategised ACLASN::DestinationRegistryEntry_(new ACLASN, ACLDestinationASNStrategy::Instance(), "dst_as"); int -ACLSourceASNStrategy::match (ACLData * &data, ACLChecklist *checklist) +ACLSourceASNStrategy::match (ACLData * &data, ACLChecklist *checklist) { return data->match(checklist->src_addr); } @@ -638,7 +638,7 @@ ACLDestinationASNStrategy::match (ACLData * &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); } diff --git a/src/cache_cf.cc b/src/cache_cf.cc index dac99b8f17..566902e5ee 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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(xcalloc(1, sizeof(*s))); + s = static_cast(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; } diff --git a/src/client_db.cc b/src/client_db.cc index 709e305f28..40f8624643 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -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]; diff --git a/src/client_side.cc b/src/client_side.cc index 6f5cc255f4..42ca7e027b 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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 @@ -2765,7 +2765,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; @@ -2778,7 +2778,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; diff --git a/src/client_side.h b/src/client_side.h index d1a768df80..317c6dd02f 100644 --- a/src/client_side.h +++ b/src/client_side.h @@ -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; diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index c6f9216718..e73cef056e 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -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 = @@ -1732,7 +1732,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, @@ -1800,7 +1800,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, @@ -2034,7 +2034,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; diff --git a/src/client_side_reply.h b/src/client_side_reply.h index ffaacdb0a6..740d97e13a 100644 --- a/src/client_side_reply.h +++ b/src/client_side_reply.h @@ -40,7 +40,7 @@ #include "clientStream.h" #include "StoreClient.h" #include "client_side_request.h" -#include "IPAddress.h" +#include "IpAddress.h" class ErrorState; @@ -76,7 +76,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); diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 49a4646a2e..57a1395bca 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -583,7 +583,7 @@ ClientRequestContext::clientAccessCheckDone(int answer) clientStreamNode *node = (clientStreamNode *)http->client_stream.tail->prev->data; clientReplyContext *repContext = dynamic_cast(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, diff --git a/src/comm.cc b/src/comm.cc index 4b032cbff5..913088fbdf 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -47,7 +47,7 @@ #include "pconn.h" #include "SquidTime.h" #include "CommCalls.h" -#include "IPAddress.h" +#include "IpAddress.h" #include "DescriptorSet.h" #include "icmp/net_db.h" #include "ip/IpIntercept.h" @@ -209,10 +209,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 +498,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 +522,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 +549,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 +607,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 +672,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 +940,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 +1189,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 +1608,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) { diff --git a/src/comm.h b/src/comm.h index 55678480d9..7faf775262 100644 --- a/src/comm.h +++ b/src/comm.h @@ -6,7 +6,7 @@ #include "AsyncCall.h" #include "StoreIOBuffer.h" #include "Array.h" -#include "IPAddress.h" +#include "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); diff --git a/src/delay_pools.cc b/src/delay_pools.cc index 766bb51894..deaf5fb65e 100644 --- a/src/delay_pools.cc +++ b/src/delay_pools.cc @@ -66,7 +66,7 @@ #include "DelayBucket.h" #include "DelayUser.h" #include "DelayTagged.h" -#include "IPAddress.h" +#include "IpAddress.h" /// \ingroup DelayPoolsInternal long DelayPools::MemoryUsed = 0; @@ -161,7 +161,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 +193,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 +208,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 +252,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 buckets; @@ -861,7 +861,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 +888,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 +962,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 +975,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() ) diff --git a/src/dns_internal.cc b/src/dns_internal.cc index ac9c862aff..e3942e81a2 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -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; diff --git a/src/dnsserver.cc b/src/dnsserver.cc index 87b80e9af5..acb2651c50 100644 --- a/src/dnsserver.cc +++ b/src/dnsserver.cc @@ -166,7 +166,7 @@ usage: dnsserver -Dhv -s nameserver \endverbatim */ -#include "IPAddress.h" +#include "IpAddress.h" #if LIBRESOLV_DNS_TTL_HACK /// \ingroup dnsserver @@ -195,7 +195,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 +392,7 @@ main(int argc, char *argv[]) #endif #if HAVE_RES_INIT - IPAddress ipa; + IpAddress ipa; int opt_s = 0; #ifdef _SQUID_RES_NSADDR_LIST diff --git a/src/errorpage.h b/src/errorpage.h index 35e556e6dd..930e601410 100644 --- a/src/errorpage.h +++ b/src/errorpage.h @@ -38,7 +38,7 @@ #include "squid.h" #include "cbdata.h" -#include "IPAddress.h" +#include "IpAddress.h" /** \defgroup ErrorPageAPI Error Pages API @@ -125,7 +125,7 @@ public: char *dnsserver_msg; time_t ttl; - IPAddress src_addr; + IpAddress src_addr; char *redirect_url; ERCB *callback; void *callback_data; diff --git a/src/external_acl.cc b/src/external_acl.cc index 52b2ff132f..ba7efeea85 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -128,7 +128,7 @@ public: QUOTE_METHOD_URL } quote; - IPAddress local_addr; + IpAddress local_addr; }; struct _external_acl_format { diff --git a/src/fde.h b/src/fde.h index 582d7b746d..37fbbe555c 100644 --- a/src/fde.h +++ b/src/fde.h @@ -35,7 +35,7 @@ #define SQUID_FDE_H #include "comm.h" -#include "IPAddress.h" +#include "IpAddress.h" class PconnPool; @@ -59,7 +59,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 +124,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. } }; diff --git a/src/forward.cc b/src/forward.cc index 1b0341812e..d29e2cf044 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -771,10 +771,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); @@ -903,7 +903,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; } } @@ -1177,7 +1177,7 @@ FwdState::reforwardableStatus(http_status s) void -FwdState::pconnPush(int fd, const char *host, int port, const char *domain, IPAddress &client_addr) +FwdState::pconnPush(int fd, const char *host, int port, const char *domain, IpAddress &client_addr) { fwdPconnPool->push(fd, host, port, domain, client_addr); } @@ -1288,12 +1288,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)) @@ -1321,7 +1321,7 @@ aclMapTOS(acl_tos * head, ACLChecklist * ch) return 0; } -IPAddress +IpAddress getOutgoingAddr(HttpRequest * request, struct peer *dst_peer) { ACLChecklist ch; diff --git a/src/forward.h b/src/forward.h index dbfffe391f..2a3341a23a 100644 --- a/src/forward.h +++ b/src/forward.h @@ -6,7 +6,7 @@ class ErrorState; #include "comm.h" -#include "IPAddress.h" +#include "IpAddress.h" class FwdServer { @@ -43,7 +43,7 @@ public: bool checkRetry(); bool checkRetriable(); void dispatch(); - void pconnPush(int fd, const char *host, int port, const char *domain, IPAddress &client_addr); + void pconnPush(int fd, const char *host, int port, const char *domain, IpAddress &client_addr); bool dontRetry() { return flags.dont_retry; } @@ -99,7 +99,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 diff --git a/src/fqdncache.cc b/src/fqdncache.cc index 21e74c2477..f0a758b029 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -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]; diff --git a/src/ftp.cc b/src/ftp.cc index c8c67962e4..9ca5faaa12 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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]; diff --git a/src/globals.h b/src/globals.h index 0b1e5d189b..df18240282 100644 --- a/src/globals.h +++ b/src/globals.h @@ -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 */ diff --git a/src/helper.h b/src/helper.h index 43332d4bae..b206d4003f 100644 --- a/src/helper.h +++ b/src/helper.h @@ -38,7 +38,7 @@ #include "squid.h" #include "cbdata.h" -#include "IPAddress.h" +#include "IpAddress.h" class helper_request; @@ -65,7 +65,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 +87,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 +105,7 @@ struct _helper_stateful { struct _helper_server { int index; int pid; - IPAddress addr; + IpAddress addr; int rfd; int wfd; MemBuf *wqueue; @@ -141,7 +141,7 @@ class helper_stateful_request; struct _helper_stateful_server { int index; int pid; - IPAddress addr; + IpAddress addr; int rfd; int wfd; /* MemBuf wqueue; */ diff --git a/src/htcp.cc b/src/htcp.cc index 1d8feaf91b..4a7527417a 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -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(); diff --git a/src/htcp.h b/src/htcp.h index fc65b9f4f5..530044d131 100644 --- a/src/htcp.h +++ b/src/htcp.h @@ -35,7 +35,7 @@ #if USE_HTCP #include "HttpHeader.h" -#include "IPAddress.h" +#include "IpAddress.h" /// \ingroup ServerProtocolHTCP class HtcpReplyData @@ -60,7 +60,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); diff --git a/src/http.cc b/src/http.cc index 83199ba03e..c909ab9fe1 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1207,7 +1207,7 @@ void HttpStateData::processReplyBody() { AsyncCall::Pointer call; - IPAddress client_addr; + IpAddress client_addr; bool ispinned = false; if (!flags.headers_parsed) { diff --git a/src/icp_v2.cc b/src/icp_v2.cc index 47b7b4eec2..5c162907f3 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -48,14 +48,14 @@ #include "wordlist.h" #include "SquidTime.h" #include "SwapDir.h" -#include "IPAddress.h" +#include "IpAddress.h" #include "icmp/net_db.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 +70,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 +175,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 +272,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 +382,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 +405,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 +427,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 +445,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 +496,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 +513,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 +566,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 +585,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 +652,7 @@ icpConnectionsOpen(void) { u_int16_t port; - IPAddress addr; + IpAddress addr; struct addrinfo *xai = NULL; int x; diff --git a/src/icp_v3.cc b/src/icp_v3.cc index c9759f9c2b..26e40cb19a 100644 --- a/src/icp_v3.cc +++ b/src/icp_v3.cc @@ -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"); diff --git a/src/ident.cc b/src/ident.cc index aa6df07569..06dc2292bf 100644 --- a/src/ident.cc +++ b/src/ident.cc @@ -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; diff --git a/src/ident.h b/src/ident.h index a00043e97a..a0736dc64c 100644 --- a/src/ident.h +++ b/src/ident.h @@ -16,10 +16,10 @@ #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); diff --git a/src/internal.cc b/src/internal.cc index 68e62e69e1..d48ec98f4e 100644 --- a/src/internal.cc +++ b/src/internal.cc @@ -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); } diff --git a/src/ipc.cc b/src/ipc.cc index 83c7559465..4db52fb1e4 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -36,7 +36,7 @@ #include "squid.h" #include "comm.h" #include "fde.h" -#include "IPAddress.h" +#include "IpAddress.h" static const char *hello_string = "hi there\n"; #define HELLO_BUF_SZ 32 @@ -75,11 +75,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; diff --git a/src/ipc_win32.cc b/src/ipc_win32.cc index 174669d184..aa9c31dc45 100644 --- a/src/ipc_win32.cc +++ b/src/ipc_win32.cc @@ -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); diff --git a/src/ipcache.cc b/src/ipcache.cc index f95c7f7b69..c54cc1a5c4 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -40,7 +40,7 @@ #include "SquidTime.h" #include "Store.h" #include "wordlist.h" -#include "IPAddress.h" +#include "IpAddress.h" /** \defgroup IPCacheAPI IP Cache API @@ -420,7 +420,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 +555,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 +780,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); @@ -950,7 +950,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 @@ -961,22 +961,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 @@ -1039,7 +1039,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); @@ -1070,7 +1070,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; @@ -1206,7 +1206,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 */ @@ -1309,7 +1309,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; @@ -1344,7 +1344,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; @@ -1427,7 +1427,7 @@ ipcacheAddEntryFromHosts(const char *name, const char *ipaddr) { ipcache_entry *i; - IPAddress ip; + IpAddress ip; if (!(ip = ipaddr)) { #if USE_IPV6 @@ -1459,7 +1459,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; diff --git a/src/neighbors.cc b/src/neighbors.cc index 265e89aa38..f1f3fa6b0b 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -46,7 +46,7 @@ #include "PeerSelectState.h" #include "SquidTime.h" #include "Store.h" -#include "IPAddress.h" +#include "IpAddress.h" #include "icmp/net_db.h" /* count mcast group peers every 15 minutes */ @@ -69,7 +69,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 +97,7 @@ neighborTypeStr(const peer * p) peer * -whichPeer(const IPAddress &from) +whichPeer(const IpAddress &from) { int j; @@ -554,7 +554,7 @@ neighborsRegisterWithCacheManager() void neighbors_init(void) { - IPAddress nul; + IpAddress nul; struct addrinfo *AI = NULL; struct servent *sep = NULL; const char *me = getMyHostname(); @@ -964,7 +964,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 +1024,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 +1384,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 +1760,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; diff --git a/src/pconn.cc b/src/pconn.cc index a5252a94ce..07241024a9 100644 --- a/src/pconn.cc +++ b/src/pconn.cc @@ -178,7 +178,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 * 2 + 10); char ntoabuf[MAX_IPSTRLEN]; @@ -230,7 +230,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; @@ -274,7 +274,7 @@ PconnPool::push(int fd, const char *host, u_short port, const char *domain, IPAd */ 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) { IdleConnList *list; const char * aKey = key(host, port, domain, client_address); diff --git a/src/pconn.h b/src/pconn.h index 3253d88bb1..982fa8b432 100644 --- a/src/pconn.h +++ b/src/pconn.h @@ -57,7 +57,7 @@ private: }; -class IPAddress; +class IpAddress; class StoreEntry; class IdleConnLimit; @@ -72,15 +72,15 @@ 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 unlinkList(IdleConnList *list) const; 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; diff --git a/src/protos.h b/src/protos.h index 0193b48c8f..e688dbae2a 100644 --- a/src/protos.h +++ b/src/protos.h @@ -37,7 +37,7 @@ */ #include "Packer.h" /* for routines still in this file that take CacheManager parameters */ -#include "IPAddress.h" +#include "IpAddress.h" /* for parameters that still need these */ #include "enums.h" /* some parameters stil need this */ @@ -76,20 +76,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 +142,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 +161,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 +298,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 +342,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 +384,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 +411,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 +423,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 +672,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); diff --git a/src/redirect.cc b/src/redirect.cc index db2c006ced..8aaa2a0250 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -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; diff --git a/src/send-announce.cc b/src/send-announce.cc index 8f11c92950..860e043faa 100644 --- a/src/send-announce.cc +++ b/src/send-announce.cc @@ -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; diff --git a/src/snmp_agent.cc b/src/snmp_agent.cc index d77edb6b0e..a356020d25 100644 --- a/src/snmp_agent.cc +++ b/src/snmp_agent.cc @@ -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; diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 05f4aa8992..ebf788bfd6 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -35,12 +35,12 @@ #include "comm.h" #include "cache_snmp.h" #include "ACLChecklist.h" -#include "IPAddress.h" +#include "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 +482,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 +870,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 +1105,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 +1145,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; diff --git a/src/squid.h b/src/squid.h index bf0ae1b043..b15538dd77 100644 --- a/src/squid.h +++ b/src/squid.h @@ -377,7 +377,7 @@ extern "C" #include "profiling.h" #include "MemPool.h" -#include "IPAddress.h" +#include "IpAddress.h" #if !HAVE_TEMPNAM #include "tempnam.h" diff --git a/src/structs.h b/src/structs.h index 5d3d1df27a..92ec0fd0c9 100644 --- a/src/structs.h +++ b/src/structs.h @@ -73,7 +73,7 @@ struct _snmp_request_t { long reqid; int outlen; - IPAddress from; + IpAddress from; struct snmp_pdu *PDU; ACLChecklist *acl_checklist; @@ -90,7 +90,7 @@ struct acl_address { acl_address *next; ACLList *aclList; - IPAddress addr; + IpAddress addr; }; struct acl_tos { @@ -223,18 +223,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 +336,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 +550,7 @@ struct SquidConfig { struct { - IPAddress addr; + IpAddress addr; int ttl; unsigned short port; char *encode_key; @@ -774,7 +774,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 +816,7 @@ struct peer { char *host; peer_t type; - IPAddress in_addr; + IpAddress in_addr; struct { int pings_sent; @@ -906,7 +906,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 +1263,7 @@ struct _HttpHeaderStat { struct _ClientInfo { hash_link hash; /* must be first */ - IPAddress addr; + IpAddress addr; struct { int result_hist[LOG_TYPE_MAX]; diff --git a/src/tests/stub_comm.cc b/src/tests/stub_comm.cc index 3a463b31d9..4059701545 100644 --- a/src/tests/stub_comm.cc +++ b/src/tests/stub_comm.cc @@ -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; diff --git a/src/tools.cc b/src/tools.cc index 293ab9a8bc..a60fc32ba2 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -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; diff --git a/src/tunnel.cc b/src/tunnel.cc index 18cc3626f1..6f239eedab 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -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, diff --git a/src/unlinkd.cc b/src/unlinkd.cc index e5fedb9ef9..1d7f9504dc 100644 --- a/src/unlinkd.cc +++ b/src/unlinkd.cc @@ -192,7 +192,7 @@ void unlinkdInit(void) { const char *args[2]; - IPAddress localhost; + IpAddress localhost; args[0] = "(unlinkd)"; args[1] = NULL; diff --git a/src/wccp.cc b/src/wccp.cc index cde240dac7..1adafc1fe6 100644 --- a/src/wccp.cc +++ b/src/wccp.cc @@ -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."); diff --git a/src/wccp2.cc b/src/wccp2.cc index 33ec543563..076eb7eead 100644 --- a/src/wccp2.cc +++ b/src/wccp2.cc @@ -39,7 +39,7 @@ #include "Parsing.h" #include "Store.h" #include "SwapDir.h" -#include "IPAddress.h" +#include "IpAddress.h" #if USE_WCCPv2 #if HAVE_NETDB_H @@ -630,7 +630,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; @@ -1139,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, @@ -1500,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"); @@ -1940,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, diff --git a/src/win32.cc b/src/win32.cc index 9e437f0e5c..caf1af7cea 100644 --- a/src/win32.cc +++ b/src/win32.cc @@ -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(); diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 2009e029c5..7efc903dc1 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -133,7 +133,7 @@ extern "C" #include "assert.h" #include "util.h" -#include "IPAddress.h" +#include "IpAddress.h" #include "getfullhostname.h" #ifndef DEFAULT_CACHEMGR_CONFIG @@ -795,7 +795,7 @@ process_request(cachemgr_request * req) char ipbuf[MAX_IPSTRLEN]; struct addrinfo *AI = NULL; - IPAddress S; + IpAddress S; int s; int l; diff --git a/tools/squidclient.cc b/tools/squidclient.cc index d7ff21dad9..074f823f95 100644 --- a/tools/squidclient.cc +++ b/tools/squidclient.cc @@ -86,7 +86,7 @@ using namespace Squid; #endif #include "util.h" -#include "IPAddress.h" +#include "IpAddress.h" #ifndef BUFSIZ #define BUFSIZ 8192 @@ -101,9 +101,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 +169,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 +612,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 +630,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;