]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Merged from trunk
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 10 Oct 2008 11:24:16 +0000 (00:24 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 10 Oct 2008 11:24:16 +0000 (00:24 +1300)
21 files changed:
configure.in
src/Debug.h
src/Makefile.am
src/debug.cc
src/globals.h
src/icmp/Icmp.cc [moved from src/icmp.cc with 94% similarity]
src/icmp/Icmp.h [moved from src/ICMP.h with 94% similarity]
src/icmp/Icmp4.cc [moved from src/ICMPv4.cc with 96% similarity]
src/icmp/Icmp4.h [moved from src/ICMPv4.h with 97% similarity]
src/icmp/Icmp6.cc [moved from src/ICMPv6.cc with 93% similarity]
src/icmp/Icmp6.h [moved from src/ICMPv6.h with 95% similarity]
src/icmp/IcmpConfig.h [moved from src/ICMPConfig.h with 95% similarity]
src/icmp/IcmpPinger.cc [moved from src/ICMPPinger.cc with 95% similarity]
src/icmp/IcmpPinger.h [moved from src/ICMPPinger.h with 93% similarity]
src/icmp/IcmpSquid.cc [moved from src/ICMPSquid.cc with 95% similarity]
src/icmp/IcmpSquid.h [moved from src/ICMPSquid.h with 94% similarity]
src/icmp/net_db.cc [moved from src/net_db.cc with 99% similarity]
src/icmp/pinger.cc [moved from src/pinger.cc with 98% similarity]
src/icmp/testIcmp.cc [moved from src/tests/testICMP.cc with 93% similarity]
src/icmp/testIcmp.h [moved from src/tests/testICMP.h with 83% similarity]
src/structs.h

index da7cd74555297700b7f513419f9d13a0aea22833..36ee27bfd4e3041e7afcc569ac98ce9c5318c5b8 100755 (executable)
@@ -3732,6 +3732,7 @@ AC_CONFIG_FILES([\
        src/auth/Makefile \
        src/adaptation/Makefile \
        src/ICAP/Makefile \
+       src/icmp/Makefile \
        src/eCAP/Makefile \
        contrib/Makefile \
        snmplib/Makefile \
index 0409dac2f4638fe67ed7202b0acb6a7dda0f0434..61c7b69823435c6d5a90d8015e1518ee3d8aaa9d 100644 (file)
@@ -78,6 +78,8 @@ private:
     static int TheDepth; // level of nested debugging calls
 };
 
+extern FILE *debug_log;
+
 /* Debug stream */
 #define debugs(SECTION, LEVEL, CONTENT) \
    do { \
index 1b20279161dd178cc0a6ebc3df0e1136cd2c1f29..015839a02477cd544a67913a8536634f54818cdb 100644 (file)
@@ -34,7 +34,7 @@ LOADABLE_MODULES_SOURCES = \
 TESTS=$(check_PROGRAMS)
 check_PROGRAMS=
 
-SUBDIRS                = fs repl auth
+SUBDIRS                = fs repl auth icmp
 
 if USE_ADAPTATION
 SUBDIRS += adaptation
@@ -141,20 +141,6 @@ UNLINKDSOURCE =
 UNLINKD = 
 endif
 
-if ENABLE_PINGER
-PINGER = pinger
-else
-PINGER = 
-endif
-
-# Squid Internal ICMP sources
-ICMPSOURCE = \
-       ICMP.h \
-       icmp.cc \
-       ICMPConfig.h \
-       ICMPSquid.h \
-       ICMPSquid.cc
-
 SSL_ALL_SOURCE = \
        ACLCertificateData.cc \
        ACLCertificateData.h  \
@@ -233,7 +219,7 @@ INCLUDES    += @SQUID_CPPUNIT_INC@
 EXTRA_PROGRAMS = \
        DiskIO/DiskDaemon/diskd \
        unlinkd \
-       pinger \
+       icmp/pinger \
        dnsserver \
        recv-announce \
        tests/testUfs \
@@ -254,7 +240,6 @@ bin_PROGRAMS =
 
 
 libexec_PROGRAMS = \
-       $(PINGER) \
        $(DNSSERVER) \
        @DISK_PROGRAMS@ \
        $(UNLINKD)
@@ -561,7 +546,6 @@ squid_SOURCES = \
        HttpRequestMethod.cc \
        HttpRequestMethod.h \
        HttpVersion.h \
-       $(ICMPSOURCE) \
        ICP.h \
        icp_v2.cc \
        icp_v3.cc \
@@ -584,7 +568,6 @@ squid_SOURCES = \
        mime.cc \
        multicast.cc \
        neighbors.cc \
-       net_db.cc \
        Packer.cc \
        Packer.h \
        Parsing.cc \
@@ -698,6 +681,7 @@ nodist_squid_SOURCES = \
 squid_LDADD = \
        libsquid.la \
        libauth.la \
+       libsquid-icmp.la \
        -L../lib \
        @XTRA_OBJS@ \
        @DISK_LINKOBJS@ \
@@ -740,22 +724,6 @@ endif
 
 unlinkd_SOURCES = unlinkd_daemon.cc SquidNew.cc
 
-## NP: the pinger contains the squid-external helper code
-##     $(ICMPSOURCE) contains the interface bit to go inside squid
-pinger_SOURCES = \
-       ICMP.h \
-       icmp.cc \
-       ICMPPinger.h \
-       ICMPPinger.cc \
-       ICMPv4.h \
-       ICMPv4.cc \
-       ICMPv6.h \
-       ICMPv6.cc \
-       pinger.cc \
-       debug.cc \
-       time.cc \
-       SquidNew.cc 
-
 dnsserver_SOURCES = dnsserver.cc SquidNew.cc
 recv_announce_SOURCES = recv-announce.cc SquidNew.cc
 
@@ -867,7 +835,6 @@ ufsdump_SOURCES = \
        HttpReply.cc \
        HttpRequest.cc \
        HttpRequestMethod.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -886,7 +853,6 @@ ufsdump_SOURCES = \
        mime.cc \
        multicast.cc \
        neighbors.cc \
-       net_db.cc \
        Packer.cc \
        Parsing.cc \
        $(XPROF_STATS_SOURCE) \
@@ -938,6 +904,7 @@ ufsdump_SOURCES = \
 ufsdump_LDADD = \
        libsquid.la \
        libauth.la \
+       libsquid-icmp.la \
        -L../lib \
        @XTRA_OBJS@ \
        @REPL_OBJS@ \
@@ -967,9 +934,6 @@ nodist_ufsdump_SOURCES = \
        globals.cc \
        string_arrays.c
 
-nodist_pinger_SOURCES = \
-       globals.cc
-
 BUILT_SOURCES = \
        cf_gen_defines.h \
        cf_parser.h \
@@ -1156,19 +1120,6 @@ uninstall-local:
 DISTCLEANFILES = cf_gen_defines.h cf.data cf_parser.h squid.conf.default squid.conf.documented \
        globals.cc string_arrays.c repl_modules.cc 
 
-##install-pinger:
-##     @f=$(PINGER_EXE); \
-##     if test -f $(libexecdir)/$$f; then \
-##             echo $(MV) $(libexecdir)/$$f $(libexecdir)/-$$f; \
-##             $(MV) $(libexecdir)/$$f $(libexecdir)/-$$f; \
-##     fi; \
-##     echo $(INSTALL_SUID) $$f $(libexecdir); \
-##     $(INSTALL_SUID) $$f $(libexecdir) || exit 1; \
-##     if test -f $(libexecdir)/-$$f; then \
-##             echo $(RM) -f $(libexecdir)/-$$f; \
-##             $(RM) -f $(libexecdir)/-$$f; \
-##     fi
-
 # stock tools for unit tests - library independent versions of dlink_list 
 # etc.
 # globals.cc is needed by test_tools.cc
@@ -1192,7 +1143,6 @@ check_PROGRAMS+= tests/testAuth \
        tests/testEventLoop \
        tests/test_http_range \
        tests/testHttpRequest \
-       tests/testICMP \
        tests/testStore \
        tests/testString \
        tests/testURL \
@@ -1426,7 +1376,6 @@ tests_testCacheManager_SOURCES = \
        HttpMsg.cc \
        HttpReply.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -1442,7 +1391,6 @@ tests_testCacheManager_SOURCES = \
        MemObject.cc \
        mime.cc \
        neighbors.cc \
-       net_db.cc \
        Packer.cc \
        Parsing.cc \
        pconn.cc \
@@ -1499,6 +1447,7 @@ nodist_tests_testCacheManager_SOURCES = \
 tests_testCacheManager_LDADD = \
        libsquid.la \
        libauth.la \
+       libsquid-icmp.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
        @REGEXLIB@ \
@@ -1600,7 +1549,6 @@ tests_testEvent_SOURCES = \
        HttpMsg.cc \
        HttpReply.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -1616,7 +1564,6 @@ tests_testEvent_SOURCES = \
        MemObject.cc \
        mime.cc \
        neighbors.cc \
-       net_db.cc \
        Packer.cc \
        Parsing.cc \
        pconn.cc \
@@ -1757,7 +1704,6 @@ tests_testEventLoop_SOURCES = \
        HttpMsg.cc \
        HttpReply.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -1773,7 +1719,6 @@ tests_testEventLoop_SOURCES = \
        MemObject.cc \
        mime.cc \
        neighbors.cc \
-       net_db.cc \
        Packer.cc \
        Parsing.cc \
        pconn.cc \
@@ -1905,7 +1850,6 @@ tests_test_http_range_SOURCES = \
        HttpRequest.cc \
        HttpRequestMethod.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -1921,7 +1865,6 @@ tests_test_http_range_SOURCES = \
        mime.cc \
        multicast.cc \
        neighbors.cc \
-       net_db.cc \
        Parsing.cc \
        peer_digest.cc \
        peer_select.cc \
@@ -2066,7 +2009,6 @@ tests_testHttpRequest_SOURCES = \
        HttpMsg.cc \
        HttpReply.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -2082,7 +2024,6 @@ tests_testHttpRequest_SOURCES = \
        MemObject.cc \
        mime.cc \
        neighbors.cc \
-       net_db.cc \
        Packer.cc \
        Parsing.cc \
        pconn.cc \
@@ -2153,25 +2094,6 @@ tests_testHttpRequest_DEPENDENCIES =  $(top_builddir)/lib/libmiscutil.a \
        @REPL_OBJS@ \
        @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.
@@ -2433,7 +2355,6 @@ tests_testURL_SOURCES = \
        HttpMsg.cc \
        HttpReply.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -2449,7 +2370,6 @@ tests_testURL_SOURCES = \
        MemObject.cc \
        mime.cc \
        neighbors.cc \
-       net_db.cc \
        Packer.cc \
        Parsing.cc \
        pconn.cc \
index 28bd0d37bc778c8726e99d4564767308f301f744..622036f0d9473968fd0c9b67a50b629bec67ce70 100644 (file)
@@ -40,7 +40,7 @@
 
 int Debug::Levels[MAX_DEBUG_SECTIONS];
 int Debug::level;
-
+FILE *debug_log = NULL;
 static char *debug_log_file = NULL;
 static int Ctx_Lock = 0;
 static const char *debugLogTime(void);
index 6c128efe7c1bc80f6f548e985b8c0bdbfef63b82..0b1e5d189bba4694743ae9cdaab3c1137b104e4d 100644 (file)
@@ -50,7 +50,7 @@ extern "C"
 {
 #endif
 
-    extern FILE *debug_log;            /* NULL */
+//MOVED:Debug.h    extern FILE *debug_log;             /* NULL */
 //MOVED:structs.h    extern SquidConfig Config;
 //MOVED:structs.h    extern SquidConfig2 Config2;
     extern char *ConfigFile;   /* NULL */
similarity index 94%
rename from src/icmp.cc
rename to src/icmp/Icmp.cc
index 8d6d30a7c5612d2d321fb11c1b9bfa0f11f4ed44..38c0c0419446090e6b1306f4622f10e7c61e3286 100644 (file)
  *
  */
 #include "squid.h"
-#include "ICMP.h"
+#include "Icmp.h"
 #include "SquidTime.h"
 #include "Debug.h"
 
-ICMP::ICMP()
+Icmp::Icmp()
 {
 #if USE_ICMP
     icmp_sock = -1;
@@ -45,7 +45,7 @@ ICMP::ICMP()
 }
 
 void
-ICMP::Close()
+Icmp::Close()
 {
 #if USE_ICMP
     if (icmp_sock > 0)
@@ -58,7 +58,7 @@ ICMP::Close()
 #if USE_ICMP
 
 int
-ICMP::CheckSum(unsigned short *ptr, int size)
+Icmp::CheckSum(unsigned short *ptr, int size)
 {
     long sum;
     unsigned short oddbyte;
@@ -86,7 +86,7 @@ ICMP::CheckSum(unsigned short *ptr, int size)
 }
 
 int
-ICMP::ipHops(int ttl)
+Icmp::ipHops(int ttl)
 {
     if (ttl < 33)
         return 33 - ttl;
@@ -107,7 +107,7 @@ ICMP::ipHops(int ttl)
 }
 
 void
-ICMP::Log(const IPAddress &addr, const u_int8_t type, const char* pkt_str, const int rtt, const int hops)
+Icmp::Log(const IPAddress &addr, const u_int8_t type, const char* pkt_str, const int rtt, const int hops)
 {
     debugs(42, 2, "pingerLog: " << std::setw(9) << current_time.tv_sec  <<
            "." << std::setfill('0') << std::setw(6) <<
similarity index 94%
rename from src/ICMP.h
rename to src/icmp/Icmp.h
index 31682f0f09438fb5e81655b347dc28e070907fd6..d5fa09ae7261182f79d707a4ceec11c66e7ef7be 100644 (file)
@@ -83,16 +83,16 @@ SQUIDCEXTERN int icmp_pkts_sent;
  * Child implementations define specific parts of these operations
  * using these methods as a naming and parameter template.
  *
- * ICMPSquid - implements the squid side of squid-pinger interface
- * ICMPPinger - implements the pinger side of the squid-pinger interface
- * ICMPv4 - implements pinger helper for ICMPv4
- * ICMPv6 - implements pinger helper for ICMPv6
+ * IcmpSquid - implements the squid side of squid-pinger interface
+ * IcmpPinger - implements the pinger side of the squid-pinger interface
+ * Icmpv4 - implements pinger helper for Icmpv4
+ * Icmpv6 - implements pinger helper for Icmpv6
  */
-class ICMP
+class Icmp
 {
 public:
-    ICMP();
-    virtual ~ICMP() {};
+    Icmp();
+    virtual ~Icmp() {};
 
     /// Start pinger helper and initiate control channel
     virtual int Open() =0;
similarity index 96%
rename from src/ICMPv4.cc
rename to src/icmp/Icmp4.cc
index 67b789476de9205fdb87f0062ba59c7ad6e093ed..04e1cf41862e5bb3ba921a69c26b1f2301adfe51 100644 (file)
@@ -38,8 +38,8 @@
 #if USE_ICMP
 
 #include "SquidTime.h"
-#include "ICMPv4.h"
-#include "ICMPPinger.h"
+#include "Icmp4.h"
+#include "IcmpPinger.h"
 #include "Debug.h"
 
 const char *icmpPktStr[] = {
@@ -63,18 +63,18 @@ const char *icmpPktStr[] = {
     "Out of Range Type"
 };
 
-ICMPv4::ICMPv4() : ICMP()
+Icmp4::Icmp4() : Icmp()
 {
     ;
 }
 
-ICMPv4::~ICMPv4()
+Icmp4::~Icmp4()
 {
     Close();
 }
 
 int
-ICMPv4::Open(void)
+Icmp4::Open(void)
 {
     icmp_sock = socket(PF_INET, SOCK_RAW, IPPROTO_ICMP);
 
@@ -90,7 +90,7 @@ ICMPv4::Open(void)
 }
 
 void
-ICMPv4::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
+Icmp4::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
 {
     int x;
     LOCAL_ARRAY(char, pkt, MAX_PKT4_SZ);
@@ -158,7 +158,7 @@ ICMPv4::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
 }
 
 void
-ICMPv4::Recv(void)
+Icmp4::Recv(void)
 {
     int n;
     struct addrinfo *from = NULL;
similarity index 97%
rename from src/ICMPv4.h
rename to src/icmp/Icmp4.h
index 59a31315ccd0ecb6fa3f8da943d59f9f9fc0fe93..6c45b92002bf92b50e9586ed4c34f35b8b02ff12 100644 (file)
@@ -35,7 +35,7 @@
 #define _INCLUDE_ICMPV4_H
 
 #include "config.h"
-#include "ICMP.h"
+#include "Icmp.h"
 #include "IPAddress.h"
 
 #if HAVE_NETINET_IN_SYSTM_H
@@ -162,11 +162,11 @@ typedef struct icmphdr {
  * Class partially implementing RFC 792 - ICMP for IP version 4.
  * Provides ECHO-REQUEST, ECHO-REPLY (secion 4.1)
  */
-class ICMPv4 : public ICMP
+class Icmp4 : public Icmp
 {
 public:
-    ICMPv4();
-    virtual ~ICMPv4();
+    Icmp4();
+    virtual ~Icmp4();
 
     virtual int Open();
 
@@ -179,7 +179,7 @@ public:
 #if USE_ICMP
 
 /// pinger helper contains one of these as a global object.
-SQUIDCEXTERN ICMPv4 icmp4;
+SQUIDCEXTERN Icmp4 icmp4;
 
 #endif /* USE_ICMP && SQUID_HELPER */
 
similarity index 93%
rename from src/ICMPv6.cc
rename to src/icmp/Icmp6.cc
index f05ff7a2dfc805eb85e28b94522dde4c3656e172..430d699f378693254236df3799fb432c8c27b3b5 100644 (file)
@@ -39,8 +39,8 @@
 
 #include "SquidTime.h"
 #include "Debug.h"
-#include "ICMPv6.h"
-#include "ICMPPinger.h"
+#include "Icmp6.h"
+#include "IcmpPinger.h"
 
 // Some system headers are only neeed internally here.
 // They should not be included via the header.
@@ -49,7 +49,7 @@
 #include <netinet/ip6.h>
 #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[] = {
@@ -103,18 +103,18 @@ static const char *icmp6HighPktStr[] = {
     "ICMP 160"
 };
 
-ICMPv6::ICMPv6() : ICMP()
+Icmp6::Icmp6() : Icmp()
 {
     ; // nothing new.
 }
 
-ICMPv6::~ICMPv6()
+Icmp6::~Icmp6()
 {
     Close();
 }
 
 int
-ICMPv6::Open(void)
+Icmp6::Open(void)
 {
     icmp_sock = socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
 
@@ -124,16 +124,16 @@ ICMPv6::Open(void)
     }
 
     icmp_ident = getpid() & 0xffff;
-    debugs(42, 1, "pinger: ICMPv6 socket opened");
+    debugs(42, 1, "pinger: Icmp6 socket opened");
 
     return icmp_sock;
 }
 
 /**
- * Generates an RFC 4443 ICMPv6 ECHO Packet and sends into the network.
+ * Generates an RFC 4443 Icmp6 ECHO Packet and sends into the network.
  */
 void
-ICMPv6::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
+Icmp6::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
 {
     int x;
     LOCAL_ARRAY(char, pkt, MAX_PKT6_SZ);
@@ -153,7 +153,7 @@ ICMPv6::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
         len = 0;
     }
 
-    // Construct ICMPv6 ECHO header
+    // Construct Icmp6 ECHO header
     icmp->icmp6_type = ICMP6_ECHO_REQUEST;
     icmp->icmp6_code = 0;
     icmp->icmp6_cksum = 0;
@@ -163,7 +163,7 @@ ICMPv6::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
     icmp6_pktsize = sizeof(struct icmp6_hdr);
 
 
-    // Fill ICMPv6 ECHO data content
+    // Fill Icmp6 ECHO data content
     echo = (icmpEchoData *) (pkt + sizeof(icmp6_hdr));
     echo->opcode = (unsigned char) opcode;
     memcpy(&echo->tv, &current_time, sizeof(struct timeval));
@@ -186,7 +186,7 @@ ICMPv6::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
 
     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,
@@ -204,10 +204,10 @@ ICMPv6::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
 }
 
 /**
- * Reads an RFC 4443 ICMPv6 ECHO-REPLY Packet from the network.
+ * Reads an RFC 4443 Icmp6 ECHO-REPLY Packet from the network.
  */
 void
-ICMPv6::Recv(void)
+Icmp6::Recv(void)
 {
     int n;
     struct addrinfo *from = NULL;
@@ -299,7 +299,7 @@ ICMPv6::Recv(void)
     }
 
     if (icmp6->icmp6_id != icmp_ident) {
-        debugs(42, 8, HERE << "dropping ICMPv6 read. IDENT check failed. ident=='" << icmp_ident << "'=='" << icmp6->icmp6_id << "'");
+        debugs(42, 8, HERE << "dropping Icmp6 read. IDENT check failed. ident=='" << icmp_ident << "'=='" << icmp6->icmp6_id << "'");
         return;
     }
 
similarity index 95%
rename from src/ICMPv6.h
rename to src/icmp/Icmp6.h
index 4639ddc2b5cd685831a65fa9dbe7b82f16885dfb..4ec9cd3394688fd6ac3a1ff9400fcaf90ddb5d61 100644 (file)
@@ -38,7 +38,7 @@
 
 #if USE_IPV6
 
-#include "ICMP.h"
+#include "Icmp.h"
 #include "IPAddress.h"
 
 #if HAVE_NETINET_IN_H
  * Class partially implementing RFC 4443 - ICMPv6 for IP version 6.
  * Provides ECHO-REQUEST, ECHO-REPLY (secion 4)
  */
-class ICMPv6 : public ICMP
+class Icmp6 : public Icmp
 {
 public:
-    ICMPv6();
-    virtual ~ICMPv6();
+    Icmp6();
+    virtual ~Icmp6();
 
     virtual int Open();
 
@@ -87,10 +87,8 @@ public:
 #if USE_ICMP
 
 /// pinger helper contains one of these as a global object.
-SQUIDCEXTERN ICMPv6 icmp6;
+SQUIDCEXTERN Icmp6 icmp6;
 
 #endif /* USE_ICMP && SQUID_HELPER */
-
 #endif /* USE_IPV6 */
-
 #endif /* _INCLUDE_ICMPV6_H */
similarity index 95%
rename from src/ICMPConfig.h
rename to src/icmp/IcmpConfig.h
index a1a1b3b9b0bc4a2fa90b4c3fc559417915effbf6..e06f0e5e21cd48fce9821e5d4ffaddf3df2dff2d 100644 (file)
@@ -50,7 +50,7 @@
  * 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
 {
 
 public:
@@ -58,8 +58,8 @@ 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; };
 
     /* variables */
 
similarity index 95%
rename from src/ICMPPinger.cc
rename to src/icmp/IcmpPinger.cc
index 5e07f4f238ec843c8bc174300645ab5b8ccc21d3..f5b2a77d59daa189912a11b82216042ac5455ed7 100644 (file)
 #if USE_ICMP
 
 #include "SquidTime.h"
-#include "ICMPPinger.h"
-#include "ICMPv4.h"
-#include "ICMPv6.h"
+#include "IcmpPinger.h"
+#include "Icmp4.h"
+#include "Icmp6.h"
 #include "Debug.h"
 
-ICMPPinger::ICMPPinger() : ICMP()
+IcmpPinger::IcmpPinger() : Icmp()
 {
     // these start invalid. Setup properly in Open()
     socket_from_squid = -1;
     socket_to_squid = -1;
 }
 
-ICMPPinger::~ICMPPinger()
+IcmpPinger::~IcmpPinger()
 {
     Close();
 }
@@ -66,7 +66,7 @@ Win32SockCleanup(void)
 #endif
 
 int
-ICMPPinger::Open(void)
+IcmpPinger::Open(void)
 {
 #ifdef _SQUID_MSWIN_
 
@@ -160,7 +160,7 @@ ICMPPinger::Open(void)
 }
 
 void
-ICMPPinger::Close(void)
+IcmpPinger::Close(void)
 {
 #ifdef _SQUID_MSWIN_
 
@@ -177,7 +177,7 @@ ICMPPinger::Close(void)
 }
 
 void
-ICMPPinger::Recv(void)
+IcmpPinger::Recv(void)
 {
     static pingerEchoData pecho;
     int n;
@@ -232,7 +232,7 @@ ICMPPinger::Recv(void)
 }
 
 void
-ICMPPinger::SendResult(pingerReplyData &preply, int len)
+IcmpPinger::SendResult(pingerReplyData &preply, int len)
 {
     debugs(42, 2, HERE << "return result to squid. len=" << len);
 
similarity index 93%
rename from src/ICMPPinger.h
rename to src/icmp/IcmpPinger.h
index 8c28c9a8c964fc61cd1a056c7859985717a5f454..3b12228c539c0da435093f59f8c367c190921f90 100644 (file)
 #define _INCLUDE_ICMPPINGER_H
 
 #include "config.h"
-#include "ICMP.h"
+#include "Icmp.h"
 
 /**
  * Implements the interface to squid for ICMP operations
  */
-class ICMPPinger : public ICMP
+class IcmpPinger : public Icmp
 {
 public:
-    ICMPPinger();
-    virtual ~ICMPPinger();
+    IcmpPinger();
+    virtual ~IcmpPinger();
 
     /// Start and initiate control channel to squid
     virtual int Open();
@@ -61,7 +61,7 @@ public:
     virtual void Recv(void);
 
 private:
-    // unused in ICMPPinger
+    // unused in IcmpPinger
     virtual void SendEcho(IPAddress &to, int opcode, const char *payload, int len) {};
 
     /**
@@ -76,7 +76,7 @@ private:
 #if USE_ICMP
 
 /// pinger helper contains one of these as a global object.
-SQUIDCEXTERN ICMPPinger control;
+SQUIDCEXTERN IcmpPinger control;
 
 #endif
 
similarity index 95%
rename from src/ICMPSquid.cc
rename to src/icmp/IcmpSquid.cc
index 0132f2c0ca1810b656f22b5cdce258a5ba441f53..11b2d627eff1fd111965070eda1e51d63864fcc6 100644 (file)
  */
 
 #include "squid.h"
-#include "ICMPSquid.h"
+#include "IcmpSquid.h"
 #include "comm.h"
 #include "SquidTime.h"
 
 // Instance global to be available in main() and elsewhere.
-ICMPSquid icmpEngine;
+IcmpSquid icmpEngine;
 
 #if USE_ICMP
 
@@ -54,12 +54,12 @@ static pid_t pid;
 #endif /* USE_ICMP */
 
 
-ICMPSquid::ICMPSquid() : ICMP()
+IcmpSquid::IcmpSquid() : Icmp()
 {
     ; // nothing new.
 }
 
-ICMPSquid::~ICMPSquid()
+IcmpSquid::~IcmpSquid()
 {
     Close();
 }
@@ -68,7 +68,7 @@ ICMPSquid::~ICMPSquid()
 #if USE_ICMP
 
 void
-ICMPSquid::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
+IcmpSquid::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
 {
     static pingerEchoData pecho;
     int x, slen;
@@ -127,7 +127,7 @@ ICMPSquid::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
 }
 
 // static Callback to wrap the squid-side ICMP handler.
-// the ICMPSquid::Recv cannot be declared both static and virtual.
+// the IcmpSquid::Recv cannot be declared both static and virtual.
 static void
 icmpSquidRecv(int unused1, void *unused2)
 {
@@ -135,7 +135,7 @@ icmpSquidRecv(int unused1, void *unused2)
 }
 
 void
-ICMPSquid::Recv()
+IcmpSquid::Recv()
 {
     int n;
     static int fail_count = 0;
@@ -195,7 +195,7 @@ ICMPSquid::Recv()
 #endif /* USE_ICMP */
 
 void
-ICMPSquid::DomainPing(IPAddress &to, const char *domain)
+IcmpSquid::DomainPing(IPAddress &to, const char *domain)
 {
 #if USE_ICMP
     debugs(37, 4, HERE << "'" << domain << "' (" << to << ")");
@@ -204,7 +204,7 @@ ICMPSquid::DomainPing(IPAddress &to, const char *domain)
 }
 
 int
-ICMPSquid::Open(void)
+IcmpSquid::Open(void)
 {
 #if USE_ICMP
     const char *args[2];
@@ -270,7 +270,7 @@ ICMPSquid::Open(void)
 }
 
 void
-ICMPSquid::Close(void)
+IcmpSquid::Close(void)
 {
 #if USE_ICMP
 
similarity index 94%
rename from src/ICMPSquid.h
rename to src/icmp/IcmpSquid.h
index bca55270449c4b20a22e8bba7f820441d391c939..42502343d9ded35d37a0feeb87359e674ed6566c 100644 (file)
@@ -35,7 +35,7 @@
 #define _INCLUDE_ICMPSQUID_H
 
 #include "config.h"
-#include "ICMP.h"
+#include "Icmp.h"
 #include "IPAddress.h"
 
 /**
  *
  * Provides ECHO-REQUEST, ECHO-REPLY in a protocol-neutral manner.
  */
-class ICMPSquid : public ICMP
+class IcmpSquid : public Icmp
 {
 public:
-    ICMPSquid();
-    virtual ~ICMPSquid();
+    IcmpSquid();
+    virtual ~IcmpSquid();
 
     virtual int Open();
     virtual void Close();
@@ -64,6 +64,6 @@ public:
 };
 
 // global engine within squid.
-SQUIDCEXTERN ICMPSquid icmpEngine;
+SQUIDCEXTERN IcmpSquid icmpEngine;
 
 #endif /* _INCLUDE_ICMPSQUID_H */
similarity index 99%
rename from src/net_db.cc
rename to src/icmp/net_db.cc
index 1cf2f8715c968dd1cb1a1594016e0d6f50db6991..d15fc1e823e1bd0ffc9edc3ff571b3b1e59921b4 100644 (file)
@@ -56,7 +56,7 @@
 #include "IPAddress.h"
 
 #if USE_ICMP
-#include "ICMPSquid.h"
+#include "IcmpSquid.h"
 #include "StoreClient.h"
 
 #define        NETDB_REQBUF_SZ 4096
similarity index 98%
rename from src/pinger.cc
rename to src/icmp/pinger.cc
index 41690482ff9a8465e3814aca38d97b0c66437732..42aa0cfc5c8d3620dd52cfe7c2f3d277a219ce52 100644 (file)
@@ -68,9 +68,9 @@
 
 #if USE_ICMP
 
-#include "ICMPv4.h"
-#include "ICMPv6.h"
-#include "ICMPPinger.h"
+#include "Icmp4.h"
+#include "Icmp6.h"
+#include "IcmpPinger.h"
 
 #ifdef _SQUID_MSWIN_
 
@@ -107,10 +107,10 @@ Win32__WSAFDIsSet(int fd, fd_set FAR * set)
 #endif /* _SQUID_MSWIN_ */
 
 // ICMP Engines are declared global here so they can call each other easily.
-ICMPPinger control;
-ICMPv4 icmp4;
+IcmpPinger control;
+Icmp4 icmp4;
 #if USE_IPV6
-ICMPv6 icmp6;
+Icmp6 icmp6;
 #endif
 
 int icmp_pkts_sent = 0;
similarity index 93%
rename from src/tests/testICMP.cc
rename to src/icmp/testIcmp.cc
index fd2f3def1f63e542c655c79a0906d92c3086e78c..0e5c129612256edc8a7cac243440065427ad3d4b 100644 (file)
@@ -5,16 +5,16 @@
 
 #include <cppunit/TestAssert.h>
 
-#include "testICMP.h"
+#include "testIcmp.h"
 
-CPPUNIT_TEST_SUITE_REGISTRATION( testICMP );
+CPPUNIT_TEST_SUITE_REGISTRATION( testIcmp );
 
 #if USE_ICMP
 
 void
-testICMP::testChecksum()
+testIcmp::testChecksum()
 {
-    stubICMP icmp;
+    stubIcmp icmp;
     short unsigned int buf[10] = {1,2,3,4,5,6,7,8,9};
 
     // NULL data
@@ -40,9 +40,9 @@ testICMP::testChecksum()
 }
 
 void
-testICMP::testHops()
+testIcmp::testHops()
 {
-    stubICMP icmp;
+    stubIcmp icmp;
 
     /* test invalid -(under values) */
     // negative     : n > 33
similarity index 83%
rename from src/tests/testICMP.h
rename to src/icmp/testIcmp.h
index 6e43b0be01f0da0b7cfd232bd4a2d0b8f2d23747..a5df26d372fa1c55fa68a65a7dd52fcf9b22f471 100644 (file)
@@ -3,15 +3,15 @@
 
 #include <cppunit/extensions/HelperMacros.h>
 
-#include "ICMP.h"
+#include "Icmp.h"
 
 #if USE_ICMP
 
-class stubICMP : public ICMP
+class stubIcmp : public Icmp
 {
 public:
-    stubICMP() {};
-    virtual ~stubICMP() {};
+    stubIcmp() {};
+    virtual ~stubIcmp() {};
     virtual int Open() { return 0; };
     virtual void Close() {};
 
@@ -31,9 +31,9 @@ public:
 /**
  * test the ICMP base class.
  */
-class testICMP : public CPPUNIT_NS::TestFixture
+class testIcmp : public CPPUNIT_NS::TestFixture
 {
-    CPPUNIT_TEST_SUITE( testICMP );
+    CPPUNIT_TEST_SUITE( testIcmp );
 #if USE_ICMP
     CPPUNIT_TEST( testChecksum );
     CPPUNIT_TEST( testHops );
index 6057b4ba425b965916ed1c174bf8177df175a4c7..3d507ab90119276ae50dea7ede450591f9331cf9 100644 (file)
@@ -130,7 +130,7 @@ struct relist
 #endif
 
 #if USE_ICMP
-#include "ICMPConfig.h"
+#include "icmp/IcmpConfig.h"
 #endif
 
 /* forward decl for SquidConfig, see RemovalPolicy.h */
@@ -259,7 +259,7 @@ struct SquidConfig
 #endif
 
 #if USE_ICMP
-    ICMPConfig pinger;
+    IcmpConfig pinger;
 #endif
 
     char *as_whois_server;