From: Amos Jeffries Date: Fri, 10 Oct 2008 11:24:16 +0000 (+1300) Subject: Merged from trunk X-Git-Tag: SQUID_3_2_0_1~1398^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7473a02ae3f8e0692530d0dde746bf6c81786946;p=thirdparty%2Fsquid.git Merged from trunk --- 7473a02ae3f8e0692530d0dde746bf6c81786946 diff --cc src/Makefile.am index 2472d4581e,1b20279161..015839a024 --- a/src/Makefile.am +++ b/src/Makefile.am @@@ -2095,9 -2151,27 +2092,8 @@@ tests_testHttpRequest_LDADD = tests_testHttpRequest_LDFLAGS = $(LIBADD_DL) tests_testHttpRequest_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \ @REPL_OBJS@ \ - @SQUID_CPPUNIT_LA@ \ - ${ADAPTATION_LIBS} + @SQUID_CPPUNIT_LA@ -## Tests of the ICMP base module. -# Its used by pinger so SHOULD NOT require more dependancies! :-( -tests_testICMP_SOURCES=\ - ICMP.h \ - icmp.cc \ - tests/testICMP.h \ - tests/testICMP.cc \ - tests/testMain.cc \ - SquidTime.h \ - time.cc \ - $(TESTSOURCES) -tests_testICMP_LDFLAGS = $(LIBADD_DL) -tests_testICMP_LDADD=\ - @SQUID_CPPUNIT_LIBS@ \ - @SQUID_CPPUNIT_LA@ \ - -L../lib -lmiscutil -tests_testICMP_DEPENDENCIES= @SQUID_CPPUNIT_LA@ \ - $(top_builddir)/lib/libmiscutil.a - # TODO:mime.cc drags in HttpReply.cc # delay pools need client_side_request.cc # store_key_md5 wants the method. diff --cc src/icmp/Icmp.cc index 029bff812d,8d6d30a7c5..38c0c04194 --- a/src/icmp/Icmp.cc +++ b/src/icmp/Icmp.cc @@@ -45,10 -45,10 +45,10 @@@ Icmp::Icmp( } void -ICMP::Close() +Icmp::Close() { #if USE_ICMP - if(icmp_sock > 0) + if (icmp_sock > 0) close(icmp_sock); icmp_sock = -1; icmp_ident = 0; diff --cc src/icmp/Icmp4.cc index f9f2ecc108,67b789476d..04e1cf4186 --- a/src/icmp/Icmp4.cc +++ b/src/icmp/Icmp4.cc @@@ -38,37 -38,37 +38,37 @@@ #if USE_ICMP #include "SquidTime.h" -#include "ICMPv4.h" -#include "ICMPPinger.h" +#include "Icmp4.h" +#include "IcmpPinger.h" #include "Debug.h" - const char *icmpPktStr[] = - { - "Echo Reply", - "ICMP 1", - "ICMP 2", - "Destination Unreachable", - "Source Quench", - "Redirect", - "ICMP 6", - "ICMP 7", - "Echo", - "ICMP 9", - "ICMP 10", - "Time Exceeded", - "Parameter Problem", - "Timestamp", - "Timestamp Reply", - "Info Request", - "Info Reply", - "Out of Range Type" - }; + const char *icmpPktStr[] = { + "Echo Reply", + "ICMP 1", + "ICMP 2", + "Destination Unreachable", + "Source Quench", + "Redirect", + "ICMP 6", + "ICMP 7", + "Echo", + "ICMP 9", + "ICMP 10", + "Time Exceeded", + "Parameter Problem", + "Timestamp", + "Timestamp Reply", + "Info Request", + "Info Reply", + "Out of Range Type" + }; -ICMPv4::ICMPv4() : ICMP() +Icmp4::Icmp4() : Icmp() - {; + { + ; } -ICMPv4::~ICMPv4() +Icmp4::~Icmp4() { Close(); } diff --cc src/icmp/Icmp6.cc index 190d97cd26,f05ff7a2df..430d699f37 --- a/src/icmp/Icmp6.cc +++ b/src/icmp/Icmp6.cc @@@ -49,63 -49,61 +49,61 @@@ #include #endif -// ICMPv6 OP-Codes +// Icmp6 OP-Codes // see http://www.iana.org/assignments/icmpv6-parameters // NP: LowPktStr is for codes 0-127 - static const char *icmp6LowPktStr[] = - { - "ICMP 0", // 0 - "Destination Unreachable", // 1 - RFC2463 - "Packet Too Big", // 2 - RFC2463 - "Time Exceeded", // 3 - RFC2463 - "Parameter Problem", // 4 - RFC2463 - "ICMP 5", // 5 - "ICMP 6", // 6 - "ICMP 7", // 7 - "ICMP 8", // 8 - "ICMP 9", // 9 - "ICMP 10" // 10 - }; + static const char *icmp6LowPktStr[] = { + "ICMP 0", // 0 + "Destination Unreachable", // 1 - RFC2463 + "Packet Too Big", // 2 - RFC2463 + "Time Exceeded", // 3 - RFC2463 + "Parameter Problem", // 4 - RFC2463 + "ICMP 5", // 5 + "ICMP 6", // 6 + "ICMP 7", // 7 + "ICMP 8", // 8 + "ICMP 9", // 9 + "ICMP 10" // 10 + }; // NP: HighPktStr is for codes 128-255 - static const char *icmp6HighPktStr[] = - { - "Echo Request", // 128 - RFC2463 - "Echo Reply", // 129 - RFC2463 - "Multicast Listener Query", // 130 - RFC2710 - "Multicast Listener Report", // 131 - RFC2710 - "Multicast Listener Done", // 132 - RFC2710 - "Router Solicitation", // 133 - RFC4861 - "Router Advertisement", // 134 - RFC4861 - "Neighbor Solicitation", // 135 - RFC4861 - "Neighbor Advertisement", // 136 - RFC4861 - "Redirect Message", // 137 - RFC4861 - "Router Renumbering", // 138 - Crawford - "ICMP Node Information Query", // 139 - RFC4620 - "ICMP Node Information Response", // 140 - RFC4620 - "Inverse Neighbor Discovery Solicitation", // 141 - RFC3122 - "Inverse Neighbor Discovery Advertisement", // 142 - RFC3122 - "Version 2 Multicast Listener Report", // 143 - RFC3810 - "Home Agent Address Discovery Request", // 144 - RFC3775 - "Home Agent Address Discovery Reply", // 145 - RFC3775 - "Mobile Prefix Solicitation", // 146 - RFC3775 - "Mobile Prefix Advertisement", // 147 - RFC3775 - "Certification Path Solicitation", // 148 - RFC3971 - "Certification Path Advertisement", // 149 - RFC3971 - "ICMP Experimental (150)", // 150 - RFC4065 - "Multicast Router Advertisement", // 151 - RFC4286 - "Multicast Router Solicitation", // 152 - RFC4286 - "Multicast Router Termination", // 153 - [RFC4286] - "ICMP 154", - "ICMP 155", - "ICMP 156", - "ICMP 157", - "ICMP 158", - "ICMP 159", - "ICMP 160" - }; + static const char *icmp6HighPktStr[] = { + "Echo Request", // 128 - RFC2463 + "Echo Reply", // 129 - RFC2463 + "Multicast Listener Query", // 130 - RFC2710 + "Multicast Listener Report", // 131 - RFC2710 + "Multicast Listener Done", // 132 - RFC2710 + "Router Solicitation", // 133 - RFC4861 + "Router Advertisement", // 134 - RFC4861 + "Neighbor Solicitation", // 135 - RFC4861 + "Neighbor Advertisement", // 136 - RFC4861 + "Redirect Message", // 137 - RFC4861 + "Router Renumbering", // 138 - Crawford + "ICMP Node Information Query", // 139 - RFC4620 + "ICMP Node Information Response", // 140 - RFC4620 + "Inverse Neighbor Discovery Solicitation", // 141 - RFC3122 + "Inverse Neighbor Discovery Advertisement", // 142 - RFC3122 + "Version 2 Multicast Listener Report", // 143 - RFC3810 + "Home Agent Address Discovery Request", // 144 - RFC3775 + "Home Agent Address Discovery Reply", // 145 - RFC3775 + "Mobile Prefix Solicitation", // 146 - RFC3775 + "Mobile Prefix Advertisement", // 147 - RFC3775 + "Certification Path Solicitation", // 148 - RFC3971 + "Certification Path Advertisement", // 149 - RFC3971 + "ICMP Experimental (150)", // 150 - RFC4065 + "Multicast Router Advertisement", // 151 - RFC4286 + "Multicast Router Solicitation", // 152 - RFC4286 + "Multicast Router Termination", // 153 - [RFC4286] + "ICMP 154", + "ICMP 155", + "ICMP 156", + "ICMP 157", + "ICMP 158", + "ICMP 159", + "ICMP 160" + }; -ICMPv6::ICMPv6() : ICMP() +Icmp6::Icmp6() : Icmp() { ; // nothing new. } @@@ -189,17 -186,17 +186,17 @@@ Icmp6::SendEcho(IPAddress &to, int opco assert(icmp6_pktsize <= MAX_PKT6_SZ); - debugs(42, 5, HERE << "Send ICMPv6 packet to " << to << "."); + debugs(42, 5, HERE << "Send Icmp6 packet to " << to << "."); x = sendto(icmp_sock, - (const void *) pkt, - icmp6_pktsize, - 0, - S->ai_addr, - S->ai_addrlen); - - if(x < 0) { - debugs(42, 1, HERE << "Error sending to Icmp6 packet to " << to << ". ERR: " << xstrerror()); + (const void *) pkt, + icmp6_pktsize, + 0, + S->ai_addr, + S->ai_addrlen); + + if (x < 0) { + debugs(42, 1, HERE << "Error sending to ICMPv6 packet to " << to << ". ERR: " << xstrerror()); } debugs(42,9, HERE << "x=" << x); diff --cc src/icmp/IcmpConfig.h index 1504b14134,a1a1b3b9b0..e06f0e5e21 --- a/src/icmp/IcmpConfig.h +++ b/src/icmp/IcmpConfig.h @@@ -50,17 -50,18 +50,18 @@@ * This structure is included as a child field of the global Config * such that if ICMP is built it can be accessed as Config.pinger.* */ - class IcmpConfig { -class ICMPConfig ++class IcmpConfig + { public: /** \todo These methods should really be defined in an ICMPConfig.cc file * alongside any custom parsing routines needed for this component. * First though, the whole global Config dependancy tree needs fixing */ - ICMPConfig() : program(NULL), enable(0) {}; - ~ICMPConfig() { if (program) delete program; program = NULL; }; + IcmpConfig() : program(NULL), enable(0) {}; - ~IcmpConfig() { if(program) delete program; program = NULL; }; ++ ~IcmpConfig() { if (program) delete program; program = NULL; }; - /* variables */ + /* variables */ /** pinger helper application path */ char *program;