From: g0dil Date: Tue, 24 Jul 2007 21:56:47 +0000 (+0000) Subject: Socket: Introduce sub-directory structure for concrete protocols X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=2c4c9deecc7491fbfc916aeb41074dcb76e8a2c2;p=senf.git Socket: Introduce sub-directory structure for concrete protocols git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@349 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Examples/DVBAdapter/MPEdec.cc b/Examples/DVBAdapter/MPEdec.cc index 372e7be..48c6b82 100644 --- a/Examples/DVBAdapter/MPEdec.cc +++ b/Examples/DVBAdapter/MPEdec.cc @@ -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" diff --git a/Examples/DVBAdapter/ULEdec.cc b/Examples/DVBAdapter/ULEdec.cc index 02c5c31..2d2fd34 100644 --- a/Examples/DVBAdapter/ULEdec.cc +++ b/Examples/DVBAdapter/ULEdec.cc @@ -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" diff --git a/Examples/DVBAdapter/frontend.cc b/Examples/DVBAdapter/frontend.cc index 950ad22..d805bb4 100644 --- a/Examples/DVBAdapter/frontend.cc +++ b/Examples/DVBAdapter/frontend.cc @@ -22,7 +22,7 @@ #include #include -#include "Socket/DVBFrontendHandle.hh" +#include "Socket/Protocols/DVB/DVBFrontendHandle.hh" #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// diff --git a/Examples/MCSniffer/MCSniffer.cc b/Examples/MCSniffer/MCSniffer.cc index c4aded2..2cbb2a3 100644 --- a/Examples/MCSniffer/MCSniffer.cc +++ b/Examples/MCSniffer/MCSniffer.cc @@ -28,7 +28,7 @@ #include #include #include -#include "Socket/UDPSocketHandle.hh" +#include "Socket/Protocols/INet/UDPSocketHandle.hh" #include "Scheduler/Scheduler.hh" #include "Packets/DefaultBundle/EthernetPacket.hh" #include "Utils/membind.hh" diff --git a/Examples/Sniffer/Sniffer.cc b/Examples/Sniffer/Sniffer.cc index a3234e8..f1210a5 100644 --- a/Examples/Sniffer/Sniffer.cc +++ b/Examples/Sniffer/Sniffer.cc @@ -29,7 +29,7 @@ #include #include #include -#include "Socket/PacketSocketHandle.hh" +#include "Socket/Protocols/PacketSocketHandle.hh" #include "Scheduler/Scheduler.hh" #include "Utils/membind.hh" #include "Packets/DefaultBundle/EthernetPacket.hh" diff --git a/Examples/TCPClientServer/client.cc b/Examples/TCPClientServer/client.cc index e30c96e..b3b65e7 100644 --- a/Examples/TCPClientServer/client.cc +++ b/Examples/TCPClientServer/client.cc @@ -23,8 +23,8 @@ // Custom includes #include #include -#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[]) diff --git a/Examples/TCPClientServer/server.cc b/Examples/TCPClientServer/server.cc index a3b0374..aba64d0 100644 --- a/Examples/TCPClientServer/server.cc +++ b/Examples/TCPClientServer/server.cc @@ -29,8 +29,8 @@ #include #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 diff --git a/Packets/DefaultBundle/IpV6Extensions.test.cc b/Packets/DefaultBundle/IpV6Extensions.test.cc index 6c7a09b..728d9fe 100644 --- a/Packets/DefaultBundle/IpV6Extensions.test.cc +++ b/Packets/DefaultBundle/IpV6Extensions.test.cc @@ -28,7 +28,7 @@ #include "IpV6Extensions.hh" #include "IpV6Packet.hh" #include "UDPPacket.hh" -#include "Socket/INetAddressing.hh" +#include "Socket/Protocols/INet/INetAddressing.hh" #include #include diff --git a/Packets/DefaultBundle/IpV6Packet.cc b/Packets/DefaultBundle/IpV6Packet.cc index 7a72d0f..63c341a 100644 --- a/Packets/DefaultBundle/IpV6Packet.cc +++ b/Packets/DefaultBundle/IpV6Packet.cc @@ -26,7 +26,7 @@ // Custom includes #include "EthernetPacket.hh" -#include "Socket/INetAddressing.hh" +#include "Socket/Protocols/INet/INetAddressing.hh" //#include "IpV6Packet.mpp" #define prefix_ diff --git a/Packets/DefaultBundle/IpV6Packet.test.cc b/Packets/DefaultBundle/IpV6Packet.test.cc index f603c2b..9882ab5 100644 --- a/Packets/DefaultBundle/IpV6Packet.test.cc +++ b/Packets/DefaultBundle/IpV6Packet.test.cc @@ -26,7 +26,7 @@ // Custom includes #include "IpV6Packet.hh" -#include "Socket/INetAddressing.hh" +#include "Socket/Protocols/INet/INetAddressing.hh" #include "Packets/DataPacket.hh" #include diff --git a/Socket/Doxyfile b/Socket/Doxyfile index 76ad2bb..9a93817 100644 --- a/Socket/Doxyfile +++ b/Socket/Doxyfile @@ -3,4 +3,5 @@ PROJECT_NAME = libSocket TAGFILES = "$(TOPDIR)/Utils/doc/Utils.tag" GENERATE_TAGFILE = doc/Socket.tag +RECURSIVE = Yes diff --git a/Socket/BSDSocketProtocol.cc b/Socket/Protocols/BSDSocketProtocol.cc similarity index 98% rename from Socket/BSDSocketProtocol.cc rename to Socket/Protocols/BSDSocketProtocol.cc index 889da3c..55b9c88 100644 --- a/Socket/BSDSocketProtocol.cc +++ b/Socket/Protocols/BSDSocketProtocol.cc @@ -30,7 +30,7 @@ #include #include #include -#include "SocketHandle.hh" +#include "Socket/SocketHandle.hh" //#include "BSDSocketProtocol.mpp" #define prefix_ diff --git a/Socket/BSDSocketProtocol.hh b/Socket/Protocols/BSDSocketProtocol.hh similarity index 99% rename from Socket/BSDSocketProtocol.hh rename to Socket/Protocols/BSDSocketProtocol.hh index 3743f52..cd38828 100644 --- a/Socket/BSDSocketProtocol.hh +++ b/Socket/Protocols/BSDSocketProtocol.hh @@ -28,7 +28,7 @@ // Custom includes #include -#include "SocketProtocol.hh" +#include "Socket/SocketProtocol.hh" //#include "BSDSocketProtocol.mpp" ///////////////////////////////hh.p//////////////////////////////////////// diff --git a/Socket/DVBDemuxHandles.cc b/Socket/Protocols/DVB/DVBDemuxHandles.cc similarity index 100% rename from Socket/DVBDemuxHandles.cc rename to Socket/Protocols/DVB/DVBDemuxHandles.cc diff --git a/Socket/DVBDemuxHandles.hh b/Socket/Protocols/DVB/DVBDemuxHandles.hh similarity index 96% rename from Socket/DVBDemuxHandles.hh rename to Socket/Protocols/DVB/DVBDemuxHandles.hh index 2ef4996..2c839e6 100644 --- a/Socket/DVBDemuxHandles.hh +++ b/Socket/Protocols/DVB/DVBDemuxHandles.hh @@ -28,11 +28,11 @@ #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" diff --git a/Socket/DVBDemuxProtocol.cc b/Socket/Protocols/DVB/DVBDemuxProtocol.cc similarity index 98% rename from Socket/DVBDemuxProtocol.cc rename to Socket/Protocols/DVB/DVBDemuxProtocol.cc index dcc3a62..141ab55 100644 --- a/Socket/DVBDemuxProtocol.cc +++ b/Socket/Protocols/DVB/DVBDemuxProtocol.cc @@ -33,7 +33,7 @@ #include #include #include -#include "SocketHandle.hh" +#include "Socket/SocketHandle.hh" //#include "DVBDemuxProtocol.mpp" #define prefix_ diff --git a/Socket/DVBDemuxProtocol.hh b/Socket/Protocols/DVB/DVBDemuxProtocol.hh similarity index 98% rename from Socket/DVBDemuxProtocol.hh rename to Socket/Protocols/DVB/DVBDemuxProtocol.hh index 9e2f4d0..49f87b8 100644 --- a/Socket/DVBDemuxProtocol.hh +++ b/Socket/Protocols/DVB/DVBDemuxProtocol.hh @@ -30,7 +30,7 @@ #include // Custom includes -#include "SocketProtocol.hh" +#include "Socket/SocketProtocol.hh" //#include "DVBProtocol.mpp" ///////////////////////////////hh.p//////////////////////////////////////// diff --git a/Socket/DVBFrontendHandle.cc b/Socket/Protocols/DVB/DVBFrontendHandle.cc similarity index 98% rename from Socket/DVBFrontendHandle.cc rename to Socket/Protocols/DVB/DVBFrontendHandle.cc index 56110ae..b56fb84 100644 --- a/Socket/DVBFrontendHandle.cc +++ b/Socket/Protocols/DVB/DVBFrontendHandle.cc @@ -36,7 +36,7 @@ #include #include #include -#include "SocketHandle.hh" +#include "Socket/SocketHandle.hh" #include "Utils/Exception.hh" diff --git a/Socket/DVBFrontendHandle.hh b/Socket/Protocols/DVB/DVBFrontendHandle.hh similarity index 92% rename from Socket/DVBFrontendHandle.hh rename to Socket/Protocols/DVB/DVBFrontendHandle.hh index 1ab1fb6..add8a45 100644 --- a/Socket/DVBFrontendHandle.hh +++ b/Socket/Protocols/DVB/DVBFrontendHandle.hh @@ -28,12 +28,12 @@ #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 diff --git a/Socket/Protocols/DVB/SConscript b/Socket/Protocols/DVB/SConscript new file mode 100644 index 0000000..4e77b00 --- /dev/null +++ b/Socket/Protocols/DVB/SConscript @@ -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') diff --git a/Socket/PacketSocketHandle.ct b/Socket/Protocols/DVB/main.test.cc similarity index 62% copy from Socket/PacketSocketHandle.ct copy to Socket/Protocols/DVB/main.test.cc index 5a6eb0c..91e601d 100644 --- a/Socket/PacketSocketHandle.ct +++ b/Socket/Protocols/DVB/main.test.cc @@ -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) @@ -20,32 +20,21 @@ // 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 +#include #define prefix_ -///////////////////////////////ct.p//////////////////////////////////////// +///////////////////////////////cc.p//////////////////////////////////////// -template -prefix_ unsigned -senf::detail::Range_LLAddressCopier::operator()(unsigned char * target) - const -{ - std::size_t len (0); - typename boost::range_const_iterator::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_ diff --git a/Socket/GenericAddressingPolicy.cc b/Socket/Protocols/GenericAddressingPolicy.cc similarity index 100% rename from Socket/GenericAddressingPolicy.cc rename to Socket/Protocols/GenericAddressingPolicy.cc diff --git a/Socket/GenericAddressingPolicy.cti b/Socket/Protocols/GenericAddressingPolicy.cti similarity index 100% rename from Socket/GenericAddressingPolicy.cti rename to Socket/Protocols/GenericAddressingPolicy.cti diff --git a/Socket/GenericAddressingPolicy.hh b/Socket/Protocols/GenericAddressingPolicy.hh similarity index 97% rename from Socket/GenericAddressingPolicy.hh rename to Socket/Protocols/GenericAddressingPolicy.hh index b8bcfc3..a289070 100644 --- a/Socket/GenericAddressingPolicy.hh +++ b/Socket/Protocols/GenericAddressingPolicy.hh @@ -28,10 +28,10 @@ #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//////////////////////////////////////// diff --git a/Socket/GenericSockAddr.cci b/Socket/Protocols/GenericSockAddr.cci similarity index 100% rename from Socket/GenericSockAddr.cci rename to Socket/Protocols/GenericSockAddr.cci diff --git a/Socket/GenericSockAddr.hh b/Socket/Protocols/GenericSockAddr.hh similarity index 100% rename from Socket/GenericSockAddr.hh rename to Socket/Protocols/GenericSockAddr.hh diff --git a/Socket/INetAddressing.cc b/Socket/Protocols/INet/INetAddressing.cc similarity index 100% rename from Socket/INetAddressing.cc rename to Socket/Protocols/INet/INetAddressing.cc diff --git a/Socket/INetAddressing.cci b/Socket/Protocols/INet/INetAddressing.cci similarity index 100% rename from Socket/INetAddressing.cci rename to Socket/Protocols/INet/INetAddressing.cci diff --git a/Socket/INetAddressing.ct b/Socket/Protocols/INet/INetAddressing.ct similarity index 100% rename from Socket/INetAddressing.ct rename to Socket/Protocols/INet/INetAddressing.ct diff --git a/Socket/INetAddressing.hh b/Socket/Protocols/INet/INetAddressing.hh similarity index 98% rename from Socket/INetAddressing.hh rename to Socket/Protocols/INet/INetAddressing.hh index a9f172c..db204ac 100644 --- a/Socket/INetAddressing.hh +++ b/Socket/Protocols/INet/INetAddressing.hh @@ -31,10 +31,10 @@ #include #include #include -#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//////////////////////////////////////// diff --git a/Socket/INetAddressing.test.cc b/Socket/Protocols/INet/INetAddressing.test.cc similarity index 100% rename from Socket/INetAddressing.test.cc rename to Socket/Protocols/INet/INetAddressing.test.cc diff --git a/Socket/INetProtocol.cc b/Socket/Protocols/INet/INetProtocol.cc similarity index 100% rename from Socket/INetProtocol.cc rename to Socket/Protocols/INet/INetProtocol.cc diff --git a/Socket/INetProtocol.hh b/Socket/Protocols/INet/INetProtocol.hh similarity index 97% rename from Socket/INetProtocol.hh rename to Socket/Protocols/INet/INetProtocol.hh index df3cea1..4728855 100644 --- a/Socket/INetProtocol.hh +++ b/Socket/Protocols/INet/INetProtocol.hh @@ -34,10 +34,10 @@ #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 index 0000000..4e77b00 --- /dev/null +++ b/Socket/Protocols/INet/SConscript @@ -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') diff --git a/Socket/TCPProtocol.cc b/Socket/Protocols/INet/TCPProtocol.cc similarity index 98% rename from Socket/TCPProtocol.cc rename to Socket/Protocols/INet/TCPProtocol.cc index 57ffef8..8edb77f 100644 --- a/Socket/TCPProtocol.cc +++ b/Socket/Protocols/INet/TCPProtocol.cc @@ -33,7 +33,7 @@ #include #include #include // for SIOCINQ / SIOCOUTQ -#include "SocketHandle.hh" +#include "Socket/SocketHandle.hh" //#include "TCPProtocol.mpp" #define prefix_ diff --git a/Socket/TCPProtocol.hh b/Socket/Protocols/INet/TCPProtocol.hh similarity index 98% rename from Socket/TCPProtocol.hh rename to Socket/Protocols/INet/TCPProtocol.hh index e229051..e94202c 100644 --- a/Socket/TCPProtocol.hh +++ b/Socket/Protocols/INet/TCPProtocol.hh @@ -28,7 +28,7 @@ #define HH_TCPProtocol_ 1 // Custom includes -#include "SocketProtocol.hh" +#include "Socket/SocketProtocol.hh" //#include "TCPProtocol.mpp" ///////////////////////////////hh.p//////////////////////////////////////// diff --git a/Socket/TCPSocketHandle.cc b/Socket/Protocols/INet/TCPSocketHandle.cc similarity index 100% rename from Socket/TCPSocketHandle.cc rename to Socket/Protocols/INet/TCPSocketHandle.cc diff --git a/Socket/TCPSocketHandle.hh b/Socket/Protocols/INet/TCPSocketHandle.hh similarity index 97% rename from Socket/TCPSocketHandle.hh rename to Socket/Protocols/INet/TCPSocketHandle.hh index 2e00ee5..d0bb8bf 100644 --- a/Socket/TCPSocketHandle.hh +++ b/Socket/Protocols/INet/TCPSocketHandle.hh @@ -34,13 +34,13 @@ #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//////////////////////////////////////// diff --git a/Socket/TCPSocketHandle.test.cc b/Socket/Protocols/INet/TCPSocketHandle.test.cc similarity index 100% rename from Socket/TCPSocketHandle.test.cc rename to Socket/Protocols/INet/TCPSocketHandle.test.cc diff --git a/Socket/UDPProtocol.cc b/Socket/Protocols/INet/UDPProtocol.cc similarity index 99% rename from Socket/UDPProtocol.cc rename to Socket/Protocols/INet/UDPProtocol.cc index af5d91e..593eb1a 100644 --- a/Socket/UDPProtocol.cc +++ b/Socket/Protocols/INet/UDPProtocol.cc @@ -34,7 +34,7 @@ #include #include // for SIOCINQ / SIOCOUTQ #include // for if_nametoindex -#include "SocketHandle.hh" +#include "Socket/SocketHandle.hh" //#include "UDPProtocol.mpp" #define prefix_ diff --git a/Socket/UDPProtocol.hh b/Socket/Protocols/INet/UDPProtocol.hh similarity index 99% rename from Socket/UDPProtocol.hh rename to Socket/Protocols/INet/UDPProtocol.hh index 55ab314..58412c1 100644 --- a/Socket/UDPProtocol.hh +++ b/Socket/Protocols/INet/UDPProtocol.hh @@ -28,7 +28,7 @@ #define HH_UDPProtocol_ 1 // Custom includes -#include "SocketProtocol.hh" +#include "Socket/SocketProtocol.hh" #include "INetAddressing.hh" //#include "UDPProtocol.mpp" diff --git a/Socket/UDPSocketHandle.cc b/Socket/Protocols/INet/UDPSocketHandle.cc similarity index 100% rename from Socket/UDPSocketHandle.cc rename to Socket/Protocols/INet/UDPSocketHandle.cc diff --git a/Socket/UDPSocketHandle.hh b/Socket/Protocols/INet/UDPSocketHandle.hh similarity index 96% rename from Socket/UDPSocketHandle.hh rename to Socket/Protocols/INet/UDPSocketHandle.hh index f10d960..1a1e93d 100644 --- a/Socket/UDPSocketHandle.hh +++ b/Socket/Protocols/INet/UDPSocketHandle.hh @@ -33,12 +33,12 @@ // 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//////////////////////////////////////// diff --git a/Socket/UDPSocketHandle.test.cc b/Socket/Protocols/INet/UDPSocketHandle.test.cc similarity index 100% rename from Socket/UDPSocketHandle.test.cc rename to Socket/Protocols/INet/UDPSocketHandle.test.cc diff --git a/Socket/PacketSocketHandle.ct b/Socket/Protocols/INet/main.test.cc similarity index 62% copy from Socket/PacketSocketHandle.ct copy to Socket/Protocols/INet/main.test.cc index 5a6eb0c..91e601d 100644 --- a/Socket/PacketSocketHandle.ct +++ b/Socket/Protocols/INet/main.test.cc @@ -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) @@ -20,32 +20,21 @@ // 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 +#include #define prefix_ -///////////////////////////////ct.p//////////////////////////////////////// +///////////////////////////////cc.p//////////////////////////////////////// -template -prefix_ unsigned -senf::detail::Range_LLAddressCopier::operator()(unsigned char * target) - const -{ - std::size_t len (0); - typename boost::range_const_iterator::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_ diff --git a/Socket/LLAddressing.cc b/Socket/Protocols/LLAddressing.cc similarity index 100% rename from Socket/LLAddressing.cc rename to Socket/Protocols/LLAddressing.cc diff --git a/Socket/LLAddressing.cci b/Socket/Protocols/LLAddressing.cci similarity index 100% rename from Socket/LLAddressing.cci rename to Socket/Protocols/LLAddressing.cci diff --git a/Socket/LLAddressing.ct b/Socket/Protocols/LLAddressing.ct similarity index 100% rename from Socket/LLAddressing.ct rename to Socket/Protocols/LLAddressing.ct diff --git a/Socket/LLAddressing.cti b/Socket/Protocols/LLAddressing.cti similarity index 100% rename from Socket/LLAddressing.cti rename to Socket/Protocols/LLAddressing.cti diff --git a/Socket/LLAddressing.hh b/Socket/Protocols/LLAddressing.hh similarity index 99% rename from Socket/LLAddressing.hh rename to Socket/Protocols/LLAddressing.hh index 4182305..1240d0c 100644 --- a/Socket/LLAddressing.hh +++ b/Socket/Protocols/LLAddressing.hh @@ -35,8 +35,8 @@ #include #include -#include "SocketPolicy.hh" -#include "FileHandle.hh" +#include "Socket/SocketPolicy.hh" +#include "Socket/FileHandle.hh" #include "GenericAddressingPolicy.hh" //#include "LLAddressing.mpp" diff --git a/Socket/LLAddressing.ih b/Socket/Protocols/LLAddressing.ih similarity index 100% rename from Socket/LLAddressing.ih rename to Socket/Protocols/LLAddressing.ih diff --git a/Socket/LLAddressing.test.cc b/Socket/Protocols/LLAddressing.test.cc similarity index 100% rename from Socket/LLAddressing.test.cc rename to Socket/Protocols/LLAddressing.test.cc diff --git a/Socket/PacketSocketHandle.cc b/Socket/Protocols/PacketSocketHandle.cc similarity index 100% rename from Socket/PacketSocketHandle.cc rename to Socket/Protocols/PacketSocketHandle.cc diff --git a/Socket/PacketSocketHandle.ct b/Socket/Protocols/PacketSocketHandle.ct similarity index 100% copy from Socket/PacketSocketHandle.ct copy to Socket/Protocols/PacketSocketHandle.ct diff --git a/Socket/PacketSocketHandle.cti b/Socket/Protocols/PacketSocketHandle.cti similarity index 100% rename from Socket/PacketSocketHandle.cti rename to Socket/Protocols/PacketSocketHandle.cti diff --git a/Socket/PacketSocketHandle.hh b/Socket/Protocols/PacketSocketHandle.hh similarity index 96% rename from Socket/PacketSocketHandle.hh rename to Socket/Protocols/PacketSocketHandle.hh index 8282476..0715ec6 100644 --- a/Socket/PacketSocketHandle.hh +++ b/Socket/Protocols/PacketSocketHandle.hh @@ -30,14 +30,14 @@ #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/PacketSocketHandle.ih b/Socket/Protocols/PacketSocketHandle.ih similarity index 100% rename from Socket/PacketSocketHandle.ih rename to Socket/Protocols/PacketSocketHandle.ih diff --git a/Socket/PacketSocketHandle.test.cc b/Socket/Protocols/PacketSocketHandle.test.cc similarity index 100% rename from Socket/PacketSocketHandle.test.cc rename to Socket/Protocols/PacketSocketHandle.test.cc diff --git a/Socket/Protocols/SConscript b/Socket/Protocols/SConscript new file mode 100644 index 0000000..4e77b00 --- /dev/null +++ b/Socket/Protocols/SConscript @@ -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') diff --git a/Socket/PacketSocketHandle.ct b/Socket/Protocols/main.test.cc similarity index 62% rename from Socket/PacketSocketHandle.ct rename to Socket/Protocols/main.test.cc index 5a6eb0c..91e601d 100644 --- a/Socket/PacketSocketHandle.ct +++ b/Socket/Protocols/main.test.cc @@ -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) @@ -20,32 +20,21 @@ // 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 +#include #define prefix_ -///////////////////////////////ct.p//////////////////////////////////////// +///////////////////////////////cc.p//////////////////////////////////////// -template -prefix_ unsigned -senf::detail::Range_LLAddressCopier::operator()(unsigned char * target) - const -{ - std::size_t len (0); - typename boost::range_const_iterator::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_ diff --git a/Socket/SConscript b/Socket/SConscript index 5887b53..41dd658 100644 --- a/Socket/SConscript +++ b/Socket/SConscript @@ -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'), diff --git a/Socket/SocketPolicy.hh b/Socket/SocketPolicy.hh index cb83e11..324d07c 100644 --- a/Socket/SocketPolicy.hh +++ b/Socket/SocketPolicy.hh @@ -254,8 +254,6 @@ // 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 diff --git a/senfscons/BoostUnitTests.py b/senfscons/BoostUnitTests.py index 2dce3ba..09d340a 100644 --- a/senfscons/BoostUnitTests.py +++ b/senfscons/BoostUnitTests.py @@ -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) diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index 13be755..a4a3620 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -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 ])