]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish client-side: make TcpAcceptor fill out EUI details
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 8 May 2013 03:02:01 +0000 (21:02 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 8 May 2013 03:02:01 +0000 (21:02 -0600)
The scope of TcpAcceptor is to receive new TCP connections and to fill
out the state data about the new connectino as much as possible.
EUI details about the client come under that state management.

This change makes EUI details available about https_port and FTP data
connections.

src/Makefile.am
src/client_side.cc
src/comm/TcpAcceptor.cc
src/tests/stub_libeui.cc [new file with mode: 0644]

index 17742fbf491c1356cdabf203af6bde442a91103a..95bf17430b9cfafebde3a7b268c8a6572863eba5 100644 (file)
@@ -615,7 +615,6 @@ squid_LDADD = \
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        $(DISK_LIBS) \
@@ -1583,7 +1582,6 @@ tests_testCacheManager_LDADD = \
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
@@ -1592,6 +1590,7 @@ tests_testCacheManager_LDADD = \
        ip/libip.la \
        fs/libfs.la \
        comm/libcomm.la \
+       eui/libeui.la \
        icmp/libicmp.la icmp/libicmp-core.la \
        log/liblog.la \
        format/libformat.la \
@@ -1725,6 +1724,7 @@ tests_testDiskIO_SOURCES = \
        tests/stub_internal.cc \
        tests/stub_ipc.cc \
        tests/stub_ipcache.cc \
+       tests/stub_libeui.cc \
        tests/stub_libformat.cc \
        tests/stub_libicmp.cc \
        tests/stub_MemStore.cc \
@@ -1765,7 +1765,6 @@ tests_testDiskIO_LDADD = \
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        libsquid.la \
@@ -1980,6 +1979,7 @@ tests_testEvent_SOURCES = \
        tests/testMain.cc \
        tests/stub_main_cc.cc \
        tests/stub_ipc_Forwarder.cc \
+       tests/stub_libeui.cc \
        tests/stub_store_stats.cc \
        time.cc \
        tools.h \
@@ -2006,7 +2006,6 @@ tests_testEvent_LDADD = \
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
@@ -2226,6 +2225,7 @@ tests_testEventLoop_SOURCES = \
        tests/testMain.cc \
        tests/stub_main_cc.cc \
        tests/stub_ipc_Forwarder.cc \
+       tests/stub_libeui.cc \
        tests/stub_store_stats.cc \
        time.cc \
        tools.h \
@@ -2252,7 +2252,6 @@ tests_testEventLoop_LDADD = \
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
@@ -2465,6 +2464,7 @@ tests_test_http_range_SOURCES = \
        SwapDir.cc \
        tests/test_http_range.cc \
        tests/stub_ipc_Forwarder.cc \
+       tests/stub_libeui.cc \
        tests/stub_main_cc.cc \
        tests/stub_MemStore.cc \
        tests/stub_store_stats.cc \
@@ -2492,7 +2492,6 @@ tests_test_http_range_LDADD = \
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
@@ -2588,6 +2587,7 @@ tests_testHttpRequest_SOURCES = \
        tests/stub_DiskIOModule.cc \
        tests/stub_main_cc.cc \
        tests/stub_ipc_Forwarder.cc \
+       tests/stub_libeui.cc \
        tests/stub_store_stats.cc \
        time.cc \
        BodyPipe.cc \
@@ -2770,7 +2770,6 @@ tests_testHttpRequest_LDADD = \
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
@@ -2903,6 +2902,7 @@ tests_testStore_SOURCES= \
        tests/stub_helper.cc \
        tests/stub_HelperChildConfig.cc \
        tests/stub_http.cc \
+       tests/stub_libeui.cc \
        tests/stub_libformat.cc \
        HttpBody.h \
        HttpBody.cc \
@@ -2951,7 +2951,6 @@ tests_testStore_LDADD= \
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
@@ -3022,7 +3021,6 @@ SWAP_TEST_DS =\
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
@@ -3044,6 +3042,7 @@ tests_testUfs_SOURCES = \
        tests/stub_HelperChildConfig.cc \
        tests/stub_icp.cc \
        tests/stub_ipc.cc \
+       tests/stub_libeui.cc \
        tests/stub_MemStore.cc \
        tests/stub_pconn.cc \
        tests/stub_Port.cc \
@@ -3177,7 +3176,6 @@ tests_testUfs_LDADD = \
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
@@ -3320,6 +3318,7 @@ tests_testRock_SOURCES = \
        tests/stub_icp.cc \
        tests/stub_ipc.cc \
        tests/stub_ipcache.cc \
+       tests/stub_libeui.cc \
        tests/stub_libformat.cc \
        tests/stub_libicmp.cc \
        tests/stub_MemStore.cc \
@@ -3362,7 +3361,6 @@ tests_testRock_LDADD = \
        acl/libacls.la \
        acl/libapi.la \
        acl/libstate.la \
-       eui/libeui.la \
        ipc/libipc.la \
        mgr/libmgr.la \
        base/libbase.la \
@@ -3391,6 +3389,7 @@ tests_testCoss_SOURCES = \
        internal.h \
        tests/stub_internal.cc \
        tests/stub_ipc.cc \
+       tests/stub_libeui.cc \
        tests/stub_pconn.cc \
        store_rebuild.h \
        tests/stub_store_rebuild.cc \
@@ -3514,7 +3513,6 @@ tests_testCoss_LDADD = \
        $(AUTH_ACL_LIBS) \
        ident/libident.la \
        acl/libacls.la \
-       eui/libeui.la \
        acl/libstate.la \
        $(AUTH_LIBS) \
        acl/libapi.la \
index 2d11315498bd8ed335c9c9b3ffa0c6f1a9af7d71..f9061a3cafedb806efda6c9fe45de0fa271997e7 100644 (file)
@@ -98,7 +98,6 @@
 #include "comm/Write.h"
 #include "CommCalls.h"
 #include "errorpage.h"
-#include "eui/Config.h"
 #include "fd.h"
 #include "fde.h"
 #include "forward.h"
@@ -3409,16 +3408,6 @@ connStateCreate(const Comm::ConnectionPointer &client, AnyP::PortCfg *port)
     }
 #endif
 
-#if USE_SQUID_EUI
-    if (Eui::TheConfig.euiLookup) {
-        if (client->remote.IsIPv4()) {
-            result->clientConnection->remoteEui48.lookup(client->remote);
-        } else if (client->remote.IsIPv6()) {
-            result->clientConnection->remoteEui64.lookup(client->remote);
-        }
-    }
-#endif
-
     clientdbEstablished(client->remote, 1);
 
     result->flags.readMore = true;
index 1696e797a9cbdb3a19b4afcbd41d7f74844e5b2b..c95cbac44bc2410e0f46b1161a645769e204bf87 100644 (file)
@@ -41,6 +41,7 @@
 #include "comm/Connection.h"
 #include "comm/Loops.h"
 #include "comm/TcpAcceptor.h"
+#include "eui/Config.h"
 #include "fd.h"
 #include "fde.h"
 #include "globals.h"
@@ -381,6 +382,16 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
         return COMM_ERROR;
     }
 
+#if USE_SQUID_EUI
+    if (Eui::TheConfig.euiLookup) {
+        if (conn->remote.IsIPv4()) {
+            conn->remoteEui48.lookup(conn->remote);
+        } else if (conn->remote.IsIPv6()) {
+            conn->remoteEui64.lookup(conn->remote);
+        }
+    }
+#endif
+
     PROF_stop(comm_accept);
     return COMM_OK;
 }
diff --git a/src/tests/stub_libeui.cc b/src/tests/stub_libeui.cc
new file mode 100644 (file)
index 0000000..3bb9584
--- /dev/null
@@ -0,0 +1,25 @@
+#include "squid.h"
+
+#define STUB_API "eui/libeui.la"
+#include "STUB.h"
+
+#include "eui/Config.h"
+Eui::EuiConfig Eui::TheConfig;
+
+#include "eui/Eui48.h"
+#if USE_SQUID_EUI
+    const unsigned char *Eui::Eui48::get(void) STUB_RETVAL(NULL)
+    bool Eui::Eui48::decode(const char *asc) STUB_RETVAL(false)
+    bool Eui::Eui48::encode(char *buf, const int len) STUB_RETVAL(false)
+    bool Eui::Eui48::lookup(const Ip::Address &c) STUB_RETVAL(false)
+#endif
+
+#include "eui/Eui64.h"
+#if USE_SQUID_EUI
+    const unsigned char *Eui::Eui64::get(void) STUB_RETVAL(NULL)
+    bool Eui::Eui64::decode(const char *asc) STUB_RETVAL(false)
+    bool Eui::Eui64::encode(char *buf, const int len) STUB_RETVAL(false)
+    bool Eui::Eui64::lookup(const Ip::Address &c) STUB_RETVAL(false)
+    bool Eui::Eui64::lookupNdp(const Ip::Address &c) STUB_RETVAL(false)
+    bool Eui::Eui64::lookupSlaac(const Ip::Address &c) STUB_RETVAL(false)
+#endif