]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/icp_v2.cc
Merged from parent (trunk r10600).
[thirdparty/squid.git] / src / icp_v2.cc
index 67bd9788820b8822aa8793fe7eb6c6bd20620c34..cb1e4cde5cbced6d37d664b0784347f0ed726c6b 100644 (file)
@@ -47,7 +47,7 @@
 #include "SquidTime.h"
 #include "SwapDir.h"
 #include "icmp/net_db.h"
-#include "ip/IpAddress.h"
+#include "ip/Address.h"
 #include "ipc/StartListening.h"
 #include "rfc1738.h"
 
@@ -56,8 +56,8 @@ class IcpListeningStartedDialer: public CallDialer,
         public Ipc::StartListeningCb
 {
 public:
-    typedef void (*Handler)(int fd, int errNo, IpAddress& addr);
-    IcpListeningStartedDialer(Handler aHandler, IpAddress& anAddr):
+    typedef void (*Handler)(int fd, int errNo, Ip::Address& addr);
+    IcpListeningStartedDialer(Handler aHandler, Ip::Address& anAddr):
             handler(aHandler), addr(anAddr) {}
 
     virtual void print(std::ostream &os) const {
@@ -70,16 +70,16 @@ public:
 
 public:
     Handler handler;
-    IpAddress addr;
+    Ip::Address addr;
 };
 
-static void icpIncomingConnectionOpened(int fd, int errNo, IpAddress& addr);
+static void icpIncomingConnectionOpened(int fd, int errNo, Ip::Address& addr);
 
 /// \ingroup ServerProtocolICPInternal2
-static void icpLogIcp(const IpAddress &, log_type, int, const char *, int);
+static void icpLogIcp(const Ip::Address &, log_type, int, const char *, int);
 
 /// \ingroup ServerProtocolICPInternal2
-static void icpHandleIcpV2(int, IpAddress &, char *, int);
+static void icpHandleIcpV2(int, Ip::Address &, char *, int);
 
 /// \ingroup ServerProtocolICPInternal2
 static void icpCount(void *, int, size_t, int);
@@ -94,7 +94,7 @@ static icpUdpData *IcpQueueHead = NULL;
 static icpUdpData *IcpQueueTail = NULL;
 
 /// \ingroup ServerProtocolICPInternal2
-IpAddress theOutICPAddr;
+Ip::Address 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)
@@ -199,7 +199,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 Ip::Address &caddr, log_type logcode, int len, const char *url, int delay)
 {
     AccessLogEntry al;
 
@@ -296,7 +296,7 @@ _icp_common_t::createMessage(
 
 int
 icpUdpSend(int fd,
-           const IpAddress &to,
+           const Ip::Address &to,
            icp_common_t * msg,
            log_type logcode,
            int delay)
@@ -406,14 +406,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 Ip::Address &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(Ip::Address &from, char *url, int reqnum, int fd)
 {
     debugs(12, 2, "icpDenyAccess: Access Denied for " << from << " by " << AclMatchedName << ".");
 
@@ -429,7 +429,7 @@ icpDenyAccess(IpAddress &from, char *url, int reqnum, int fd)
 }
 
 int
-icpAccessAllowed(IpAddress &from, HttpRequest * icp_request)
+icpAccessAllowed(Ip::Address &from, HttpRequest * icp_request)
 {
     /* absent an explicit allow, we deny all */
     if (!Config.accessList.icp)
@@ -452,7 +452,7 @@ icpGetUrlToSend(char *url)
 }
 
 HttpRequest *
-icpGetRequest(char *url, int reqnum, int fd, IpAddress &from)
+icpGetRequest(char *url, int reqnum, int fd, Ip::Address &from)
 {
     if (strpbrk(url, w_space)) {
         url = rfc1738_escape(url);
@@ -470,7 +470,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, Ip::Address &from, char *buf, icp_common_t header)
 {
     int rtt = 0;
     int src_rtt = 0;
@@ -521,7 +521,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, Ip::Address &from)
 {
     if (neighbors_do_private_keys && reqnum == 0) {
         debugs(12, 0, "icpHandleIcpV2: Neighbor " << from << " returned reqnum = 0");
@@ -538,7 +538,7 @@ _icp_common_t::handleReply(char *buf, IpAddress &from)
 }
 
 static void
-icpHandleIcpV2(int fd, IpAddress &from, char *buf, int len)
+icpHandleIcpV2(int fd, Ip::Address &from, char *buf, int len)
 {
     if (len <= 0) {
         debugs(12, 3, "icpHandleIcpV2: ICP message is too small");
@@ -590,8 +590,7 @@ icpHandleIcpV2(int fd, IpAddress &from, char *buf, int len)
 static void
 icpPktDump(icp_common_t * pkt)
 {
-
-    IpAddress a;
+    Ip::Address 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);
@@ -610,7 +609,7 @@ icpHandleUdp(int sock, void *data)
 {
     int *N = &incoming_sockets_accepted;
 
-    IpAddress from;
+    Ip::Address from;
     LOCAL_ARRAY(char, buf, SQUID_UDP_SO_RCVBUF);
     int len;
     int icp_version;
@@ -676,8 +675,7 @@ void
 icpConnectionsOpen(void)
 {
     u_int16_t port;
-
-    IpAddress addr;
+    Ip::Address addr;
 
     struct addrinfo *xai = NULL;
     int x;
@@ -739,7 +737,7 @@ icpConnectionsOpen(void)
 }
 
 static void
-icpIncomingConnectionOpened(int fd, int errNo, IpAddress& addr)
+icpIncomingConnectionOpened(int fd, int errNo, Ip::Address& addr)
 {
     theInIcpConnection = fd;