diff --git a/Examples/DVBAdapter/MPEdec.cc b/Examples/DVBAdapter/MPEdec.cc index 372e7bebf5e9a3e93404fc3314a25801611365c5..48c6b82aa8066e75386679156eabe8742288bee3 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 02c5c31260cf6125edda1b633e664b426ec30115..2d2fd34481534432b9c345ddafe4a86c827fb1bb 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 950ad22f0dbda97c703becc56c0a1995969a712a..d805bb4e1d41d3ffa58e051d2aa8164940d70e94 100644 --- a/Examples/DVBAdapter/frontend.cc +++ b/Examples/DVBAdapter/frontend.cc @@ -22,7 +22,7 @@ #include <string> #include <iostream> -#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 c4aded296e6a231222af27febb26ee81af1b01b5..2cbb2a3c8b646f7a654dbeaf9783598e791cf81b 100644 --- a/Examples/MCSniffer/MCSniffer.cc +++ b/Examples/MCSniffer/MCSniffer.cc @@ -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" diff --git a/Examples/Sniffer/Sniffer.cc b/Examples/Sniffer/Sniffer.cc index a3234e8c9e7c22123b4e7e9ee6d438e79cff77ce..f1210a5d202a42727518ccb46b80d5537ec09909 100644 --- a/Examples/Sniffer/Sniffer.cc +++ b/Examples/Sniffer/Sniffer.cc @@ -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" diff --git a/Examples/TCPClientServer/client.cc b/Examples/TCPClientServer/client.cc index e30c96ec8add134b35de96f00cfd91d37cc963a1..b3b65e719784ab8659e82a98c22d351a96e180c4 100644 --- a/Examples/TCPClientServer/client.cc +++ b/Examples/TCPClientServer/client.cc @@ -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[]) diff --git a/Examples/TCPClientServer/server.cc b/Examples/TCPClientServer/server.cc index a3b0374dc4589fbcfd349f8073cd1648aedcc5e0..aba64d0291022fc20d5171fb2342c11c90fa1b08 100644 --- a/Examples/TCPClientServer/server.cc +++ b/Examples/TCPClientServer/server.cc @@ -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 diff --git a/Packets/DefaultBundle/IpV6Extensions.test.cc b/Packets/DefaultBundle/IpV6Extensions.test.cc index 6c7a09bec5edbc92201ca1f697eaf39289ae7dd6..728d9fec550ce97099f4628d35d0d8b1fbb07ffd 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 <boost/test/auto_unit_test.hpp> #include <boost/test/test_tools.hpp> diff --git a/Packets/DefaultBundle/IpV6Packet.cc b/Packets/DefaultBundle/IpV6Packet.cc index 7a72d0fcfff5bce7656726a8626fdb17a583284b..63c341a106f2b80a91c90412f13bfbc8f27c9246 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 f603c2bc77e4717d76a29043affe4f0a68cb25f8..9882ab5fa357c4a73375a610eed2a931560b074f 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 <boost/test/auto_unit_test.hpp> diff --git a/Socket/Doxyfile b/Socket/Doxyfile index 76ad2bbb607318f4d3b2e5efc78eb58a7f41fd06..9a93817a48c5f45a8f161ef5be5581d36ce267eb 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 889da3cbe81a56928dcfcb712981bebc02ebfe37..55b9c8826b7b87e44dd8f7b59469aceda39c1268 100644 --- a/Socket/BSDSocketProtocol.cc +++ b/Socket/Protocols/BSDSocketProtocol.cc @@ -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_ 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 3743f528f6c459cd3d7d3791b66a06d7ab11d1ba..cd38828e62f6795058a1ccdafcc7feba9c885f0e 100644 --- a/Socket/BSDSocketProtocol.hh +++ b/Socket/Protocols/BSDSocketProtocol.hh @@ -28,7 +28,7 @@ // Custom includes #include <sys/time.h> -#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 2ef49962e87e82a11cd4c214f089674a89d8fc4f..2c839e66db13d40ec1454127927169e899967f4f 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 dcc3a62c5c7914d546187fdd108028dd687b7c09..141ab55e0dc6d6c3a8f46291c2c878de0ac365a4 100644 --- a/Socket/DVBDemuxProtocol.cc +++ b/Socket/Protocols/DVB/DVBDemuxProtocol.cc @@ -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_ 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 9e2f4d0f45625307b4195ae31964e2afaf252060..49f87b84389e9a1a29cbec84fab0e89101c73ef6 100644 --- a/Socket/DVBDemuxProtocol.hh +++ b/Socket/Protocols/DVB/DVBDemuxProtocol.hh @@ -30,7 +30,7 @@ #include <linux/dvb/dmx.h> // 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 56110aeb1c12b786a4e98965e3b1e148eb0baba4..b56fb840ff7ef0064fa87da277f8ffacab6f0a8b 100644 --- a/Socket/DVBFrontendHandle.cc +++ b/Socket/Protocols/DVB/DVBFrontendHandle.cc @@ -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" 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 1ab1fb660ef003f6b7d596ecfb77c023b818d2d3..add8a45cc60662b268b2242a9023045cf4908c8a 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 <linux/dvb/frontend.h> diff --git a/Socket/Protocols/DVB/SConscript b/Socket/Protocols/DVB/SConscript new file mode 100644 index 0000000000000000000000000000000000000000..4e77b0021b8bc96f8f5ddc61f762fc60255f5852 --- /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/Protocols/DVB/main.test.cc b/Socket/Protocols/DVB/main.test.cc new file mode 100644 index 0000000000000000000000000000000000000000..91e601da22f5802d9132796553153d6b355e2ced --- /dev/null +++ b/Socket/Protocols/DVB/main.test.cc @@ -0,0 +1,49 @@ +// $Id: main.test.cc 296 2007-07-10 20:39:34Z g0dil $ +// +// Copyright (C) 2006 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund <stefan.bund@fokus.fraunhofer.de> +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +// Definition of non-inline non-template functions + +//#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_ +///////////////////////////////cc.p//////////////////////////////////////// + + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 +// End: 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 b8bcfc346757c613e29a7a6ccff607301eb8358b..a289070a3d8ec33e2afcd0ec6386d265ffc8674a 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 a9f172c70563a4675252ba69b9a7a1cdeb82964e..db204ac9f80b967d48a8e892b97e4aaeec0a3ba4 100644 --- a/Socket/INetAddressing.hh +++ b/Socket/Protocols/INet/INetAddressing.hh @@ -31,10 +31,10 @@ #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//////////////////////////////////////// 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 df3cea136b6bca8d1b3e45b8fd14bdceeffb2ea5..472885527770d2f89e6f65e4211ac815959d86a2 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 0000000000000000000000000000000000000000..4e77b0021b8bc96f8f5ddc61f762fc60255f5852 --- /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 57ffef896800f700435d69589e6998e35414995e..8edb77f9935161e27910edc21f0af010b644edc7 100644 --- a/Socket/TCPProtocol.cc +++ b/Socket/Protocols/INet/TCPProtocol.cc @@ -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_ 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 e22905191dac0eb17c4b91217a898aab5a789c68..e94202ca3b492e3109642f31443076a2bd1f1d09 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 2e00ee513aed1f93e58786275baef9975c3c52e2..d0bb8bf61b569ffd6385f8c55a43a49641239b9e 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 af5d91e1198274c18b2d17cd0e2fd2fcd6f355ea..593eb1ab8e8e50c373643efb251e5d1dd4a7db39 100644 --- a/Socket/UDPProtocol.cc +++ b/Socket/Protocols/INet/UDPProtocol.cc @@ -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_ 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 55ab3143ecc3586cb3255b997306146f9ec303e0..58412c13035a2b68f1725c2998a6fa66293bf6e1 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 f10d96011b7676ee7328071bfa43d4d42274967d..1a1e93d1ba96c04ce31e32d0776369b2e985ee7b 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/Protocols/INet/main.test.cc b/Socket/Protocols/INet/main.test.cc new file mode 100644 index 0000000000000000000000000000000000000000..91e601da22f5802d9132796553153d6b355e2ced --- /dev/null +++ b/Socket/Protocols/INet/main.test.cc @@ -0,0 +1,49 @@ +// $Id: main.test.cc 296 2007-07-10 20:39:34Z g0dil $ +// +// Copyright (C) 2006 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund <stefan.bund@fokus.fraunhofer.de> +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +// Definition of non-inline non-template functions + +//#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_ +///////////////////////////////cc.p//////////////////////////////////////// + + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 +// End: 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 41823051e2d889bc9a41b921133826686ab1bacf..1240d0cb3fc325cba2e2dc27092b74fb5ebd7ced 100644 --- a/Socket/LLAddressing.hh +++ b/Socket/Protocols/LLAddressing.hh @@ -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" 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% rename from Socket/PacketSocketHandle.ct rename 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 82824763ce7e4272e130145290643777b1738631..0715ec6d8adaa95bb4f5803cafb5af2b3619ad25 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 0000000000000000000000000000000000000000..4e77b0021b8bc96f8f5ddc61f762fc60255f5852 --- /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/Protocols/main.test.cc b/Socket/Protocols/main.test.cc new file mode 100644 index 0000000000000000000000000000000000000000..91e601da22f5802d9132796553153d6b355e2ced --- /dev/null +++ b/Socket/Protocols/main.test.cc @@ -0,0 +1,49 @@ +// $Id: main.test.cc 296 2007-07-10 20:39:34Z g0dil $ +// +// Copyright (C) 2006 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund <stefan.bund@fokus.fraunhofer.de> +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +// Definition of non-inline non-template functions + +//#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_ +///////////////////////////////cc.p//////////////////////////////////////// + + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 +// End: diff --git a/Socket/SConscript b/Socket/SConscript index 5887b53ad15d42b7ebf732cc7af9326ae810b192..41dd658bbc19de3e82cbcff01b97224ebb4cd234 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 cb83e11a8df91e299bd68b32966bd77d309c4128..324d07ca5e793e644874a2d9006ddf511c051b55 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 2dce3ba1e2b94720319137e600039ed2825a8d12..09d340a82fa2fc6f421b0d435001b232d0af2e74 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 13be7552fc96a14240e27754115fc74fcee444a9..a4a3620cc1ed7a77fb1742542600fb0e045184c6 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 ])