#include <iomanip>
#include "Socket/UDPSocketHandle.hh"
#include "Scheduler/Scheduler.hh"
-#include "Packets/EthernetPacket.hh"
+#include "Packets/DefaultBundle/EthernetPacket.hh"
#include "Utils/membind.hh"
###########################################################################
SENFSCons.Binary(env, 'mcsniffer', SENFSCons.GlobSources(),
- LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ]);
+ LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ],
+ OBJECTS = [ '#/Packets/DefaultBundle/DefaultBundle.o' ]);
###########################################################################
SENFSCons.Binary(env, 'sniffer', SENFSCons.GlobSources(),
- LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ]);
+ LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ],
+ OBJECTS = [ '#/Packets/DefaultBundle/DefaultBundle.o' ]);
#include "Socket/PacketSocketHandle.hh"
#include "Scheduler/Scheduler.hh"
#include "Utils/membind.hh"
-
-#include "Packets/EthernetPacket.hh"
-#include "Packets/IpV4Packet.hh"
-#include "Packets/UDPPacket.hh"
+#include "Packets/DefaultBundle/EthernetPacket.hh"
//#include "Sniffer.mpp"
#define prefix_
std::cout << std::dec;
}
- void use_em()
- {
- // Pull in symbols from the wanted packets ...
- senf::Packet::create<senf::IpV4Packet>(0,0);
- senf::Packet::create<senf::UDPPacket>(0,0);
- }
}
int loop_main (int argc, char const * argv[])
#include <sstream>
#include "Socket/TCPSocketHandle.hh"
#include "Socket/INetAddressing.hh"
-#include "Packets/EthernetPacket.hh"
int main(int argc, char const * argv[])
// Custom includes
#include <string>
+#include <iostream>
#include "Scheduler/Scheduler.hh"
#include "Utils/membind.hh"
#include "Socket/TCPSocketHandle.hh"
#include "Socket/INetAddressing.hh"
-#include "Packets/EthernetPacket.hh"
class Server
#define HH_EthernetPacket_ 1
// Custom includes
-#include "Packet.hh"
-#include "ParseInt.hh"
-#include "ParseArray.hh"
-#include "PacketRegistry.hh"
+#include "Packets/Packet.hh"
+#include "Packets/ParseInt.hh"
+#include "Packets/ParseArray.hh"
+#include "Packets/PacketRegistry.hh"
//#include "EthernetPacket.mpp"
///////////////////////////////hh.p////////////////////////////////////////
#define HH_IpV4Packet_ 1
// Custom includes
-#include "Packet.hh"
-#include "ParseInt.hh"
-#include "ParseArray.hh"
-#include "PacketRegistry.hh"
+#include "Packets/Packet.hh"
+#include "Packets/ParseInt.hh"
+#include "Packets/ParseArray.hh"
+#include "Packets/PacketRegistry.hh"
//#include "IpV4Packet.mpp"
///////////////////////////////hh.p////////////////////////////////////////
#include "IpV6Extensions.hh"
#include "IpV6Packet.hh"
#include "UDPPacket.hh"
-#include "DataPacket.hh"
+#include "Packets/DataPacket.hh"
#include "Socket/INetAddressing.hh"
#include <boost/test/auto_unit_test.hpp>
#define HH_IpV6Packet_ 1
// Custom includes
-#include "Packet.hh"
-#include "ParseInt.hh"
-#include "ParseArray.hh"
-#include "PacketRegistry.hh"
+#include "Packets/Packet.hh"
+#include "Packets/ParseInt.hh"
+#include "Packets/ParseArray.hh"
+#include "Packets/PacketRegistry.hh"
#include "IpV4Packet.hh"
//#include "IpV6Packet.mpp"
--- /dev/null
+# -*- python -*-
+
+Import('env')
+import SENFSCons, glob
+
+###########################################################################
+
+sources = SENFSCons.GlobSources()
+
+SENFSCons.StandardTargets(env)
+
+SENFSCons.Object(env, target = 'DefaultBundle', sources=sources,
+ LIBS = ['Packets', 'Socket', 'Utils'])
+
#include "IpV4Packet.hh"
// Custom includes
-#include "DataPacket.hh"
+#include "Packets/DataPacket.hh"
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
#define HH_UDPPacket_ 1
// Custom includes
-#include "Packet.hh"
-#include "ParseInt.hh"
-#include "ParseArray.hh"
-#include "PacketRegistry.hh"
+#include "Packets/Packet.hh"
+#include "Packets/ParseInt.hh"
+#include "Packets/ParseArray.hh"
+#include "Packets/PacketRegistry.hh"
//#include "UDPPacket.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-// $Id$
+// $Id: main.test.cc 206 2007-02-20 14:20:52Z g0dil $
//
// Copyright (C) 2006
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Definition of non-inline non-template functions
-#include "RTCPPacket.hh"
-//#include "RTCPPacket.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_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void senf::RTCPPacket::v_nextInterpreter()
- const
-{
- registerInterpreter<DataPacket>(begin()+bytes(),end());
-}
-
-prefix_ void senf::RTCPPacket::v_finalize()
-{}
-
-
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
PROJECT_NAME = libPackets
TAGFILES = "$(TOPDIR)/Utils/doc/Utils.tag"
-GENERATE_TAGFILE = doc/Packets.tag
\ No newline at end of file
+GENERATE_TAGFILE = doc/Packets.tag
+INPUT = . DefaultBundle RTPBundle
\ No newline at end of file
{
public:
/** \brief Statically register a packet type in a PacketRegistry
-
- \fixme This fails to work within a library since the linker will
- remove all unused object files ...
*/
template <class OtherPacket>
struct RegistrationProxy
#define HH_RTCPPacket_ 1
// Custom includes
-#include "Packet.hh"
-#include "ParseInt.hh"
-#include "ParseArray.hh"
-#include "ParseListS.hh"
-#include "ParseVec.hh"
-#include "PacketRegistry.hh"
+#include "Packets/Packet.hh"
+#include "Packets/ParseInt.hh"
+#include "Packets/ParseArray.hh"
+#include "Packets/ParseListS.hh"
+#include "Packets/ParseVec.hh"
+#include "Packets/PacketRegistry.hh"
//#include "RTCPPacket.mpp"
///////////////////////////////hh.p////////////////////////////////////////
#define HH_RTPPacket_ 1
// Custom includes
-#include "Packet.hh"
-#include "ParseInt.hh"
-#include "ParseArray.hh"
-#include "ParseVec.hh"
-#include "PacketRegistry.hh"
+#include "Packets/Packet.hh"
+#include "Packets/ParseInt.hh"
+#include "Packets/ParseArray.hh"
+#include "Packets/ParseVec.hh"
+#include "Packets/PacketRegistry.hh"
//#include "RTPPacket.mpp"
///////////////////////////////hh.p////////////////////////////////////////
// Custom includes
#include "RTPPacket.hh"
-#include "EthernetPacket.hh"
-#include "IpV4Packet.hh"
-#include "UDPPacket.hh"
+#include "Packets/DefaultBundle/EthernetPacket.hh"
+#include "Packets/DefaultBundle/IpV4Packet.hh"
+#include "Packets/DefaultBundle/UDPPacket.hh"
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_tools.hpp>
--- /dev/null
+# -*- python -*-
+
+Import('env')
+import SENFSCons, glob
+
+###########################################################################
+
+sources = SENFSCons.GlobSources()
+
+SENFSCons.StandardTargets(env)
+
+SENFSCons.Object(env, target = 'RTPBundle', sources=sources,
+ LIBS = ['Packets', 'Socket', 'Utils'],
+ OBJECTS = ['#/Packets/DefaultBundle/DefaultBundle.o'])
+
-// $Id$
+// $Id: main.test.cc 206 2007-02-20 14:20:52Z g0dil $
//
// Copyright (C) 2006
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Definition of non-inline non-template functions
-#include "RTCPPacket.hh"
-//#include "RTCPPacket.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_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ void senf::RTCPPacket::v_nextInterpreter()
- const
-{
- registerInterpreter<DataPacket>(begin()+bytes(),end());
-}
-
-prefix_ void senf::RTCPPacket::v_finalize()
-{}
-
-
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
# -*- python -*-
Import('env')
-import SENFSCons
+import SENFSCons, glob
###########################################################################
SENFSCons.Doxygen(env, extra_sources = [
env.Dia2Png("structure.dia")
])
+
+SConscript(glob.glob("*/SConscript"))
import os.path
import os
-def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [], **kw):
+def BoostUnitTests(env, target, source, test_source=None, LIBS = [], OBJECTS = [], DEPENDS = [], **kw):
path, name = os.path.split(target)
if test_source:
if type(test_source) is not type([]):
testEnv.Prepend(LIBS = LIBS)
sources = []
if source:
- sources = sources + env.Object(source)
+ sources = sources + env.Object(source) + OBJECTS
sources = sources + test_source
binName = os.path.join(path,'.' + name +'.bin')
testRunner = testEnv.Program(binName, sources)
# provide both \a sources and \a testSources.
#
# \ingroup target
-def Objects(env, sources, testSources = None, LIBS = []):
+def Objects(env, sources, testSources = None, LIBS = [], OBJECTS = []):
if type(sources) == type(()):
testSources = sources[1]
sources = sources[0]
source = sources,
test_source = testSources,
LIBS = LIBS,
+ OBJECTS = OBJECTS,
DEPENDS = [ env.File(LibPath(x)) for x in LIBS ])
env.Alias('all_tests', test)
# Hmm ... here I'd like to use an Alias instead of a file
# The library is added to the list of default targets.
#
#\ingroup target
-def Lib(env, library, sources, testSources = None, LIBS = []):
- objects = Objects(env,sources,testSources,LIBS=LIBS)
+def Lib(env, library, sources, testSources = None, LIBS = [], OBJECTS = []):
+ objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
lib = None
if objects:
lib = env.Library(env.File(LibPath(library)),objects)
env.Append(ALLLIBS = library)
return lib
+## \brief Build Object from multiple sources
+def Object(env, target, sources, testSources = None, LIBS = [], OBJECTS = []):
+ objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
+ ob = None
+ if objects:
+ ob = env.Command(target+".o", objects, "ld -r -o $TARGET $SOURCES")
+ env.Default(ob)
+ return ob
+
## \brief Build executable
#
# This target helper will build the given binary. The \a sources, \a
# construction environment parameters or the framework helpers.
#
# \ingroup target
-def Binary(env, binary, sources, testSources = None, LIBS = []):
- objects = Objects(env,sources,testSources,LIBS=LIBS)
+def Binary(env, binary, sources, testSources = None, LIBS = [], OBJECTS = []):
+ objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
program = None
if objects:
progEnv = env.Copy()
progEnv.Prepend(LIBS = LIBS)
- program = progEnv.Program(target=binary,source=objects)
+ program = progEnv.Program(target=binary,source=objects+OBJECTS)
env.Default(program)
env.Depends(program, [ env.File(LibPath(x)) for x in LIBS ])
return program