]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Initial shift
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 18 Sep 2008 06:02:45 +0000 (18:02 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 18 Sep 2008 06:02:45 +0000 (18:02 +1200)
15 files changed:
src/Makefile.am
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 91% 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/testIcmp.cc [moved from src/tests/testICMP.cc with 93% similarity]
src/icmp/testIcmp.h [moved from src/tests/testICMP.h with 83% similarity]

index ea6a27a9fced3b2ab6729a85834562af2ffeae85..15b5fa298d27809df5a061e72b56ba8cd5eed7f4 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)
@@ -559,7 +544,6 @@ squid_SOURCES = \
        HttpRequestMethod.cc \
        HttpRequestMethod.h \
        HttpVersion.h \
-       $(ICMPSOURCE) \
        ICP.h \
        icp_v2.cc \
        icp_v3.cc \
@@ -696,6 +680,7 @@ nodist_squid_SOURCES = \
 squid_LDADD = \
        libsquid.la \
        libauth.la \
+       libsquid-icmp.la \
        -L../lib \
        @XTRA_OBJS@ \
        @DISK_LINKOBJS@ \
@@ -739,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
 
@@ -866,7 +835,6 @@ ufsdump_SOURCES = \
        HttpReply.cc \
        HttpRequest.cc \
        HttpRequestMethod.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -937,6 +905,7 @@ ufsdump_SOURCES = \
 ufsdump_LDADD = \
        libsquid.la \
        libauth.la \
+       libsquid-icmp.la \
        -L../lib \
        @XTRA_OBJS@ \
        @REPL_OBJS@ \
@@ -967,9 +936,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 +1122,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 +1145,6 @@ check_PROGRAMS+= tests/testAuth \
        tests/testEventLoop \
        tests/test_http_range \
        tests/testHttpRequest \
-       tests/testICMP \
        tests/testStore \
        tests/testString \
        tests/testURL \
@@ -1426,7 +1378,6 @@ tests_testCacheManager_SOURCES = \
        HttpMsg.cc \
        HttpReply.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -1499,6 +1450,7 @@ nodist_tests_testCacheManager_SOURCES = \
 tests_testCacheManager_LDADD = \
        libsquid.la \
        libauth.la \
+       libsquid-icmp.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
        @REGEXLIB@ \
@@ -1601,7 +1553,6 @@ tests_testEvent_SOURCES = \
        HttpMsg.cc \
        HttpReply.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -1759,7 +1710,6 @@ tests_testEventLoop_SOURCES = \
        HttpMsg.cc \
        HttpReply.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -1908,7 +1858,6 @@ tests_test_http_range_SOURCES = \
        HttpRequest.cc \
        HttpRequestMethod.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -2069,7 +2018,6 @@ tests_testHttpRequest_SOURCES = \
        HttpMsg.cc \
        HttpReply.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
@@ -2157,25 +2105,6 @@ tests_testHttpRequest_DEPENDENCIES =  $(top_builddir)/lib/libmiscutil.a \
        @SQUID_CPPUNIT_LA@ \
        ${ADAPTATION_LIBS}
 
-## 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.
@@ -2437,7 +2366,6 @@ tests_testURL_SOURCES = \
        HttpMsg.cc \
        HttpReply.cc \
        HttpStatusLine.cc \
-       $(ICMPSOURCE) \
        icp_v2.cc \
        icp_v3.cc \
        $(IDENT_SOURCE) \
similarity index 94%
rename from src/icmp.cc
rename to src/icmp/Icmp.cc
index ab4e77ec13c18005af1627897fdfc9504fed2ee0..029bff812d79ed158394c62f00ae1eab50ad1bec 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 deb9951d486d12f4162bdd6464611bf47cca193e..93dd630f2b32a7072296353d0b094dc72dc955a7 100644 (file)
@@ -86,16 +86,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 221d32def1693163c5fcf2e249e34eae2ba09f48..f9f2ecc108d9caa9aa4aac424c6e2aeda8da999a 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[] =
@@ -64,17 +64,17 @@ 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);
@@ -160,7 +160,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 d26739fc53bfed6c9c547ead97b65c717a965b76..8e414e90f5cfda4d8d46b1bbea8794c0c388aafe 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
@@ -164,11 +164,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();
 
@@ -181,7 +181,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 91%
rename from src/ICMPv6.cc
rename to src/icmp/Icmp6.cc
index c8d5bb0a2dd456feedfc854198d9f16c7041e4fa..190d97cd26d7d068adbcf979628cb083447cf878 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[] =
@@ -105,18 +105,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);
 
@@ -126,16 +126,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);
@@ -155,7 +155,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;
@@ -165,7 +165,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));
@@ -189,7 +189,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,
@@ -199,7 +199,7 @@ ICMPv6::SendEcho(IPAddress &to, int opcode, const char *payload, int len)
            S->ai_addrlen);
 
     if(x < 0) {
-        debugs(42, 1, HERE << "Error sending to ICMPv6 packet to " << to << ". ERR: " << xstrerror());
+        debugs(42, 1, HERE << "Error sending to Icmp6 packet to " << to << ". ERR: " << xstrerror());
     }
     debugs(42,9, HERE << "x=" << x);
 
@@ -207,10 +207,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;
@@ -222,7 +222,7 @@ ICMPv6::Recv(void)
     static pingerReplyData preply;
 
     if(icmp_sock < 0) {
-        debugs(42,0, HERE << "dropping ICMPv6 read. No socket!?");
+        debugs(42,0, HERE << "dropping Icmp6 read. No socket!?");
         return;
     }
 
@@ -265,7 +265,7 @@ struct ip6_hdr
 #define ip6_vfc                // N.A
 #define ip6_flow       // N/A
 #define ip6_plen       // payload length.
-#define ip6_nxt                // expect to be type 0x3a - ICMPv6
+#define ip6_nxt                // expect to be type 0x3a - Icmp6
 #define ip6_hlim       // MAX hops  (always 64, but no guarantee)
 #define ip6_hops       // HOPS!!!  (can it be true??)
 
@@ -302,7 +302,7 @@ debugs(42,0, HERE << "ip6_nxt=" << ip->ip6_nxt <<
     }
 
     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 60be4bc68b2ed94ea364456e1d4ce1a587423f66..1504b14134cc468260d5e1b37fe0192725bff081 100644 (file)
  * 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:
 
     /** \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 2daf56286f6821dbbe721b57d613736567935f15..9827f17bee224a3ce920538aca5158f962e1bc5e 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;
@@ -233,7 +233,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 bc9c89354de648bc292c7a04bfc9677e0ce6221b..95fccd231373adb64ba47384cf67233d8e9aae4c 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 8fbedae2c114ce098fd5605546b81f7a371f720a..659c6ba55626908c99f3c04529d7c54b0894e12d 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 93%
rename from src/tests/testICMP.cc
rename to src/icmp/testIcmp.cc
index 749a0a37fb7fe6bdddbb3cd9ffb0255577b3480c..0863ceda17d1a41a1911bbe4084623161ec2d4c9 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 da50d6722c95214511158770e846df25fc4e28d8..aeaf1e586fdbbf1cafc5fb98bc5f5565c0e68576 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 );