From: g0dil Date: Fri, 22 Feb 2008 08:25:25 +0000 (+0000) Subject: debian: Update build depends X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=7a4d13b962b9cd20e2e0bad0753a9bb1ca3219c4;p=senf.git debian: Update build depends Packets: change *_RO field helper macros to add a private r/w accessor senfscons: Introduce TEST_EXTRA_LIBS variable and move BOOSTFSLIB there Socket/Protocols/INet: Make INet[46]MulticastSocketProtocol inherit MulticastSocketprotocol Change SENF_NO_DEBUG to SENF_DEBUG git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@703 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/HowTos/NewPacket/Mainpage.dox b/HowTos/NewPacket/Mainpage.dox index 436a428..6744535 100644 --- a/HowTos/NewPacket/Mainpage.dox +++ b/HowTos/NewPacket/Mainpage.dox @@ -623,29 +623,20 @@ SENF_PARSER_BITFIELD_RO ( checksumPresent, 1, bool ); SENF_PARSER_PRIVATE_BITFIELD ( reserved0_5bits_, 5, unsigned ); SENF_PARSER_SKIP_BITS ( 7 ); - SENF_PARSER_PRIVATE_BITFIELD ( version_, 3, unsigned ); + SENF_PARSER_BITFIELD_RO ( version, 3, unsigned ); \endcode - We have added an additional private bitfield \a reserved0_5bits_() and we made the \a version_() - field private since we do not want the user to change the value (0 is the only valid value, any - other value is not supported by this parser anyways). In this special case, a read-only field - would do. But more generally, if there are fields which must have a fixed value, they must be - defined as private fields so they can be initialized by the parser to their correct value (see - next section on how). An additional public read-only accessor allows users of the parser to read - out the value (but not change it). + We have added an additional private bitfield \a reserved0_5bits_() and we made the \a version() + field read-only. - We will now add two additional simple members to the parser + We will now add a simple additional member to the parser: \code - typedef version__t version_t; - version_t::value_type version() const { return version_(); } - bool valid() const { return version() == 0 && reserved0_5bits_() == 0; } \endcode - I think, both are quite straight forward: \a version() will allow the user to read out the value - of the version field. However, since it does \e not return a parser but a numeric value, the - access is read-only. The \a valid() member will just check the restrictions as defined in the RFC. + I think, this is quite straight forward: \a valid() will just check the restrictions as defined + in the RFC. Now to the packet type. We want to refrain from parsing the payload if the packet is invalid. This is important: If the packet is not valid, we have no idea, whether the payload is @@ -708,8 +699,9 @@ SENF_PARSER_INIT() { version_() << 1u; } \endcode - to \c GREPacketParser. Here we see, why we have defined \a version_() as a private and not a - read-only field. + to \c GREPacketParser. For every read-only defined field, the macros automatically define a \e + private read-write accessor which may be used internally. This read-write accessor is used here + to initialize the value. \section howto_newpacket_final The ultimate GRE packet implementation completed @@ -740,7 +732,7 @@ SENF_PARSER_BITFIELD_RO ( checksumPresent, 1, bool ); SENF_PARSER_PRIVATE_BITFIELD ( reserved0_5bits_, 5, unsigned ); SENF_PARSER_SKIP_BITS ( 7 ); - SENF_PARSER_PRIVATE_BITFIELD ( version_, 3, unsigned ); + SENF_PARSER_BITFIELD_RO ( version, 3, unsigned ); SENF_PARSER_FIELD ( protocolType, senf::UInt16Parser ); diff --git a/Packets/PacketImpl.test.cc b/Packets/PacketImpl.test.cc index c2a812b..fe31d95 100644 --- a/Packets/PacketImpl.test.cc +++ b/Packets/PacketImpl.test.cc @@ -50,7 +50,7 @@ BOOST_AUTO_UNIT_TEST(packetImpl_mem) BOOST_CHECK_EQUAL(p->refcount(), 0); p->add_ref(); BOOST_CHECK_EQUAL(p->refcount(), 1); -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG BOOST_CHECK_EQUAL( senf::pool_alloc_mixin::allocCounter(), 1u); #endif @@ -69,7 +69,7 @@ BOOST_AUTO_UNIT_TEST(packetImpl_mem) p,p->begin(),p->end(), senf::PacketInterpreterBase::Append)); // Hmm ... this check works as long as sizeof(PacketInterpreterBase> != // sizeof(PacketImpl) ... !! -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG BOOST_CHECK_EQUAL( senf::pool_alloc_mixin< senf::PacketInterpreter >::allocCounter(), 1u); #endif @@ -84,7 +84,7 @@ BOOST_AUTO_UNIT_TEST(packetImpl_mem) p->truncateInterpreters(pi.get()); BOOST_CHECK_EQUAL(p->refcount(),1); } -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG BOOST_CHECK_EQUAL( senf::pool_alloc_mixin::allocCounter(), 0u); #endif @@ -95,7 +95,7 @@ BOOST_AUTO_UNIT_TEST(packetImpl_mem) // Therefore we can safely delete the object. BOOST_CHECK_EQUAL(p->refcount(), 1); p->release(); -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG BOOST_CHECK_EQUAL( senf::pool_alloc_mixin::allocCounter(), 0u); #endif @@ -201,7 +201,7 @@ BOOST_AUTO_UNIT_TEST(packetImpl_interpreters) BOOST_CHECK_EQUAL(p->refcount(), 1); p->release(); -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG BOOST_CHECK_EQUAL( senf::pool_alloc_mixin::allocCounter(), 0u); #endif diff --git a/Packets/PacketRegistry.ct b/Packets/PacketRegistry.ct index f274efa..ab0de44 100644 --- a/Packets/PacketRegistry.ct +++ b/Packets/PacketRegistry.ct @@ -68,7 +68,7 @@ template template prefix_ void senf::detail::PacketRegistryImpl::registerPacket(key_t key) { -#ifdef SENF_NO_DEBUG +#ifndef SENF_DEBUG registry_.insert(std::make_pair(key, Entry_ptr(new detail::PkReg_EntryImpl()))); reverseRegistry_.insert(std::make_pair(senf::typeIdValue(), key)); #else diff --git a/Packets/ParseHelpers.hh b/Packets/ParseHelpers.hh index 31fa8b5..f79e956 100644 --- a/Packets/ParseHelpers.hh +++ b/Packets/ParseHelpers.hh @@ -180,7 +180,7 @@ \par "" \ref SENF_PARSER_FIELD(), \ref SENF_PARSER_FIELD_RO(), \ref SENF_PARSER_PRIVATE_FIELD(), - \ref SENF_PARSER_PRIVATE_FIELD_RO(), SENF_PARSER_CUSTOM_FIELD() + \ref SENF_PARSER_CUSTOM_FIELD() There are quite a few commands available to define fields. All these macros do the same thing: they define a field accessor plus some auxiliary symbols. The accessor will use the parser type @@ -206,8 +206,7 @@ The field defining macros come in groups which members only differ in their properties:
Standard fields:
\ref SENF_PARSER_FIELD(), \ref SENF_PARSER_FIELD_RO(), - \ref SENF_PARSER_PRIVATE_FIELD(), \ref SENF_PARSER_PRIVATE_FIELD_RO() define standard - fields.
+ \ref SENF_PARSER_PRIVATE_FIELD() define standard fields.
Arbitrary custom field:
\ref SENF_PARSER_CUSTOM_FIELD()
@@ -221,7 +220,7 @@ \par "" \ref SENF_PARSER_BITFIELD(), \ref SENF_PARSER_BITFIELD_RO(), \ref - SENF_PARSER_PRIVATE_BITFIELD(), \ref SENF_PARSER_PRIVATE_BITFIELD_RO() \n + SENF_PARSER_PRIVATE_BITFIELD()\n Bit-fields play a special role. They are quite frequent in packet definitions but don't fit into the byte offset based parsing infrastructure defined so far. Since defining the correctly @@ -402,9 +401,8 @@
return_type name() const
The accessor member will return the parsed value when called. For normal fields, return_type equals type, the type of the sub parser. This allows to change the value via the returned - sub-parser. If the field is marked read-only (\ref SENF_PARSER_FIELD_RO() or \ref - SENF_PARSER_PRIVATE_FIELD_RO()), the return type will be - type::value_type.
+ sub-parser. If the field is marked read-only (\ref SENF_PARSER_FIELD_RO()), the return type + will be type::value_type.
typedef type name_t
This typedef symbol is an alias for the fields type.
@@ -420,8 +418,7 @@ \param[in] name field name \param[in] type parser type - \see \ref SENF_PARSER_FIELD_RO(), \ref SENF_PARSER_PRIVATE_FIELD(), \ref - SENF_PARSER_PRIVATE_FIELD_RO() + \see \ref SENF_PARSER_FIELD_RO(), \ref SENF_PARSER_PRIVATE_FIELD() \hideinitializer */ #define SENF_PARSER_FIELD(name, type) @@ -431,6 +428,10 @@ Define read-only parser field. Read-only fields may only be defined for \a type's which are value parsers: The parser \a type must have a \c value_type typedef member and a \c value() member, which returns the current value of the field. + + Defining such a field really defines \e two accessors: A read/write \e private field and a + read-only \e public accessor. The name of the private read/write field is given by adding a + trailing '_' to \a name. The read-only public accessor is called \a name. \see SENF_PARSER_FIELD() \hideinitializer @@ -447,18 +448,6 @@ */ #define SENF_PARSER_PRIVATE_FIELD(name, type) -/** \brief Define parser field (private + read-only) - - Define a read-only parser field which is marked as \c private and may only be accessed from the - parser class itself. Read-only fields may only be defined for \a type's which are value parsers: - The parser \a type must have a \c value_type typedef member and a \c value() member, which - returns the current value of the field. - - \see SENF_PARSER_FIELD() - \hideinitializer - */ -#define SENF_PARSER_PRIVATE_FIELD_RO(name, type) - /** \brief Define custom field accessor This macro is used to define a field using a custom access method: @@ -516,18 +505,16 @@ \param[in] bits number of bits \param[in] type bit field type, one of \c signed, \c unsigned or \c bool - \see \ref SENF_PARSER_BITFIELD_RO(), \ref SENF_PARSER_PRIVATE_BITFIELD(), \ref - SENF_PARSER_PRIVATE_BITFIELD_RO() - + \see \ref SENF_PARSER_BITFIELD_RO(), \ref SENF_PARSER_PRIVATE_BITFIELD() \hideinitializer */ #define SENF_PARSER_BITFIELD(name, bits, type) /** \brief Define bit-field (read-only) - Define read-only bit field. + Define read-only bit field. This is for bit-fields what \ref SENF_PARSER_FIELD_RO is for ordinary fields. - \see \ref SENF_PARSER_BITFIELD() + \see \ref SENF_PARSER_BITFIELD() \n \ref SENF_PARSER_FIELD_RO() \hideinitializer */ #define SENF_PARSER_BITFIELD_RO(name, bits, type) @@ -542,16 +529,6 @@ */ #define SENF_PARSER_PRIVATE_BITFIELD(name, bits, type) -/** \brief Define bit-field (private + read-only) - - Define a read-only bit field which is marked as \c private and may only be accessed from the - parser class itself. - - \see \ref SENF_PARSER_BITFIELD() - \hideinitializer - */ -#define SENF_PARSER_PRIVATE_BITFIELD_RO(name, bits, type) - ///@} ///\name Current offset @@ -685,30 +662,28 @@ #else -#define SENF_PARSER_INHERIT BOOST_PP_CAT(SENF_PARSER_INHERIT_, SENF_PARSER_TYPE) +#define SENF_PARSER_INHERIT BOOST_PP_CAT( SENF_PARSER_INHERIT_, SENF_PARSER_TYPE ) -#define SENF_PARSER_FIELD BOOST_PP_CAT(SENF_PARSER_FIELD_, SENF_PARSER_TYPE) -#define SENF_PARSER_FIELD_RO BOOST_PP_CAT(SENF_PARSER_FIELD_RO_, SENF_PARSER_TYPE) -#define SENF_PARSER_BITFIELD BOOST_PP_CAT(SENF_PARSER_BITFIELD_, SENF_PARSER_TYPE) -#define SENF_PARSER_BITFIELD_RO BOOST_PP_CAT(SENF_PARSER_BITFIELD_RO_, SENF_PARSER_TYPE) -#define SENF_PARSER_CUSTOM_FIELD BOOST_PP_CAT(SENF_PARSER_CUSTOM_FIELD_, SENF_PARSER_TYPE) +#define SENF_PARSER_FIELD BOOST_PP_CAT( SENF_PARSER_FIELD_, SENF_PARSER_TYPE ) +#define SENF_PARSER_FIELD_RO BOOST_PP_CAT( SENF_PARSER_FIELD_RO_, SENF_PARSER_TYPE ) +#define SENF_PARSER_BITFIELD BOOST_PP_CAT( SENF_PARSER_BITFIELD_, SENF_PARSER_TYPE ) +#define SENF_PARSER_BITFIELD_RO BOOST_PP_CAT( SENF_PARSER_BITFIELD_RO_, SENF_PARSER_TYPE ) +#define SENF_PARSER_CUSTOM_FIELD BOOST_PP_CAT( SENF_PARSER_CUSTOM_FIELD_, SENF_PARSER_TYPE ) -#define SENF_PARSER_PRIVATE_FIELD BOOST_PP_CAT(SENF_PARSER_P_FIELD_, SENF_PARSER_TYPE) -#define SENF_PARSER_PRIVATE_FIELD_RO BOOST_PP_CAT(SENF_PARSER_P_FIELD_RO_, SENF_PARSER_TYPE) -#define SENF_PARSER_PRIVATE_BITFIELD BOOST_PP_CAT(SENF_PARSER_P_BITFIELD_, SENF_PARSER_TYPE) -#define SENF_PARSER_PRIVATE_BITFIELD_RO BOOST_PP_CAT(SENF_PARSER_P_BITFIELD_RO_, SENF_PARSER_TYPE) +#define SENF_PARSER_PRIVATE_FIELD BOOST_PP_CAT( SENF_PARSER_P_FIELD_, SENF_PARSER_TYPE ) +#define SENF_PARSER_PRIVATE_BITFIELD BOOST_PP_CAT( SENF_PARSER_P_BITFIELD_, SENF_PARSER_TYPE ) -#define SENF_PARSER_SKIP BOOST_PP_CAT(SENF_PARSER_SKIP_, SENF_PARSER_TYPE) -#define SENF_PARSER_SKIP_BITS BOOST_PP_CAT(SENF_PARSER_SKIP_BITS_, SENF_PARSER_TYPE) -#define SENF_PARSER_GOTO BOOST_PP_CAT(SENF_PARSER_GOTO_, SENF_PARSER_TYPE) -#define SENF_PARSER_GOTO_OFFSET BOOST_PP_CAT(SENF_PARSER_GOTO_OFFSET_, SENF_PARSER_TYPE) -#define SENF_PARSER_LABEL BOOST_PP_CAT(SENF_PARSER_LABEL_, SENF_PARSER_TYPE) +#define SENF_PARSER_SKIP BOOST_PP_CAT( SENF_PARSER_SKIP_, SENF_PARSER_TYPE ) +#define SENF_PARSER_SKIP_BITS BOOST_PP_CAT( SENF_PARSER_SKIP_BITS_, SENF_PARSER_TYPE ) +#define SENF_PARSER_GOTO BOOST_PP_CAT( SENF_PARSER_GOTO_, SENF_PARSER_TYPE ) +#define SENF_PARSER_GOTO_OFFSET BOOST_PP_CAT( SENF_PARSER_GOTO_OFFSET_, SENF_PARSER_TYPE ) +#define SENF_PARSER_LABEL BOOST_PP_CAT( SENF_PARSER_LABEL_, SENF_PARSER_TYPE ) -#define SENF_PARSER_OFFSET BOOST_PP_CAT(SENF_PARSER_OFFSET_, SENF_PARSER_TYPE) -#define SENF_PARSER_FIXED_OFFSET BOOST_PP_CAT(SENF_PARSER_FIXED_OFFSET_,SENF_PARSER_TYPE) -#define SENF_PARSER_CURRENT_FIXED_OFFSET BOOST_PP_CAT(SENF_PARSER_CURRENT_FIXED_OFFSET_, SENF_PARSER_TYPE) +#define SENF_PARSER_OFFSET BOOST_PP_CAT( SENF_PARSER_OFFSET_, SENF_PARSER_TYPE ) +#define SENF_PARSER_FIXED_OFFSET BOOST_PP_CAT( SENF_PARSER_FIXED_OFFSET_, SENF_PARSER_TYPE ) +#define SENF_PARSER_CURRENT_FIXED_OFFSET BOOST_PP_CAT( SENF_PARSER_CURRENT_FIXED_OFFSET_, SENF_PARSER_TYPE ) -#define SENF_PARSER_FINALIZE BOOST_PP_CAT(SENF_PARSER_FINALIZE_, SENF_PARSER_TYPE) +#define SENF_PARSER_FINALIZE BOOST_PP_CAT( SENF_PARSER_FINALIZE_, SENF_PARSER_TYPE ) #endif diff --git a/Packets/ParseHelpers.ih b/Packets/ParseHelpers.ih index c3afdee..7e67282 100644 --- a/Packets/ParseHelpers.ih +++ b/Packets/ParseHelpers.ih @@ -90,9 +90,7 @@ # define SENF_PARSER_FIELD_RO_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, ro, public) # # define SENF_PARSER_P_FIELD_var(name, type) SENF_PARSER_FIELD_I(name, type, var, rw, private) -# define SENF_PARSER_P_FIELD_RO_var(name, type) SENF_PARSER_FIELD_I(name, type, var, ro, private) # define SENF_PARSER_P_FIELD_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, rw, private) -# define SENF_PARSER_P_FIELD_RO_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, ro, private) # # define SENF_PARSER_FIELD_I(name, type, ofstype, rwtype, access) \ access: \ @@ -121,7 +119,7 @@ # //////////////////////////////////////// # // SENF_PARSER_I_FIELD_INIT_* # -# define SENF_PARSER_I_FIELD_INIT_rw(name, type, access) \ +# define SENF_PARSER_I_FIELD_INIT_rw(name, type, access) \ private: \ void init_chain(senf::mpl::rv*) const { \ init_chain(static_cast*>(0)); \ @@ -129,7 +127,7 @@ } \ access: # -# define SENF_PARSER_I_FIELD_INIT_ro(name, type, access) \ +# define SENF_PARSER_I_FIELD_INIT_ro(name, type, access) \ private: \ void init_chain(senf::mpl::rv*) const { \ init_chain(static_cast*>(0)); \ @@ -187,16 +185,21 @@ } # # define SENF_PARSER_I_FIELD_VAL_ro(name, type, access) \ + private: \ + BOOST_PP_CAT(name, _t) BOOST_PP_CAT(name, _)() const { \ + return parse( SENF_PARSER_OFFSET(name) ); \ + } \ + access: \ BOOST_PP_CAT(name, _t)::value_type name() const { \ - return parse( SENF_PARSER_OFFSET(name) ).value(); \ + return BOOST_PP_CAT(name,_)(); \ } # # /////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_CUSTOM_FIELD_* # -# define SENF_PARSER_CUSTOM_FIELD_var(name, type, size, isize) \ +# define SENF_PARSER_CUSTOM_FIELD_var(name, type, size, isize) \ SENF_PARSER_CUSTOM_FIELD_I(name, type, size, isize, var) -# define SENF_PARSER_CUSTOM_FIELD_fix(name, type, size) \ +# define SENF_PARSER_CUSTOM_FIELD_fix(name, type, size) \ SENF_PARSER_CUSTOM_FIELD_I(name, type, size, size, fix) # # define SENF_PARSER_CUSTOM_FIELD_I(name, type, size, isize, ofstype) \ @@ -222,12 +225,8 @@ # # define SENF_PARSER_P_BITFIELD_var(name, bits, type) \ SENF_PARSER_BITFIELD_I(name, bits, type, var, rw, private) -# define SENF_PARSER_P_BITFIELD_RO_var(name, bits, type) \ - SENF_PARSER_BITFIELD_I(name, bits, type, var, ro, private) # define SENF_PARSER_P_BITFIELD_fix(name, bits, type) \ SENF_PARSER_BITFIELD_I(name, bits, type, fix, rw, private) -# define SENF_PARSER_P_BITFIELD_RO_fix(name, bits, type) \ - SENF_PARSER_BITFIELD_I(name, bits, type, fix, ro, private) # # //////////////////////////////////////// # // SENF_PARSER_BITFIELD_I diff --git a/SConstruct b/SConstruct index 0e71c6d..8dffb8c 100644 --- a/SConstruct +++ b/SConstruct @@ -130,6 +130,7 @@ def configFilesOpts(target, source, env, for_signature): env.Append( CPPPATH = [ '#/include' ], LIBS = [ 'iberty', '$BOOSTREGEXLIB' ], + TEST_EXTRA_LIBS = [ '$BOOSTFSLIB' ], DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ], DOXY_HTML_XSL = '#/doclib/html-munge.xsl', ENV = { 'TODAY' : str(datetime.date.today()), diff --git a/Socket/Protocols/INet/INet6Address.hh b/Socket/Protocols/INet/INet6Address.hh index 68aaeae..9e34707 100644 --- a/Socket/Protocols/INet/INet6Address.hh +++ b/Socket/Protocols/INet/INet6Address.hh @@ -71,7 +71,7 @@ namespace senf { - + diff --git a/Socket/Protocols/INet/INetAddressing.cc b/Socket/Protocols/INet/INetAddressing.cc index dd5d6e1..b0cb962 100644 --- a/Socket/Protocols/INet/INetAddressing.cc +++ b/Socket/Protocols/INet/INetAddressing.cc @@ -130,7 +130,7 @@ prefix_ std::string senf::INet6SocketAddress::iface() if (sockaddr_.sin6_scope_id == 0) return ""; char buffer[IFNAMSIZ]; -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG SENF_ASSERT( if_indextoname(sockaddr_.sin6_scope_id,buffer) ); #else if_indextoname(sockaddr_.sin6_scope_id,buffer); diff --git a/Socket/Protocols/INet/MulticastSocketProtocol.hh b/Socket/Protocols/INet/MulticastSocketProtocol.hh index 2d93ae7..e8249ce 100644 --- a/Socket/Protocols/INet/MulticastSocketProtocol.hh +++ b/Socket/Protocols/INet/MulticastSocketProtocol.hh @@ -73,7 +73,7 @@ namespace senf { /** \brief Multicast protocol facet for INet4 addressable multicast enabled sockets */ class INet4MulticastSocketProtocol - : public virtual SocketProtocol + : public MulticastSocketProtocol { public: void mcAddMembership(INet4Address const & mcAddr) const; @@ -130,7 +130,7 @@ namespace senf { /** \brief Multicast protocol facet for INet6 addressable multicast enabled sockets */ class INet6MulticastSocketProtocol - : public virtual SocketProtocol + : public MulticastSocketProtocol { public: void mcAddMembership(INet6Address const & mcAddr) const; diff --git a/Socket/Protocols/INet/RawINetSocketHandle.hh b/Socket/Protocols/INet/RawINetSocketHandle.hh index ed2ae74..363b38e 100644 --- a/Socket/Protocols/INet/RawINetSocketHandle.hh +++ b/Socket/Protocols/INet/RawINetSocketHandle.hh @@ -79,7 +79,6 @@ namespace senf { public BSDSocketProtocol, public AddressableBSDSocketProtocol, public DatagramSocketProtocol, - public MulticastSocketProtocol, public INet4MulticastSocketProtocol { public: @@ -147,7 +146,6 @@ namespace senf { public BSDSocketProtocol, public AddressableBSDSocketProtocol, public DatagramSocketProtocol, - public MulticastSocketProtocol, public INet6MulticastSocketProtocol { public: diff --git a/Socket/Protocols/INet/UDPSocketHandle.hh b/Socket/Protocols/INet/UDPSocketHandle.hh index a90163e..378511e 100644 --- a/Socket/Protocols/INet/UDPSocketHandle.hh +++ b/Socket/Protocols/INet/UDPSocketHandle.hh @@ -80,7 +80,6 @@ namespace senf { class UDPv4SocketProtocol : public ConcreteSocketProtocol, public UDPSocketProtocol, - public MulticastSocketProtocol, public INet4MulticastSocketProtocol, public BSDSocketProtocol, public DatagramSocketProtocol, @@ -140,7 +139,6 @@ namespace senf { class UDPv6SocketProtocol : public ConcreteSocketProtocol, public UDPSocketProtocol, - public MulticastSocketProtocol, public INet6MulticastSocketProtocol, public BSDSocketProtocol, public DatagramSocketProtocol, diff --git a/Socket/SocketPolicy.hh b/Socket/SocketPolicy.hh index 209c374..06d1359 100644 --- a/Socket/SocketPolicy.hh +++ b/Socket/SocketPolicy.hh @@ -61,7 +61,7 @@
readPolicy
configures the readability of the socket
-
writePolicy
configures the writability of the socket
+
writePolicy
configures the writability of the socket
The template senf::SocketPolicy combines these policy axis to form a concrete socket policy. In a concrete policy, each of these policy axis is assigned a value, the policy value. This value diff --git a/Utils/Daemon/Daemon.cc b/Utils/Daemon/Daemon.cc index 73fbf5d..849f4c6 100644 --- a/Utils/Daemon/Daemon.cc +++ b/Utils/Daemon/Daemon.cc @@ -186,7 +186,7 @@ prefix_ int senf::Daemon::start(int argc, char const ** argv) return e.code; } -#ifdef SENF_NO_DEBUG +#ifndef SENF_DEBUG catch (std::exception & e) { std::cerr << "\n*** Fatal exception: " << e.what() << std::endl; diff --git a/Utils/pool_alloc_mixin.cti b/Utils/pool_alloc_mixin.cti index 9b739e9..e2a80ab 100644 --- a/Utils/pool_alloc_mixin.cti +++ b/Utils/pool_alloc_mixin.cti @@ -37,7 +37,7 @@ prefix_ void * senf::pool_alloc_mixin::operator new(size_t size) // When deriving from Self you may not change the class's size without // inheriting from pool_alloc_mixin again. See pool_alloc_mixin documentation. SENF_ASSERT( size <= sizeof(Self) ); -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG allocCounter(1); #endif return boost::singleton_pool< pool_alloc_mixin_tag, sizeof(Self) >::malloc(); @@ -46,13 +46,13 @@ prefix_ void * senf::pool_alloc_mixin::operator new(size_t size) template prefix_ void senf::pool_alloc_mixin::operator delete(void * p, size_t size) { -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG allocCounter(-1); #endif boost::singleton_pool< pool_alloc_mixin_tag, sizeof(Self) >::free(p); } -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG template prefix_ unsigned long senf::pool_alloc_mixin::allocCounter() diff --git a/Utils/pool_alloc_mixin.hh b/Utils/pool_alloc_mixin.hh index 642e476..5fab5f6 100644 --- a/Utils/pool_alloc_mixin.hh +++ b/Utils/pool_alloc_mixin.hh @@ -84,7 +84,7 @@ namespace senf { static void operator delete (void *p, size_t size); ///< Operator delete utilizing pool allocation -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG static unsigned long allocCounter(); private: static unsigned long allocCounter(long delta); diff --git a/Utils/pool_alloc_mixin.test.cc b/Utils/pool_alloc_mixin.test.cc index 5d130ed..60957cf 100644 --- a/Utils/pool_alloc_mixin.test.cc +++ b/Utils/pool_alloc_mixin.test.cc @@ -43,7 +43,7 @@ namespace { BOOST_AUTO_UNIT_TEST(poolAllocMixin) { -#ifndef SENF_NO_DEBUG +#ifdef SENF_DEBUG BOOST_CHECK_EQUAL( Test::allocCounter(), 0u ); { diff --git a/Utils/senfassert.hh b/Utils/senfassert.hh index 7f488c8..245bca9 100644 --- a/Utils/senfassert.hh +++ b/Utils/senfassert.hh @@ -32,7 +32,7 @@ //#include "senfassert.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -#ifdef SENF_NO_DEBUG +#ifndef SENF_DEBUG # define SENF_ASSERT(x) diff --git a/config.hh b/config.hh index 42fb595..2906030 100644 --- a/config.hh +++ b/config.hh @@ -70,7 +70,7 @@ # endif # # ifndef SENF_SENFLOG_LIMIT -# ifdef SENF_NO_DEBUG +# ifndef SENF_DEBUG # define SENF_SENFLOG_LIMIT senf::log::IMPORTANT # else # define SENF_SENFLOG_LIMIT senf::log::VERBOSE diff --git a/debian/control b/debian/control index c3b214e..2cef2a4 100644 --- a/debian/control +++ b/debian/control @@ -1,9 +1,9 @@ Source: libsenf Priority: extra Maintainer: Stefan Bund -Build-Depends: debhelper (>= 5), scons, binutils-dev, libboost-dev, +Build-Depends: debhelper (>= 5), scons (>= 0.97), binutils-dev, libboost-dev, libboost-test-dev, libboost-date-time-dev, libboost-regex-dev, - libboost-filesystem-dev, doxygen, dia, tidy, xsltproc, + libboost-filesystem-dev, doxygen (>= 1.5.5), dia, tidy, xsltproc, graphviz, perl-base, linklint, netpbm Standards-Version: 3.7.2 Section: libs diff --git a/senfscons/BoostUnitTests.py b/senfscons/BoostUnitTests.py index 18442e3..f2516f3 100644 --- a/senfscons/BoostUnitTests.py +++ b/senfscons/BoostUnitTests.py @@ -34,8 +34,9 @@ def BoostUnitTests(env, target, objects, test_sources=None, LIBS = [], OBJECTS = else: test_sources = [] testEnv = env.Copy(**kw) - testEnv.Prepend(_LIBFLAGS = ' -Wl,-Bstatic -l$BOOSTTESTLIB -l$BOOSTFSLIB -Wl,-Bdynamic ') + testEnv.Prepend(_LIBFLAGS = ' -Wl,-Bstatic -l$BOOSTTESTLIB -Wl,-Bdynamic ') testEnv.Prepend(LIBS = LIBS) + testEnv.Append(LIBS = env['TEST_EXTRA_LIBS']) all_objects = [] if not objects: objects = [] diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index 125984a..5df4947 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -246,12 +246,12 @@ def MakeEnvironment(): LIBPATH = [ '$LOCALLIBDIR' ]) if env['final']: - env.Append(CXXFLAGS = [ '-O3' ], - CPPDEFINES = [ 'SENF_NO_DEBUG' ]) + env.Append(CXXFLAGS = [ '-O3' ]) else: + # The boost-regex library is not compiled with _GLIBCXX_DEBUG so this fails: + # CPPDEFINES = [ '_GLIBCXX_DEBUG' ], env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ], - # The boost-regex library is not compiled with _GLIBCXX_DEBUG so this fails. - # CPPDEFINES = [ '_GLIBCXX_DEBUG' ], + CPPDEFINES = [ 'SENF_DEBUG' ], LINKFLAGS = [ '-g' ]) env.Append(CPPDEFINES = [ '$EXTRA_DEFINES' ],
Prefix Description Definition Note
::/96 IPv4 compatible IPv6 address RFC4291 deprecated
::ffff:0:0/96 IPv6 mapped IPv4 address RFC4291
\::ffff:0:0/96 IPv6 mapped IPv4 address RFC4291
2000::/3 Global unicast addresses RFC3587 only noted, not defined
2001:db8::/32 Documentation-only prefix RFC3849
2002::/16 6to4 addressing RFC3056