'--param','large-function-growth=10000',
'--param', 'large-function-insns=10000',
'--param','inline-unit-growth=10000' ],
- INLINE_OPTS_NORMAL = [ '-finline-limit=5000' ],
+ INLINE_OPTS_NORMAL = [ '-finline-limit=5000', '--param', 'inline-unit-growth=60' ],
INLINE_OPTS = [ '$INLINE_OPTS_NORMAL' ],
CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long', '$INLINE_OPTS',
'-pipe', '$CXXFLAGS_', '-fno-strict-aliasing' ],
return data().size();
}
-
// Other methods
prefix_ bool senf::Packet::operator==(Packet const & other)
return ptr()->is_shared() || (ptr()->impl().refcount() > 1);
}
+prefix_ void senf::Packet::reparse()
+ const
+{
+ return ptr()->reparse();
+}
+
+prefix_ void senf::Packet::clearAnnotations()
+{
+ return ptr()->clearAnnotations();
+}
+
template <class PacketType, class Parser>
prefix_ Parser senf::operator<<(Parser target, ConcretePacket<PacketType> const & packet)
{
after \c this in the packet/header/interpreter
chain. */
+ void reparse() const; ///< Reparse the payload the packet
+ /**< This member will throw away the packet chain after the
+ current packet. The payload will be reparsed
+ automatically when calling next() */
///@}
///\name Data access
/**< This size does \e not include the size of any preceding
headers/packets/interpreters. It does however include
\c this packets payload. */
-
///@}
///\name Annotations
considering that the packetimpl itself uses a pool.
*/
- ///@}
-
template <class Annotation>
Annotation const & annotation() const; ///< Get packet annotation
/**< \see annotation() */
+ void clearAnnotations(); ///< Clear all packet annotations
+ /**< All packet annotations will be cleared. Afterwards
+ the annotations equates to a new created %packet.
+ \warning all references to existing complex
+ annotations become invalid. */
+ ///@}
+
///\name Other methods
///@{
access. The parser class may have any member which is
needed for full packet access (e.g. checksum validation
/ recreation ...)
- \see \ref packetparser for the parser interface. */
+ \see \ref packetparser for the %parser interface. */
Parser parser() const; ///< Access packet field parser directly
/**< Access the parser of the packet. This is the same
object returned by the operator->() operator. The
operator however does not allow to access this object
itself, only it's members.
- \see \ref packetparser for the parser interface */
+ \see \ref packetparser for the %parser interface */
protected:
BOOST_CHECK_EQUAL( p2.annotation<ComplexAnnotation>().s, "dead beef" );
BOOST_CHECK_EQUAL( p2.annotation<ComplexAnnotation>().i, 0x12345678 );
+ p2.clearAnnotations();
+ BOOST_CHECK_EQUAL( p2.annotation<ComplexAnnotation>().s, "empty" );
+ BOOST_CHECK_EQUAL( p2.annotation<ComplexAnnotation>().i, -1 );
+ BOOST_CHECK_EQUAL( p2.annotation<IntAnnotation>().value, 0 );
+
BOOST_CHECK( Reg::lookup<IntAnnotation>() >= 0 );
BOOST_CHECK( Reg::lookup<LargeAnnotation>() < 0 );
BOOST_CHECK( Reg::lookup<ComplexAnnotation>() < 0 );
}
}
+prefix_ void senf::detail::PacketImpl::clearAnnotations()
+{
+ ::memset(simpleAnnotations_, 0, sizeof(simpleAnnotations_));
+ complexAnnotations_.clear();
+}
+
prefix_ void * senf::detail::PacketImpl::complexAnnotation(AnnotationRegistry::key_type key)
{
SENF_ASSERT( key < 0, "complexAnnotation called with invalid key");
template <class Annotation>
Annotation & annotation();
+ void clearAnnotations();
void dumpAnnotations(std::ostream & os);
/** \brief Internal: Keep PacketImpl instance alive
return rv;
}
+prefix_ void senf::PacketInterpreterBase::reparse()
+{
+ if (next())
+ impl().truncateInterpreters(next().get());
+}
+
// Access to the abstract interface
prefix_ void senf::PacketInterpreterBase::dump(std::ostream & os)
return v_nextPacketType();
}
+prefix_ void senf::PacketInterpreterBase::clearAnnotations()
+{
+ return impl().clearAnnotations();
+}
+
////////////////////////////////////////
// protected members
ptr append(ptr packet);
+ void reparse();
+
///@}
///\name Data access
template <class Annotation>
Annotation & annotation();
+ void clearAnnotations();
+
///@}
///\name Access to the abstract interface
#define HH_SENF_Packets_VectorParser_ 1
// Custom includes
-#include <boost/iterator/iterator_facade.hpp>
-#include <boost/utility.hpp>
-#include <boost/range.hpp>
#include <boost/type_traits.hpp>
#include "PacketParser.hh"
#include "ArrayParser.hh" // for ArrayParser_iterator
prefix_ void senf::scheduler::detail::FIFORunner::watchdogError()
{
- static char const hex[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- 'a', 'b', 'c', 'd', 'e', 'f' };
- static void * entries[SENF_DEBUG_BACKTRACE_NUMCALLERS];
-
// We don't care if the write commands below fail, we just give our best to inform the user
senf::IGNORE( write(1, "\n\n*** Scheduler task hanging (pid ",34) );
static char pid[7];
senf::IGNORE( write(1, runningName_.c_str(), runningName_.size()) );
senf::IGNORE( write(1, " at\n ", 3) );
#ifdef SENF_DEBUG
+ static char const hex[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ 'a', 'b', 'c', 'd', 'e', 'f' };
+ static void * entries[SENF_DEBUG_BACKTRACE_NUMCALLERS];
unsigned nEntries( ::backtrace(entries, SENF_DEBUG_BACKTRACE_NUMCALLERS) );
for (unsigned i (0); i < nEntries; ++i) {
senf::IGNORE( write(1, " 0x", 3) );
namespace senf {
- /** \brief Asyncronous reading helper
+ /** \brief Asynchronous reading helper
This class provides a simple asynchronous reading facility. This helper will register with
the Scheduler and read incoming data. It will collect the data until a specific number of
The Scheduler is based on the RAII principle: Every event is represented by a class
instance. The event is registered in the constructor and removed by the destructor of that
instance. This implementation automatically links the lifetime of an event with the lifetime of
- the object resposible for it's creation.
+ the object responsible for it's creation.
Every event registration is represented by an instance of an event specific class:
namespace senf {
- /** \brief Asyncronous writing helper
+ /** \brief Asynchronous writing helper
This class provides a simple asynchronous writing facility. This helper will register with
the Scheduler to write the requested data. It will stay registered until the data has been
cti
CXXFLAGS
daemonization
+datagram
DatagramSection
DataPacket
datarate
DEBUGINFO
DebugModules
decapsulated
+decorator
DefaultArea
DefaultBundle
defaultInit
defgroup
deinitEmulationInterface
deque
+destructor
dia
dil
dir
MACAddress
MACAddressParser
mainpage
+malformed
manualparse
maxTxPowerIndex
Mbit
mcLoop
mem
memberfn
+membind
Mhz
min
mixin
nbar
nc
nChannels
+neighbour
+neighbours
netcat
NetEmu
NETwork
PassiveSink
PassiveSocketWriter
PassiveSource
+payload
pencolor
png
POPD
receiveModule
ReceiverDecorator
receiverJack
+ref
refcount
regex
registerEvent
registerPacketType
registerSomePacket
RegistrationProxy
+registry
ReportPacket
repos
rerference
vlanId
VLanId
VoidPacketParser
+watchdog
WiredInterface
WiredReceiver
WiredTransmitter