Socket: Introduce sub-directory structure for concrete protocols
g0dil [Tue, 24 Jul 2007 21:56:47 +0000 (21:56 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@349 270642c3-0616-0410-b53a-bc976706d245

64 files changed:
Examples/DVBAdapter/MPEdec.cc
Examples/DVBAdapter/ULEdec.cc
Examples/DVBAdapter/frontend.cc
Examples/MCSniffer/MCSniffer.cc
Examples/Sniffer/Sniffer.cc
Examples/TCPClientServer/client.cc
Examples/TCPClientServer/server.cc
Packets/DefaultBundle/IpV6Extensions.test.cc
Packets/DefaultBundle/IpV6Packet.cc
Packets/DefaultBundle/IpV6Packet.test.cc
Socket/Doxyfile
Socket/Protocols/BSDSocketProtocol.cc [moved from Socket/BSDSocketProtocol.cc with 98% similarity]
Socket/Protocols/BSDSocketProtocol.hh [moved from Socket/BSDSocketProtocol.hh with 99% similarity]
Socket/Protocols/DVB/DVBDemuxHandles.cc [moved from Socket/DVBDemuxHandles.cc with 100% similarity]
Socket/Protocols/DVB/DVBDemuxHandles.hh [moved from Socket/DVBDemuxHandles.hh with 96% similarity]
Socket/Protocols/DVB/DVBDemuxProtocol.cc [moved from Socket/DVBDemuxProtocol.cc with 98% similarity]
Socket/Protocols/DVB/DVBDemuxProtocol.hh [moved from Socket/DVBDemuxProtocol.hh with 98% similarity]
Socket/Protocols/DVB/DVBFrontendHandle.cc [moved from Socket/DVBFrontendHandle.cc with 98% similarity]
Socket/Protocols/DVB/DVBFrontendHandle.hh [moved from Socket/DVBFrontendHandle.hh with 92% similarity]
Socket/Protocols/DVB/SConscript [new file with mode: 0644]
Socket/Protocols/DVB/main.test.cc [copied from Socket/PacketSocketHandle.ct with 62% similarity]
Socket/Protocols/GenericAddressingPolicy.cc [moved from Socket/GenericAddressingPolicy.cc with 100% similarity]
Socket/Protocols/GenericAddressingPolicy.cti [moved from Socket/GenericAddressingPolicy.cti with 100% similarity]
Socket/Protocols/GenericAddressingPolicy.hh [moved from Socket/GenericAddressingPolicy.hh with 97% similarity]
Socket/Protocols/GenericSockAddr.cci [moved from Socket/GenericSockAddr.cci with 100% similarity]
Socket/Protocols/GenericSockAddr.hh [moved from Socket/GenericSockAddr.hh with 100% similarity]
Socket/Protocols/INet/INetAddressing.cc [moved from Socket/INetAddressing.cc with 100% similarity]
Socket/Protocols/INet/INetAddressing.cci [moved from Socket/INetAddressing.cci with 100% similarity]
Socket/Protocols/INet/INetAddressing.ct [moved from Socket/INetAddressing.ct with 100% similarity]
Socket/Protocols/INet/INetAddressing.hh [moved from Socket/INetAddressing.hh with 98% similarity]
Socket/Protocols/INet/INetAddressing.test.cc [moved from Socket/INetAddressing.test.cc with 100% similarity]
Socket/Protocols/INet/INetProtocol.cc [moved from Socket/INetProtocol.cc with 100% similarity]
Socket/Protocols/INet/INetProtocol.hh [moved from Socket/INetProtocol.hh with 97% similarity]
Socket/Protocols/INet/SConscript [new file with mode: 0644]
Socket/Protocols/INet/TCPProtocol.cc [moved from Socket/TCPProtocol.cc with 98% similarity]
Socket/Protocols/INet/TCPProtocol.hh [moved from Socket/TCPProtocol.hh with 98% similarity]
Socket/Protocols/INet/TCPSocketHandle.cc [moved from Socket/TCPSocketHandle.cc with 100% similarity]
Socket/Protocols/INet/TCPSocketHandle.hh [moved from Socket/TCPSocketHandle.hh with 97% similarity]
Socket/Protocols/INet/TCPSocketHandle.test.cc [moved from Socket/TCPSocketHandle.test.cc with 100% similarity]
Socket/Protocols/INet/UDPProtocol.cc [moved from Socket/UDPProtocol.cc with 99% similarity]
Socket/Protocols/INet/UDPProtocol.hh [moved from Socket/UDPProtocol.hh with 99% similarity]
Socket/Protocols/INet/UDPSocketHandle.cc [moved from Socket/UDPSocketHandle.cc with 100% similarity]
Socket/Protocols/INet/UDPSocketHandle.hh [moved from Socket/UDPSocketHandle.hh with 96% similarity]
Socket/Protocols/INet/UDPSocketHandle.test.cc [moved from Socket/UDPSocketHandle.test.cc with 100% similarity]
Socket/Protocols/INet/main.test.cc [copied from Socket/PacketSocketHandle.ct with 62% similarity]
Socket/Protocols/LLAddressing.cc [moved from Socket/LLAddressing.cc with 100% similarity]
Socket/Protocols/LLAddressing.cci [moved from Socket/LLAddressing.cci with 100% similarity]
Socket/Protocols/LLAddressing.ct [moved from Socket/LLAddressing.ct with 100% similarity]
Socket/Protocols/LLAddressing.cti [moved from Socket/LLAddressing.cti with 100% similarity]
Socket/Protocols/LLAddressing.hh [moved from Socket/LLAddressing.hh with 99% similarity]
Socket/Protocols/LLAddressing.ih [moved from Socket/LLAddressing.ih with 100% similarity]
Socket/Protocols/LLAddressing.test.cc [moved from Socket/LLAddressing.test.cc with 100% similarity]
Socket/Protocols/PacketSocketHandle.cc [moved from Socket/PacketSocketHandle.cc with 100% similarity]
Socket/Protocols/PacketSocketHandle.ct [copied from Socket/PacketSocketHandle.ct with 100% similarity]
Socket/Protocols/PacketSocketHandle.cti [moved from Socket/PacketSocketHandle.cti with 100% similarity]
Socket/Protocols/PacketSocketHandle.hh [moved from Socket/PacketSocketHandle.hh with 96% similarity]
Socket/Protocols/PacketSocketHandle.ih [moved from Socket/PacketSocketHandle.ih with 100% similarity]
Socket/Protocols/PacketSocketHandle.test.cc [moved from Socket/PacketSocketHandle.test.cc with 100% similarity]
Socket/Protocols/SConscript [new file with mode: 0644]
Socket/Protocols/main.test.cc [moved from Socket/PacketSocketHandle.ct with 62% similarity]
Socket/SConscript
Socket/SocketPolicy.hh
senfscons/BoostUnitTests.py
senfscons/SENFSCons.py

index 372e7be..48c6b82 100644 (file)
@@ -33,7 +33,7 @@
 #include "Packets/DefaultBundle/EthernetPacket.hh"
 #include "Packets/MPEGDVBBundle/DatagramSection.hh"
 #include "Utils/membind.hh"
-#include "Socket/DVBDemuxHandles.hh"
+#include "Socket/Protocols/DVB/DVBDemuxHandles.hh"
 #include "Packets/ParseInt.hh"
 #include "Packets/Packet.hh"
 #include "Packets/PacketData.hh"
index 02c5c31..2d2fd34 100644 (file)
@@ -33,7 +33,7 @@
 #include "Packets/DefaultBundle/EthernetPacket.hh"
 #include "Packets/MPEGDVBBundle/TransportPacket.hh"
 #include "Utils/membind.hh"
-#include "Socket/DVBDemuxHandles.hh"
+#include "Socket/Protocols/DVB/DVBDemuxHandles.hh"
 #include "Packets/ParseInt.hh"
 #include "Packets/Packet.hh"
 #include "Packets/PacketData.hh"
index 950ad22..d805bb4 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <string>
 #include <iostream>
-#include "Socket/DVBFrontendHandle.hh"
+#include "Socket/Protocols/DVB/DVBFrontendHandle.hh"
 
 #define prefix_
 ///////////////////////////////cc.p////////////////////////////////////////
index c4aded2..2cbb2a3 100644 (file)
@@ -28,7 +28,7 @@
 #include <fstream>
 #include <string>
 #include <iomanip>
-#include "Socket/UDPSocketHandle.hh"
+#include "Socket/Protocols/INet/UDPSocketHandle.hh"
 #include "Scheduler/Scheduler.hh"
 #include "Packets/DefaultBundle/EthernetPacket.hh"
 #include "Utils/membind.hh"
index a3234e8..f1210a5 100644 (file)
@@ -29,7 +29,7 @@
 #include <string>
 #include <iostream>
 #include <iomanip>
-#include "Socket/PacketSocketHandle.hh"
+#include "Socket/Protocols/PacketSocketHandle.hh"
 #include "Scheduler/Scheduler.hh"
 #include "Utils/membind.hh"
 #include "Packets/DefaultBundle/EthernetPacket.hh"
index e30c96e..b3b65e7 100644 (file)
@@ -23,8 +23,8 @@
 // Custom includes
 #include <iostream>
 #include <sstream>
-#include "Socket/TCPSocketHandle.hh"
-#include "Socket/INetAddressing.hh"
+#include "Socket/Protocols/INet/TCPSocketHandle.hh"
+#include "Socket/Protocols/INet/INetAddressing.hh"
 
 
 int main(int argc, char const * argv[])
index a3b0374..aba64d0 100644 (file)
@@ -29,8 +29,8 @@
 #include <iostream>
 #include "Scheduler/Scheduler.hh"
 #include "Utils/membind.hh"
-#include "Socket/TCPSocketHandle.hh"
-#include "Socket/INetAddressing.hh"
+#include "Socket/Protocols/INet/TCPSocketHandle.hh"
+#include "Socket/Protocols/INet/INetAddressing.hh"
 
 
 class Server
index 6c7a09b..728d9fe 100644 (file)
@@ -28,7 +28,7 @@
 #include "IpV6Extensions.hh"
 #include "IpV6Packet.hh"
 #include "UDPPacket.hh"
-#include "Socket/INetAddressing.hh"
+#include "Socket/Protocols/INet/INetAddressing.hh"
 
 #include <boost/test/auto_unit_test.hpp>
 #include <boost/test/test_tools.hpp>
index 7a72d0f..63c341a 100644 (file)
@@ -26,7 +26,7 @@
 
 // Custom includes
 #include "EthernetPacket.hh"
-#include "Socket/INetAddressing.hh"
+#include "Socket/Protocols/INet/INetAddressing.hh"
 
 //#include "IpV6Packet.mpp"
 #define prefix_
index f603c2b..9882ab5 100644 (file)
@@ -26,7 +26,7 @@
 
 // Custom includes
 #include "IpV6Packet.hh"
-#include "Socket/INetAddressing.hh"
+#include "Socket/Protocols/INet/INetAddressing.hh"
 #include "Packets/DataPacket.hh"
 
 #include <boost/test/auto_unit_test.hpp>
index 76ad2bb..9a93817 100644 (file)
@@ -3,4 +3,5 @@
 PROJECT_NAME = libSocket
 TAGFILES = "$(TOPDIR)/Utils/doc/Utils.tag"
 GENERATE_TAGFILE = doc/Socket.tag
+RECURSIVE = Yes
 
similarity index 98%
rename from Socket/BSDSocketProtocol.cc
rename to Socket/Protocols/BSDSocketProtocol.cc
index 889da3c..55b9c88 100644 (file)
@@ -30,7 +30,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include "SocketHandle.hh"
+#include "Socket/SocketHandle.hh"
 
 //#include "BSDSocketProtocol.mpp"
 #define prefix_
similarity index 99%
rename from Socket/BSDSocketProtocol.hh
rename to Socket/Protocols/BSDSocketProtocol.hh
index 3743f52..cd38828 100644 (file)
@@ -28,7 +28,7 @@
 
 // Custom includes
 #include <sys/time.h>
-#include "SocketProtocol.hh"
+#include "Socket/SocketProtocol.hh"
 
 //#include "BSDSocketProtocol.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
similarity index 96%
rename from Socket/DVBDemuxHandles.hh
rename to Socket/Protocols/DVB/DVBDemuxHandles.hh
index 2ef4996..2c839e6 100644 (file)
 #define HH_DVBDemuxHandles_ 1
 
 // Custom includes
-#include "BufferingPolicy.hh"
-#include "FramingPolicy.hh"
-#include "CommunicationPolicy.hh"
-#include "ReadWritePolicy.hh"
-#include "ProtocolClientSocketHandle.hh"
+#include "Socket/BufferingPolicy.hh"
+#include "Socket/FramingPolicy.hh"
+#include "Socket/CommunicationPolicy.hh"
+#include "Socket/ReadWritePolicy.hh"
+#include "Socket/ProtocolClientSocketHandle.hh"
 #include "DVBDemuxProtocol.hh"
 
 //#include "DVBDemuxHandles.mpp"
similarity index 98%
rename from Socket/DVBDemuxProtocol.cc
rename to Socket/Protocols/DVB/DVBDemuxProtocol.cc
index dcc3a62..141ab55 100644 (file)
@@ -33,7 +33,7 @@
 #include <string>
 #include <sys/ioctl.h>
 #include <linux/sockios.h>
-#include "SocketHandle.hh"
+#include "Socket/SocketHandle.hh"
 
 //#include "DVBDemuxProtocol.mpp"
 #define prefix_
similarity index 98%
rename from Socket/DVBDemuxProtocol.hh
rename to Socket/Protocols/DVB/DVBDemuxProtocol.hh
index 9e2f4d0..49f87b8 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/dvb/dmx.h> 
 
 // Custom includes
-#include "SocketProtocol.hh"
+#include "Socket/SocketProtocol.hh"
 
 //#include "DVBProtocol.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
similarity index 98%
rename from Socket/DVBFrontendHandle.cc
rename to Socket/Protocols/DVB/DVBFrontendHandle.cc
index 56110ae..b56fb84 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/sockios.h>
 #include <stdio.h>
 #include <fcntl.h>
-#include "SocketHandle.hh"
+#include "Socket/SocketHandle.hh"
 
 #include "Utils/Exception.hh"
 
similarity index 92%
rename from Socket/DVBFrontendHandle.hh
rename to Socket/Protocols/DVB/DVBFrontendHandle.hh
index 1ab1fb6..add8a45 100644 (file)
 #define HH_DVBFrontendHandle_ 1
 
 // Custom includes
-#include "BufferingPolicy.hh"
-#include "FramingPolicy.hh"
-#include "CommunicationPolicy.hh"
-#include "ReadWritePolicy.hh"
-#include "ProtocolClientSocketHandle.hh"
-#include "SocketProtocol.hh"
+#include "Socket/BufferingPolicy.hh"
+#include "Socket/FramingPolicy.hh"
+#include "Socket/CommunicationPolicy.hh"
+#include "Socket/ReadWritePolicy.hh"
+#include "Socket/ProtocolClientSocketHandle.hh"
+#include "Socket/SocketProtocol.hh"
 
 #include <linux/dvb/frontend.h> 
 
diff --git a/Socket/Protocols/DVB/SConscript b/Socket/Protocols/DVB/SConscript
new file mode 100644 (file)
index 0000000..4e77b00
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- python -*-
+
+Import('env')
+import SENFSCons, glob
+
+###########################################################################
+
+sources = SENFSCons.GlobSources()
+
+allob = []
+
+allob.extend(
+    SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Utils' ] ) )
+
+for sc in glob.glob("*/SConscript"):
+    ob = SConscript(sc)
+    if ob : allob.extend(ob)
+
+Return('allob')
similarity index 62%
copy from Socket/PacketSocketHandle.ct
copy to Socket/Protocols/DVB/main.test.cc
index 5a6eb0c..91e601d 100644 (file)
@@ -1,4 +1,4 @@
-// $Id$
+// $Id: main.test.cc 296 2007-07-10 20:39:34Z g0dil $
 //
 // Copyright (C) 2006
 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-/** \file
-    \brief PacketProtocol and PacketSocketHandle non-inline template implementation
- */
+// Definition of non-inline non-template functions
 
-#include "PacketSocketHandle.ih"
+//#include "test.hh"
+//#include "test.ih"
 
 // Custom includes
+#define BOOST_AUTO_TEST_MAIN
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/test/test_tools.hpp>
 
 #define prefix_
-///////////////////////////////ct.p////////////////////////////////////////
+///////////////////////////////cc.p////////////////////////////////////////
 
-template <class ForwardRange>
-prefix_ unsigned
-senf::detail::Range_LLAddressCopier<ForwardRange>::operator()(unsigned char * target)
-    const
-{
-    std::size_t len (0);
-    typename boost::range_const_iterator<ForwardRange>::type i (boost::begin(range_));
-    for (; i != boost::end(range_) && len<8; ++i, ++len, ++target)
-        *target = *i;
-    if (i != boost::end(range_))
-        throw InvalidLLSocketAddressException();
-    return len;
-}
 
-///////////////////////////////ct.e////////////////////////////////////////
+///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_
 
 \f
similarity index 97%
rename from Socket/GenericAddressingPolicy.hh
rename to Socket/Protocols/GenericAddressingPolicy.hh
index b8bcfc3..a289070 100644 (file)
 #define HH_GenericAddressingPolicy_ 1
 
 // Custom includes
-#include "SocketHandle.hh"
-#include "FileHandle.hh"
-#include "SocketPolicy.hh"
-#include "CommunicationPolicy.hh"
+#include "Socket/SocketHandle.hh"
+#include "Socket/FileHandle.hh"
+#include "Socket/SocketPolicy.hh"
+#include "Socket/CommunicationPolicy.hh"
 
 //#include "GenericAddressingPolicy.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
similarity index 98%
rename from Socket/INetAddressing.hh
rename to Socket/Protocols/INet/INetAddressing.hh
index a9f172c..db204ac 100644 (file)
 #include <string>
 #include <exception>
 #include <netinet/in.h>
-#include "SocketPolicy.hh"
-#include "ClientSocketHandle.hh"
-#include "CommunicationPolicy.hh"
-#include "GenericAddressingPolicy.hh"
+#include "Socket/SocketPolicy.hh"
+#include "Socket/ClientSocketHandle.hh"
+#include "Socket/CommunicationPolicy.hh"
+#include "Socket/Protocols/GenericAddressingPolicy.hh"
 
 //#include "INetAddressing.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
similarity index 97%
rename from Socket/INetProtocol.hh
rename to Socket/Protocols/INet/INetProtocol.hh
index df3cea1..4728855 100644 (file)
 #define HH_INetProtocol_ 1
 
 // Custom includes
-#include "SocketProtocol.hh"
+#include "Socket/SocketProtocol.hh"
 #include "INetAddressing.hh"
-#include "ClientSocketHandle.hh"
-#include "CommunicationPolicy.hh"
+#include "Socket/ClientSocketHandle.hh"
+#include "Socket/CommunicationPolicy.hh"
 
 //#include "INetProtocol.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
diff --git a/Socket/Protocols/INet/SConscript b/Socket/Protocols/INet/SConscript
new file mode 100644 (file)
index 0000000..4e77b00
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- python -*-
+
+Import('env')
+import SENFSCons, glob
+
+###########################################################################
+
+sources = SENFSCons.GlobSources()
+
+allob = []
+
+allob.extend(
+    SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Utils' ] ) )
+
+for sc in glob.glob("*/SConscript"):
+    ob = SConscript(sc)
+    if ob : allob.extend(ob)
+
+Return('allob')
similarity index 98%
rename from Socket/TCPProtocol.cc
rename to Socket/Protocols/INet/TCPProtocol.cc
index 57ffef8..8edb77f 100644 (file)
@@ -33,7 +33,7 @@
 #include <netinet/tcp.h>
 #include <sys/ioctl.h>
 #include <linux/sockios.h> // for SIOCINQ / SIOCOUTQ
-#include "SocketHandle.hh"
+#include "Socket/SocketHandle.hh"
 
 //#include "TCPProtocol.mpp"
 #define prefix_
similarity index 98%
rename from Socket/TCPProtocol.hh
rename to Socket/Protocols/INet/TCPProtocol.hh
index e229051..e94202c 100644 (file)
@@ -28,7 +28,7 @@
 #define HH_TCPProtocol_ 1
 
 // Custom includes
-#include "SocketProtocol.hh"
+#include "Socket/SocketProtocol.hh"
 
 //#include "TCPProtocol.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
similarity index 97%
rename from Socket/TCPSocketHandle.hh
rename to Socket/Protocols/INet/TCPSocketHandle.hh
index 2e00ee5..d0bb8bf 100644 (file)
 #include "Utils/pool_alloc_mixin.hh"
 #include "INetProtocol.hh"
 #include "TCPProtocol.hh"
-#include "BSDSocketProtocol.hh"
-#include "FramingPolicy.hh"
-#include "CommunicationPolicy.hh"
-#include "ReadWritePolicy.hh"
-#include "BufferingPolicy.hh"
-#include "ProtocolClientSocketHandle.hh"
-#include "ProtocolServerSocketHandle.hh"
+#include "Socket/Protocols/BSDSocketProtocol.hh"
+#include "Socket/FramingPolicy.hh"
+#include "Socket/CommunicationPolicy.hh"
+#include "Socket/ReadWritePolicy.hh"
+#include "Socket/BufferingPolicy.hh"
+#include "Socket/ProtocolClientSocketHandle.hh"
+#include "Socket/ProtocolServerSocketHandle.hh"
 
 //#include "TCPSocketHandle.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
similarity index 99%
rename from Socket/UDPProtocol.cc
rename to Socket/Protocols/INet/UDPProtocol.cc
index af5d91e..593eb1a 100644 (file)
@@ -34,7 +34,7 @@
 #include <sys/ioctl.h>
 #include <linux/sockios.h> // for SIOCINQ / SIOCOUTQ
 #include <net/if.h> // for if_nametoindex
-#include "SocketHandle.hh"
+#include "Socket/SocketHandle.hh"
 
 //#include "UDPProtocol.mpp"
 #define prefix_
similarity index 99%
rename from Socket/UDPProtocol.hh
rename to Socket/Protocols/INet/UDPProtocol.hh
index 55ab314..58412c1 100644 (file)
@@ -28,7 +28,7 @@
 #define HH_UDPProtocol_ 1
 
 // Custom includes
-#include "SocketProtocol.hh"
+#include "Socket/SocketProtocol.hh"
 #include "INetAddressing.hh"
 
 //#include "UDPProtocol.mpp"
similarity index 96%
rename from Socket/UDPSocketHandle.hh
rename to Socket/Protocols/INet/UDPSocketHandle.hh
index f10d960..1a1e93d 100644 (file)
 // Custom includes
 #include "INetProtocol.hh"
 #include "UDPProtocol.hh"
-#include "BSDSocketProtocol.hh"
-#include "FramingPolicy.hh"
-#include "CommunicationPolicy.hh"
-#include "ReadWritePolicy.hh"
-#include "BufferingPolicy.hh"
-#include "ProtocolClientSocketHandle.hh"
+#include "Socket/Protocols/BSDSocketProtocol.hh"
+#include "Socket/FramingPolicy.hh"
+#include "Socket/CommunicationPolicy.hh"
+#include "Socket/ReadWritePolicy.hh"
+#include "Socket/BufferingPolicy.hh"
+#include "Socket/ProtocolClientSocketHandle.hh"
 
 //#include "UDPSocketHandle.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
similarity index 62%
copy from Socket/PacketSocketHandle.ct
copy to Socket/Protocols/INet/main.test.cc
index 5a6eb0c..91e601d 100644 (file)
@@ -1,4 +1,4 @@
-// $Id$
+// $Id: main.test.cc 296 2007-07-10 20:39:34Z g0dil $
 //
 // Copyright (C) 2006
 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-/** \file
-    \brief PacketProtocol and PacketSocketHandle non-inline template implementation
- */
+// Definition of non-inline non-template functions
 
-#include "PacketSocketHandle.ih"
+//#include "test.hh"
+//#include "test.ih"
 
 // Custom includes
+#define BOOST_AUTO_TEST_MAIN
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/test/test_tools.hpp>
 
 #define prefix_
-///////////////////////////////ct.p////////////////////////////////////////
+///////////////////////////////cc.p////////////////////////////////////////
 
-template <class ForwardRange>
-prefix_ unsigned
-senf::detail::Range_LLAddressCopier<ForwardRange>::operator()(unsigned char * target)
-    const
-{
-    std::size_t len (0);
-    typename boost::range_const_iterator<ForwardRange>::type i (boost::begin(range_));
-    for (; i != boost::end(range_) && len<8; ++i, ++len, ++target)
-        *target = *i;
-    if (i != boost::end(range_))
-        throw InvalidLLSocketAddressException();
-    return len;
-}
 
-///////////////////////////////ct.e////////////////////////////////////////
+///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_
 
 \f
similarity index 99%
rename from Socket/LLAddressing.hh
rename to Socket/Protocols/LLAddressing.hh
index 4182305..1240d0c 100644 (file)
@@ -35,8 +35,8 @@
 #include <sys/socket.h>
 #include <netpacket/packet.h>
 
-#include "SocketPolicy.hh"
-#include "FileHandle.hh"
+#include "Socket/SocketPolicy.hh"
+#include "Socket/FileHandle.hh"
 #include "GenericAddressingPolicy.hh"
 
 //#include "LLAddressing.mpp"
similarity index 96%
rename from Socket/PacketSocketHandle.hh
rename to Socket/Protocols/PacketSocketHandle.hh
index 8282476..0715ec6 100644 (file)
 #define HH_PacketSocketHandle_ 1
 
 // Custom includes
-#include "SocketPolicy.hh"
-#include "SocketProtocol.hh"
-#include "ProtocolClientSocketHandle.hh"
+#include "Socket/SocketPolicy.hh"
+#include "Socket/SocketProtocol.hh"
+#include "Socket/ProtocolClientSocketHandle.hh"
+#include "Socket/FramingPolicy.hh"
+#include "Socket/CommunicationPolicy.hh"
+#include "Socket/ReadWritePolicy.hh"
+#include "Socket/BufferingPolicy.hh"
 #include "LLAddressing.hh"
-#include "FramingPolicy.hh"
-#include "CommunicationPolicy.hh"
-#include "ReadWritePolicy.hh"
-#include "BufferingPolicy.hh"
 #include "BSDSocketProtocol.hh"
 
 //#include "PacketSocketHandle.mpp"
diff --git a/Socket/Protocols/SConscript b/Socket/Protocols/SConscript
new file mode 100644 (file)
index 0000000..4e77b00
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- python -*-
+
+Import('env')
+import SENFSCons, glob
+
+###########################################################################
+
+sources = SENFSCons.GlobSources()
+
+allob = []
+
+allob.extend(
+    SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Utils' ] ) )
+
+for sc in glob.glob("*/SConscript"):
+    ob = SConscript(sc)
+    if ob : allob.extend(ob)
+
+Return('allob')
similarity index 62%
rename from Socket/PacketSocketHandle.ct
rename to Socket/Protocols/main.test.cc
index 5a6eb0c..91e601d 100644 (file)
@@ -1,4 +1,4 @@
-// $Id$
+// $Id: main.test.cc 296 2007-07-10 20:39:34Z g0dil $
 //
 // Copyright (C) 2006
 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-/** \file
-    \brief PacketProtocol and PacketSocketHandle non-inline template implementation
- */
+// Definition of non-inline non-template functions
 
-#include "PacketSocketHandle.ih"
+//#include "test.hh"
+//#include "test.ih"
 
 // Custom includes
+#define BOOST_AUTO_TEST_MAIN
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/test/test_tools.hpp>
 
 #define prefix_
-///////////////////////////////ct.p////////////////////////////////////////
+///////////////////////////////cc.p////////////////////////////////////////
 
-template <class ForwardRange>
-prefix_ unsigned
-senf::detail::Range_LLAddressCopier<ForwardRange>::operator()(unsigned char * target)
-    const
-{
-    std::size_t len (0);
-    typename boost::range_const_iterator<ForwardRange>::type i (boost::begin(range_));
-    for (; i != boost::end(range_) && len<8; ++i, ++len, ++target)
-        *target = *i;
-    if (i != boost::end(range_))
-        throw InvalidLLSocketAddressException();
-    return len;
-}
 
-///////////////////////////////ct.e////////////////////////////////////////
+///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_
 
 \f
index 5887b53..41dd658 100644 (file)
@@ -2,17 +2,24 @@
 
 Import('env')
 import SENFSCons
+import glob
 
 ###########################################################################
 
-sources = SENFSCons.GlobSources()
+sources, testSources = SENFSCons.GlobSources()
 
 SENFSCons.StandardTargets(env)
 
+subob = []
+for sc in glob.glob("*/SConscript"):
+    ob = SConscript(sc)
+    if ob : subob.extend(ob)
+
 SENFSCons.Lib(env,
-             library = 'Socket',
-             sources = sources,
-             LIBS = [ 'Utils' ])
+              library = 'Socket',
+              sources = sources + subob,
+              testSources = testSources,
+              LIBS = [ 'Utils' ])
 
 SENFSCons.Doxygen(env, extra_sources = [
     env.Dia2Png('SocketLibrary-classes.dia'),
index cb83e11..324d07c 100644 (file)
 
 // Custom includes
 
-#include "GenericSockAddr.hh"
-
 //#include "SocketPolicy.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
 
@@ -309,7 +307,7 @@ namespace senf {
     {
         virtual ~AddressingPolicyBase() {}
 
-        typedef GenericSockAddr Address;
+        class Address { Address(); };
     };
 
     /** \brief Policy defining the framing format
index 2dce3ba..09d340a 100644 (file)
@@ -26,22 +26,22 @@ import SCons.Defaults
 import os.path
 import os
 
-def BoostUnitTests(env, target, source, test_source=None, LIBS = [], OBJECTS = [], DEPENDS = [], **kw):
+def BoostUnitTests(env, target, objects, test_sources=None, LIBS = [], OBJECTS = [], DEPENDS = [], **kw):
     path, name = os.path.split(target)
-    if test_source:
-        if type(test_source) is not type([]):
-            test_source = [ test_source ]
+    if test_sources:
+        if type(test_sources) is not type([]):
+            test_sources = [ test_sources ]
     else:
-        test_source = []
+        test_sources = []
     testEnv = env.Copy(**kw)
     testEnv.Prepend(LIBS = '$BOOSTTESTLIB')
     testEnv.Prepend(LIBS = LIBS)
-    sources = []
-    if source:
-        sources = sources + env.Object(source) + OBJECTS
-    sources = sources + test_source
+    all_objects = []
+    if not objects:
+        objects = []
+    all_objects = objects + env.Object(test_sources) + OBJECTS
     binName = os.path.join(path,'.' + name +'.bin')
-    testRunner = testEnv.Program(binName, sources)
+    testRunner = testEnv.Program(binName, all_objects)
     stamp = os.path.join(path,'.' + os.path.splitext(name)[0]+'.stamp')
     if DEPENDS:
         env.Depends(testRunner, DEPENDS)
index 13be755..a4a3620 100644 (file)
@@ -296,16 +296,25 @@ def Objects(env, sources, testSources = None, LIBS = [], OBJECTS = []):
     if type(sources) == type(()):
         testSources = sources[1]
         sources = sources[0]
+    if type(sources) is not type([]):
+        sources = [ sources ]
 
     objects = None
     if sources:
-        objects = env.Object(sources)
+        objects = env.Object([
+            source
+            for source in sources
+            if not str(source).endswith('.o') ]) + [
+            source
+            for source in sources
+            if str(source).endswith('.o') ]
+        
 
     if testSources:
         test = env.BoostUnitTests(
             target = 'test',
-            source = sources,
-            test_source = testSources,
+            objects = objects,
+            test_sources = testSources,
             LIBS = LIBS,
             OBJECTS = OBJECTS,
             DEPENDS = [ env.File(LibPath(x)) for x in LIBS ])