--------------------- PatchSet 5893 Date: 2007/10/07 11:37:20 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Fix compile errors in new code with --enable-icmp Members: src/ICMP.h:1.1.2.4->1.1.2.5 src/ICMPSquid.cc:1.1.2.1->1.1.2.2 src/net_db.cc:1.13.4.28->1.13.4.29 Index: squid3/src/ICMP.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICMP.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid3/src/ICMP.h 7 Oct 2007 06:19:56 -0000 1.1.2.4 +++ squid3/src/ICMP.h 7 Oct 2007 11:37:20 -0000 1.1.2.5 @@ -1,5 +1,5 @@ /* - * $Id: ICMP.h,v 1.1.2.4 2007/10/07 06:19:56 amosjeffries Exp $ + * $Id: ICMP.h,v 1.1.2.5 2007/10/07 11:37:20 amosjeffries Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels, Amos Jeffries @@ -88,8 +88,8 @@ /// Send ICMP virtual void Send(pingerEchoData * pkt, int len) =0; - inline int CheckSum(unsigned short *ptr, int size); - inline int ipHops(int ttl); + int CheckSum(unsigned short *ptr, int size); + int ipHops(int ttl); /* no use wasting memory */ int icmp_sock; Index: squid3/src/ICMPSquid.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICMPSquid.cc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid3/src/ICMPSquid.cc 7 Oct 2007 06:19:56 -0000 1.1.2.1 +++ squid3/src/ICMPSquid.cc 7 Oct 2007 11:37:20 -0000 1.1.2.2 @@ -1,5 +1,5 @@ /* - * $Id: ICMPSquid.cc,v 1.1.2.1 2007/10/07 06:19:56 amosjeffries Exp $ + * $Id: ICMPSquid.cc,v 1.1.2.2 2007/10/07 11:37:20 amosjeffries Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels, Amos Jeffries @@ -68,12 +68,6 @@ #if USE_ICMP -static void -icmpSendEcho(IPAddress &to, int opcode, const char *payload, int len) -{ - icmpEngine.SendEcho(to, opcode, payload, len); -} - void ICMPSquid::SendEcho(IPAddress &to, int opcode, const char *payload, int len) { @@ -92,7 +86,7 @@ xmemcpy(pecho.payload, payload, len); - icmpSend(&pecho, sizeof(pingerEchoData) - PINGER_PAYLOAD_SZ + len); + Send(&pecho, sizeof(pingerEchoData) - PINGER_PAYLOAD_SZ + len); } // Callback to wrap the squid-side ICMP handler. @@ -162,14 +156,6 @@ } } -#if 0 -static void -icmpSend(pingerEchoData * pkt, int len) -{ -// private! icmpEngine.Send(pkt, len); -} -#endif - void ICMPSquid::Send(pingerEchoData * pkt, int len) { @@ -283,7 +269,7 @@ &hIpc); if (pid < 0) - return; + return -1; assert(rfd == wfd); @@ -301,8 +287,8 @@ debugs(37, 4, "Pinger handle: 0x" << std::hex << hIpc << std::dec << ", PID: " << pid); -#endif -#endif +#endif /* _SQUID_MSWIN_ */ +#endif /* USE_ICMP */ return 0; // not used. would be icmp_sock otherwise. } Index: squid3/src/net_db.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/net_db.cc,v retrieving revision 1.13.4.28 retrieving revision 1.13.4.29 diff -u -r1.13.4.28 -r1.13.4.29 --- squid3/src/net_db.cc 28 Aug 2007 01:35:10 -0000 1.13.4.28 +++ squid3/src/net_db.cc 7 Oct 2007 11:37:21 -0000 1.13.4.29 @@ -1,6 +1,5 @@ - /* - * $Id: net_db.cc,v 1.13.4.28 2007/08/28 01:35:10 amosjeffries Exp $ + * $Id: net_db.cc,v 1.13.4.29 2007/10/07 11:37:21 amosjeffries Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -57,6 +56,7 @@ #include "IPAddress.h" #if USE_ICMP +#include "ICMPSquid.h" #include "StoreClient.h" #define NETDB_REQBUF_SZ 4096 @@ -334,7 +334,7 @@ if (n->next_ping_time <= squid_curtime) { debugs(38, 3, "netdbSendPing: pinging " << hostname); - icmpDomainPing(addr, hostname); + icmpEngine.DomainPing(addr, hostname); n->pings_sent++; n->next_ping_time = squid_curtime + Config.Netdb.period; n->last_use_time = squid_curtime;