// mode: auto-fill
// End:
-// LocalWords: callbacks
///////////////////////////////hh.p////////////////////////////////////////
namespace senf {
-
+
+ /** \brief Internal: Packet type of DataPacket
+
+ \internal
+ */
struct DataPacketType : public PacketTypeBase
{};
+
+ /** \brief Generic payload-only packet
+
+ DataPacket is a simple generic packet with just a payload of uninterpreted data. This is the
+ packet used whenever no more specific packet type can be found for a sub-packet (e.g. as the
+ payload data of a UDP packet)
+
+ \ingroup packet_module
+ */
typedef ConcretePacket<DataPacketType> DataPacket;
}
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
// End:
+
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-/** \defgroup protocolbundles Protocol Bundles
+/** \mainpage The Default Bundle
- Each protocol bundle provides a collection of related concrete packet classes for a group of
- related protocols.
+ The default bundle combines a set of basic low level protocols like Ethernet or IP. You can find
+ the list of implemented protocols at \ref protocolbundle_default (see the list of typedefs)
*/
-/** \defgroup protocolbundle_default The Default Bundle
+/** \defgroup protocolbundle_default Protocols of the default bundle
- The default bundle combines a set of basic low level protocols like Ethernet or IP. Find the
- list of packet types implemented below under 'Typedefs'.
+ Each protocol consists of several objects
- \ingroup protocolbundles
+ \li The packet \c typedef symbol. This is the only object explicitly accessed from the outside
+ \li The associated parser object. This is, where the field names are documented
+ \li The internal packet type object
*/
\f
// mode: auto-fill
// End:
-// LocalWords: Fraunhofer Institut fuer offene Kommunikationssysteme FOKUS de
-// LocalWords: Kompetenzzentrum Satelitenkommunikation SatCom Bund berlios IP
-// LocalWords: defgroup protocolbundles protocolbundle ingroup dil
--- /dev/null
+@INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global"
+
+PROJECT_NAME = libPackets/DefaultBundle
+TAGFILES = "$(TOPDIR)/Utils/doc/Utils.tag" "$(TOPDIR)/Packets/doc/Packets.tag"
+GENERATE_TAGFILE = doc/DefaultBundle.tag
+INPUT = .
SENFSCons.Object(env, target = 'DefaultBundle', sources=sources,
LIBS = ['Packets', 'Socket', 'Utils'])
+SENFSCons.Lib(env, library = 'Packets_DefaultBundle', sources = sources[0],
+ LIBS = ['Packets', 'Socket', 'Utils'])
+SENFSCons.Doxygen(env)
PROJECT_NAME = libPackets
TAGFILES = "$(TOPDIR)/Utils/doc/Utils.tag"
GENERATE_TAGFILE = doc/Packets.tag
-INPUT = . DefaultBundle MPEG_DVBBundle
+#INPUT = . DefaultBundle MPEG_DVBBundle
+INPUT = .
-EXAMPLE_PATH = . DefaultBundle
+#EXAMPLE_PATH = . DefaultBundle
--- /dev/null
+@INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global"
+
+PROJECT_NAME = libPackets/MPEG_DVBBundle
+TAGFILES = "$(TOPDIR)/Utils/doc/Utils.tag" "$(TOPDIR)/Packets/doc/Packets.tag"
+GENERATE_TAGFILE = doc/MPEG_DVBBundle.tag
+INPUT = .
SENFSCons.Object(env, target = 'MPEG_DVBBundle', sources=sources,
LIBS = ['Packets', 'Socket', 'Utils'])
+SENFSCons.Lib(env, library = 'Packets_MPEG_DVBBundle', sources = sources[0],
+ LIBS = ['Packets', 'Socket', 'Utils'])
+SENFSCons.Doxygen(env)
a detailed discussion see the respective reference documentation.
*/
+/** \defgroup protocolbundles Protocol Bundles
+
+ Each protocol bundle provides a collection of related concrete packet classes for a group of
+ related protocols:
+
+ \li <a href="../../DefaultBundle/doc/html/index.html">DefaultBundle</a>: Some basic
+ default protocols: Ethernet, Ip, TCP, UDP
+ \li <a href="../../MPEG_DVBBundle/doc/html/index.html">MPEG_DVBBundle</a>: MPEG and DVB
+ protocols
+ */
+
\f
// Local Variables:
// mode: c++
// compile-command: "scons -u doc"
// End:
-// LocalWords: mainpage SENF packetparser protocolbundles protocolbundle IPv4
-// LocalWords: udp endcode li senf EthernetPacket eth IpV createAfter ip std
-// LocalWords: ethernet UDPPacket DataPacket ttl INet MACAddress nothrow prev
-// LocalWords: PacketSocketHandle InvalidPacketChainException findNext noinit
-// LocalWords: tt TruncatedPacketException const cerr Ooops hh
// comment-column: 40
// End:
-// LocalWords: defgroup li html png STL ConcretePacket PacketInterpreterBase
-// LocalWords: PacketInterpreter PacketImpl OtherPacket EthernetPacket param
-// LocalWords: EthernetPacketType PacketData packetparser nothrow senf prev
-// LocalWords: InvalidPacketChainException findNext findPrev parseNextAs tt
-// LocalWords: PacketType SomePacketType createAfter createBefore noinit href
-// LocalWords: PacketTypeBase TruncatedPacketException http www org Institut
-// LocalWords: Fraunhofer fuer offene Kommunikationssysteme FOKUS SatCom Bund
-// LocalWords: Kompetenzzentrum Satelitenkommunikation berlios de hh
-// LocalWords: addtogroup Structors PacketType dil PacketType's
class PacketParserBase;
+ /** \brief Invalid packet data access
+
+ This exception is signaled whenever an operation tries to access an out-of-bounds data
+ byte. If the packet has been implemented correctly, this signals a malformed packet.
+ */
struct TruncatedPacketException : public std::exception
{ virtual char const * what() const throw() { return "truncated packet"; } };
+ /** \brief Re-validating data iterator
+
+ This class is a wrapper around a PacketData::iterator instance. It will revalidate the
+ iterator on every access. This keeps the iterator valid even when the data container is
+ resized and thereby possibly relocated. The iterator will always point to the byte at the
+ same offset from the packets beginning. If data is inserted before this iterators position,
+ the data pointed to will of course change.
+
+ For this to work, the safe_data_iterator must be initialized with the container to which the
+ iterator belongs. After this initialization it can be used like any other iterator.
+ */
class safe_data_iterator
: public boost::iterator_facade< safe_data_iterator,
PacketData::value_type,
public:
typedef PacketData::size_type size_type;
- safe_data_iterator();
- explicit safe_data_iterator(PacketData & data);
+ safe_data_iterator(); ///< Make uninitialized iterator
+ explicit safe_data_iterator(PacketData & data);
+ ///< Construct iterator only setting the data container
safe_data_iterator(PacketData & data, PacketData::iterator i);
+ ///< Initialize iterator to given position
explicit safe_data_iterator(PacketParserBase const & parser);
+ ///< Initialize iterator from parser
+ /**< The iterator will point to the parsers start
+ position. */
- safe_data_iterator & operator=(PacketData::iterator i);
+ safe_data_iterator & operator=(PacketData::iterator i); ///< Assign iterator
+ /**< The iteator \a i must be from the container wo which \c
+ this iterator has been initialized. */
safe_data_iterator & operator=(PacketParserBase const & parser);
- operator PacketData::iterator() const;
+ ///< Assign iterator from parser
+ /**< The iterator will point to the parser start
+ position. */
+
+ operator PacketData::iterator() const; ///< Convert to iterator
- bool boolean_test() const;
+ bool boolean_test() const; ///< Check, if iterator is initialized
- PacketData & data() const;
+ PacketData & data() const; ///< Access data container
private:
friend class boost::iterator_core_access;
// comment-column: 40
// End:
-// LocalWords: Fraunhofer Institut fuer offene Kommunikationssysteme FOKUS de
-// LocalWords: Kompetenzzentrum Satelitenkommunikation SatCom Bund berlios dil
-// LocalWords: PacketData hh STL PacketInterpreterBase PacketInterpreter
-// LocalWords: ingroup Structors
namespace senf {
namespace detail {
+ /** \brief Internal: Packet data storage
+
+ \internal
+
+ This is the class holding the packet data and the interpreter chain. All manipulations of
+ the packet data are performed via the interface exported here. This is very important, since
+ PacketImpl will update the interpreters (that is the vector indices stored therein) whenever
+ the data is changed.
+ */
class PacketImpl
: boost::noncopyable,
public pool_alloc_mixin<PacketImpl>
void erase(PacketData * self, iterator first, iterator last);
void clear(PacketData * self);
- // The Guard will keep the PacketImpl instance alive during a members execution time
- // It the refcount should drop to 0, PacketImpl will be deleted after the member
- // has completed executing.
+ /** \brief Internal: Keep PacketImpl instance alive
+
+ \internal
+
+ The Guard will keep the PacketImpl instance alive during a members execution time
+ It the refcount should drop to 0, PacketImpl will be deleted after the member
+ has completed executing.
+ */
struct Guard {
Guard(PacketImpl * impl);
~Guard();
void eraseInterpreters(interpreter_list::iterator b, interpreter_list::iterator e);
void updateIterators(PacketData * self, iterator pos, difference_type n);
-
};
}}
// compile-command: "scons -u test"
// comment-column: 40
// End:
+
template <class PacketType> class PacketInterpreter;
- /** \brief
+ /** \brief Internal: Base packet interpreter class
+
+ \internal
+
+ This is the base class for the persistent interpreter. This class encapsulates all the
+ functionality accessible via the packet handle, most handle operations are just forwarded.
*/
class PacketInterpreterBase
: protected PacketData,
enum Prepend_t { Prepend };
enum NoInit_t { noinit };
+ /** \brief Internal: Abstract packet factory
+
+ \internal
+
+ This abstract class provides an abstract packet factory interface. It allows to call
+ almost any one of the create / createAfter / createBefore static PacketInterpreter
+ without static information on the type of packet to create.
+ */
struct Factory {
virtual ~Factory();
ptr appendClone(detail::PacketImpl * impl, range r);
public:
- // Need this for g++ < 4.0. Since PacketInterpreter is not publically visible, it should not
+ // Need this for g++ < 4.0. Since PacketInterpreter is not publicly visible, it should not
// be a real problem to make impl() public here
using PacketData::impl;
friend class detail::packet::test::TestDriver;
};
- /** \brief Concrete packet interpreter
+ /** \brief Internal: Concrete packet interpreter
+
+ \internal
+
+ Instantiations of this class build the interpreter chain. This class is accessed by the
+ packet handles. It provides the packet-type specific functionality in addition to the
+ interface defined in the PacketInterpreterBase class.
\see PacketTypeBase for the \a PacketType interface
*/
// factory
+ /** \brief Internal: Implementation of abstract factory interface
+
+ \internal
+
+ Implements the abstract factory interface for \a PacketType
+ */
struct FactoryImpl : public Factory {
// Create completely new packet
friend class FactoryImpl;
};
+ /** \brief Invalid packet chain operation
+
+ This exception signals an invalid operation on the chain like trying to find a non-existent
+ chain member and other similar error conditions.
+ */
struct InvalidPacketChainException : public std::exception
{ virtual char const * what() const throw() { return "invalid packet chain"; } };
# define SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS_OFFSET(offset,fields) \
SENF_PACKET_PARSER_I_DEFINE_FIXED_FIELDS(offset,fields)
+ /** \brief Default parser parsing nothing
+ */
struct VoidPacketParser
: public PacketParserBase
{
// comment-column: 40
// End:
-// LocalWords: templated PacketParser defgroup packetparser PacketParsers li
-// LocalWords: EthernetParser ethertype UInt senf PacketParserBase tt
-// LocalWords: struct FooParser const init endcode ingroup param SomeParser
-// LocalWords: ethernet DefaultBundle EthernetPacket hh EthVLan UIntField CFI
-// LocalWords: VLanId OverlayField cfi vlanId accessor defaultInit bitfield
-// LocalWords: SomePacket SimpleVectorSizer packetparsermacros Fraunhofer std
-// LocalWords: hideinitializer Institut fuer offene Kommunikationssysteme STL
-// LocalWords: FOKUS Kompetenzzentrum Satelitenkommunikation SatCom Bund cerr
-// LocalWords: berlios dil Structors someField someVector someOtherField
-// LocalWords: TruncatedPacketException
static Registry & registry();
};
+ /** \brief Entry not found in registry
+
+ This exception is signaled whenever a throwing lookup operation fails.
+ */
struct PacketTypeNotRegisteredException : public std::exception
{ virtual char const * what() const throw() { return "packet type not registered"; } };
// comment-column: 40
// End:
-// LocalWords: PacketRegistry hh dil Fraunhofer Institut fuer offene FOKUS de
-// LocalWords: Kommunikationssysteme Kompetenzzentrum Satelitenkommunikation
-// LocalWords: SatCom Bund stefan bund fokus fraunhofer Ethertype IP struct
-// LocalWords: SomeTag endcode senf SomePacket registerPacket ingroup param
-// LocalWords: registerSomePacket RegistrationProxy namespace PacketType key
-// LocalWords: registerPacketType ConcretePacket PacketTypeNotRegistered href
-// LocalWords: http www org html
namespace senf {
namespace detail {
- ///\internal
+ /** \brief Internal
+ \internal
+ */
template <class PacketType>
struct PkReg_EntryImpl
: public PkReg_Entry
virtual Packet::factory_t factory() const;
};
- ///\internal
+ /** \brief Internal
+ \internal
+ */
template <class KeyType>
class PacketRegistryImpl
: private boost::noncopyable
static void init (Packet p);
};
+# ifndef DOXYGEN
+
template <class Self>
class PacketTypeMixin<Self,void>
{
static void init (Packet p);
};
+# endif
+
}
///////////////////////////////hh.e////////////////////////////////////////
// comment-column: 40
// End:
-// LocalWords: Fraunhofer Institut fuer offene Kommunikationssysteme FOKUS de
-// LocalWords: Kompetenzzentrum Satelitenkommunikation SatCom Bund berlios dil
-// LocalWords: PacketType struct SomePacketType senf PacketTypeBase initSize
-// LocalWords: ConcretePacket init initHeadSize nextPacketRange NextPacket os
-// LocalWords: nextPacketType std ostream endcode ingroup VoidPacketParser Ok
-// LocalWords: tt li OtherPacketType Mixin mixin SimplePacketType typeField
-// LocalWords: PacketTypeMixin SomeRegistryTag SomePacketParser nextPacketKey
-// LocalWords: hh
namespace packet {
+ /** \brief Internal: Tempalte typedef for used smart pointer
+
+ \internal
+ */
template <class T>
struct smart_pointer {
typedef boost::intrusive_ptr<T> ptr_t;
+
// $Id$
//
// Copyright (C) 2006
BOOST_CHECK_NO_THROW( Scheduler::instance().remove(handle,Scheduler::EV_WRITE) );
event = Scheduler::EV_NONE;
+ sleep(1);
BOOST_CHECK_NO_THROW( Scheduler::instance().process() );
BOOST_CHECK_EQUAL( event, Scheduler::EventId(Scheduler::EV_READ|Scheduler::EV_HUP) );
BOOST_REQUIRE_EQUAL( size, 2 );
;; Better set this here than in the file variables since the setting
;; is only valid if project.el is loaded ...
+(set (make-local-variable 'ispell-personal-dictionary)
+ (expand-file-name "senf.dict" ccide-project-root))
(flyspell-cc-mode)
--- /dev/null
+accessor
+addtogroup
+berlios
+bitfield
+bund
+Bund
+callbacks
+cerr
+cfi
+CFI
+ConcretePacket
+const
+createAfter
+createBefore
+DataPacket
+de
+DefaultBundle
+defaultInit
+defgroup
+dil
+endcode
+eth
+ethernet
+EthernetPacket
+EthernetPacketType
+EthernetParser
+ethertype
+Ethertype
+EthVLan
+findNext
+findPrev
+fokus
+FOKUS
+FooParser
+fraunhofer
+Fraunhofer
+fuer
+hh
+hideinitializer
+href
+html
+http
+impl
+INet
+ingroup
+init
+initHeadSize
+initSize
+Institut
+InvalidPacketChainException
+ip
+IP
+IpV
+IPv4
+key
+Kommunikationssysteme
+Kompetenzzentrum
+li
+MACAddress
+mainpage
+mixin
+Mixin
+namespace
+NextPacket
+nextPacketKey
+nextPacketRange
+nextPacketType
+noinit
+nothrow
+offene
+Ok
+Ooops
+org
+os
+ostream
+OtherPacket
+OtherPacketType
+OverlayField
+PacketData
+PacketImpl
+PacketInterpreter
+PacketInterpreterBase
+packetparser
+PacketParser
+PacketParserBase
+packetparsermacros
+PacketParsers
+PacketRegistry
+PacketSocketHandle
+PacketType
+PacketTypeBase
+PacketTypeMixin
+PacketTypeNotRegistered
+PacketType's
+param
+parseNextAs
+png
+prev
+protocolbundle
+protocolbundles
+refcount
+registerPacket
+registerPacketType
+registerSomePacket
+RegistrationProxy
+rerference
+SatCom
+Satelitenkommunikation
+senf
+SENF
+SimplePacketType
+SimpleVectorSizer
+someField
+someOtherField
+SomePacket
+SomePacketParser
+SomePacketType
+SomeParser
+SomeRegistryTag
+SomeTag
+someVector
+std
+stefan
+STL
+struct
+structors
+Structors
+templated
+TruncatedPacketException
+tt
+ttl
+typeField
+udp
+UDP
+UDPPacket
+UInt
+UIntField
+vlanId
+VLanId
+VoidPacketParser
+www