From: tho Date: Tue, 7 Apr 2009 15:14:02 +0000 (+0000) Subject: Packets/DefaultBundle/ICMP: sorted includes X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=f5eba06e0b792b9e70555def60b0b98b8139381c;p=senf.git Packets/DefaultBundle/ICMP: sorted includes Utils/Exception: message() does not include backtrace informations fixed some documentation git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1182 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/PPI/SocketSource.ct b/PPI/SocketSource.ct index a573858..e225661 100644 --- a/PPI/SocketSource.ct +++ b/PPI/SocketSource.ct @@ -60,8 +60,7 @@ prefix_ senf::ppi::module::ActiveSocketSource::ActiveSocketSource(Reader } template -prefix_ senf::ppi::module::ActiveSocketSource:: -ActiveSocketSource(Handle handle) +prefix_ senf::ppi::module::ActiveSocketSource::ActiveSocketSource(Handle handle) : handle_(handle), event_(handle_, IOEvent::Read) { registerEvent( event_, &ActiveSocketSource::read ); diff --git a/Packets/DefaultBundle/ICMPv6Packet.cc b/Packets/DefaultBundle/ICMPv6Packet.cc index 0556fec..9d5d104 100644 --- a/Packets/DefaultBundle/ICMPv6Packet.cc +++ b/Packets/DefaultBundle/ICMPv6Packet.cc @@ -20,14 +20,19 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// Custom includes -#include "../../Packets/Packets.hh" +/** \file + \brief ICMPv6Packet non-inline non-template implementation */ + #include "ICMPv6Packet.hh" +//#include "ICMPv6Packet.ih" + +// Custom includes #include #include "../../Packets/DefaultBundle/IPv6Packet.hh" #include "../../Utils/IpChecksum.hh" #define prefix_ +///////////////////////////////cc.p//////////////////////////////////////// namespace { senf::PacketRegistry::RegistrationProxy @@ -74,6 +79,7 @@ prefix_ void senf::ICMPv6PacketType::dump(packet p, std::ostream &os) << "Checksum : " << p->checksum() << "\n"; } +///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ diff --git a/Packets/DefaultBundle/ICMPv6Packet.hh b/Packets/DefaultBundle/ICMPv6Packet.hh index de33ead..032bfa3 100644 --- a/Packets/DefaultBundle/ICMPv6Packet.hh +++ b/Packets/DefaultBundle/ICMPv6Packet.hh @@ -20,16 +20,19 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +/** \file + \brief ICMPv6Packet public header */ + #ifndef HH_SENF_Packets_DefaultBundle_ICMPv6Packet_ #define HH_SENF_Packets_DefaultBundle_ICMPv6Packet_ 1 // Custom includes #include "../../Packets/Packets.hh" -#include "../../Packets/DefaultBundle/IPv6Packet.hh" +//#include "ICMPv6Packet.mpp" +///////////////////////////////hh.p//////////////////////////////////////// namespace senf { - struct ICMPv6PacketParser : public PacketParserBase { # include SENF_FIXED_PARSER() @@ -76,7 +79,7 @@ namespace senf static void dump(packet p, std::ostream & os); - static IpTypes::key_t nextPacketKey(packet p) { + static key_t nextPacketKey(packet p) { return p->type(); } @@ -89,6 +92,12 @@ namespace senf typedef ConcretePacket ICMPv6Packet; } +///////////////////////////////hh.e//////////////////////////////////////// +#endif +#ifndef SENF_PACKETS_DECL_ONLY +//#include "IPv4Packet.cci" +//#include "IPv4Packet.ct" +//#include "IPv4Packet.cti" #endif @@ -101,3 +110,4 @@ namespace senf // compile-command: "scons -u test" // comment-column: 40 // End: + diff --git a/Packets/DefaultBundle/ICMPv6Packet.test.cc b/Packets/DefaultBundle/ICMPv6Packet.test.cc index 497d2dc..a1b9b8c 100644 --- a/Packets/DefaultBundle/ICMPv6Packet.test.cc +++ b/Packets/DefaultBundle/ICMPv6Packet.test.cc @@ -20,17 +20,16 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// Definition of non-inline non-template functions - /** \file \brief ICMPv6Packet unit tests */ // Custom includes +#include "ICMPv6Packet.hh" +#include "ICMPv6TypePacket.hh" #include "../../Utils/auto_unit_test.hh" #include -#include "ICMPv6Packet.hh" -#include "ICMPv6TypePacket.hh" + BOOST_AUTO_UNIT_TEST(ICMPv6Packet_packet) { diff --git a/Packets/DefaultBundle/ICMPv6TypePacket.hh b/Packets/DefaultBundle/ICMPv6TypePacket.hh index 7196f4f..47834a1 100644 --- a/Packets/DefaultBundle/ICMPv6TypePacket.hh +++ b/Packets/DefaultBundle/ICMPv6TypePacket.hh @@ -26,7 +26,8 @@ #define HH_SENF_Packets_DefaultBundle_ICMPv6TypePacket_ 1 // Custom includes -#include "../../Packets/Packets.hh" +#include "../Packets.hh" +#include "IPv6Packet.hh" #include "ICMPv6Packet.hh" namespace senf { diff --git a/Utils/Console/Config.hh b/Utils/Console/Config.hh index 64d9802..5bd384c 100644 --- a/Utils/Console/Config.hh +++ b/Utils/Console/Config.hh @@ -67,7 +67,7 @@ namespace console { ///\name Structors and default members ///@{ - ConfigBundle(); + ConfigBundle(); ///< root node is set to console::root() ConfigBundle(DirectoryNode & root); ///< Set custom root node ///@} @@ -77,18 +77,18 @@ namespace console { Source & add(boost::intrusive_ptr source); ///< Add configuration source - void parse(); ///< Parse config file + void parse(); ///< Parse config bundle /**< All nodes already parsed are skipped */ - void parse(DirectoryNode & restrict); ///< Parse config file under \a restrict + void parse(DirectoryNode & restrict); ///< Parse config bundle under \a restrict /**< Only nodes which are children of \a restrict are - parsed. */ + parsed. */ bool complete() const; ///< \c true, if all nodes have been parsed bool parsed(GenericNode & node) const; ///< \c true. if \a node has been parsed void reset(); ///< Reset node parse info state /**< After a call to reset(), all information about already parsed nodes is cleared. Calling parse() will parse the - complete config file again. */ + complete config bundle again. */ protected: diff --git a/Utils/Console/Node.hh b/Utils/Console/Node.hh index 3e796ec..9a44c5a 100644 --- a/Utils/Console/Node.hh +++ b/Utils/Console/Node.hh @@ -278,7 +278,7 @@ namespace console { bool active() const; ///< \c true, if node is attached to the root() node - void help(std::ostream & output) const; /// Write help info to \a output + void help(std::ostream & output) const; ///< Write help info to \a output ptr thisptr(); ///< Get smart pointer to node cptr thisptr() const; ///< Get smart pointer to node (const) diff --git a/Utils/Exception.cc b/Utils/Exception.cc index b2c750f..737214d 100644 --- a/Utils/Exception.cc +++ b/Utils/Exception.cc @@ -48,7 +48,7 @@ prefix_ void senf::ExceptionMixin::addBacktrace() ss << "\nException at\n"; formatBacktrace(ss, entries, nEntries); ss << "-- \n" << message_; - message_ = ss.str(); + what_ = ss.str(); } #endif @@ -62,7 +62,7 @@ prefix_ senf::Exception::~Exception() prefix_ char const * senf::Exception::what() const throw() { - return message().c_str(); + return what_.c_str(); } /////////////////////////////////////////////////////////////////////////// diff --git a/Utils/Exception.cci b/Utils/Exception.cci index 189c2f1..3366fe2 100644 --- a/Utils/Exception.cci +++ b/Utils/Exception.cci @@ -31,7 +31,8 @@ // senf::ExceptionMixin prefix_ senf::ExceptionMixin::ExceptionMixin(std::string const & description) - : message_(description) + : what_(description), + message_(description) { #ifdef SENF_DEBUG addBacktrace(); @@ -47,6 +48,7 @@ prefix_ std::string const & senf::ExceptionMixin::message() prefix_ void senf::ExceptionMixin::append(std::string text) { message_ += text; + what_ += text; } /////////////////////////////////////////////////////////////////////////// diff --git a/Utils/Exception.cti b/Utils/Exception.cti index ea12370..4fb5379 100644 --- a/Utils/Exception.cti +++ b/Utils/Exception.cti @@ -56,7 +56,7 @@ template prefix_ char const * senf::WrapException::what() const throw() { - return message().c_str(); + return what_.c_str(); } /////////////////////////////cti.e/////////////////////////////////////// diff --git a/Utils/Exception.hh b/Utils/Exception.hh index cc23ae3..a91b157 100644 --- a/Utils/Exception.hh +++ b/Utils/Exception.hh @@ -140,9 +140,9 @@ namespace senf { class ExceptionMixin { public: - std::string const & message() const; + std::string const & message() const; ///< get exception description - void append(std::string text); ///< Extend exception description + void append(std::string text); ///< Extend exception description /**< Adds \a text to the description text. */ protected: @@ -152,7 +152,7 @@ namespace senf { string. This should probably be a string constant describing the exception for most derived exceptions. */ - + std::string what_; private: #ifdef SENF_DEBUG void addBacktrace(); @@ -177,6 +177,9 @@ namespace senf { virtual ~Exception() throw(); virtual char const * what() const throw(); + ///< get exception description and backtrace if available + /**< get description of the exception (message()) and backtrace + information if SENF is compiled with \c SENF_DEBUG */ protected: explicit Exception(std::string const & description = ""); @@ -299,7 +302,6 @@ namespace senf { void init(std::string const & descr, int code _SENF_EXC_DEBUG_ARGS_ND); int code_; - std::string what_; }; # ifdef SENF_DEBUG diff --git a/Utils/Logger/SyslogUDPTarget.hh b/Utils/Logger/SyslogUDPTarget.hh index 25bb893..71732d5 100644 --- a/Utils/Logger/SyslogUDPTarget.hh +++ b/Utils/Logger/SyslogUDPTarget.hh @@ -43,9 +43,9 @@ namespace log { /** \brief Log target writing UDP syslog packets - The SyslogUDPTarget will send all log messages directly via UDP to a target host. This host - should have a syslog daemon or relay running. The protocol is defined in RFC-3164. + The SyslogUDPTarget will send all %log messages directly via UDP to a target host. This + host should have a syslog daemon or relay running. The protocol is defined in RFC-3164. This log target has some important benefits: @@ -66,7 +66,7 @@ namespace log { the default facility is LOG_USER - The SENF log levels are mapped to syslog levels in the following way: + The SENF %log levels are mapped to syslog levels in the following way: @@ -78,8 +78,8 @@ namespace log {
senf::log::VERBOSE \c LOG_DEBUG
\note Since the UDP syslog packets are limited to 1024 characters and there must be some - space left so a relay may optionally add a timestamp and hostname section, the log - messages are split after 896 characters. Additionally the log messages are split at each + space left so a relay may optionally add a timestamp and hostname section, the %log + messages are split after 896 characters. Additionally the %log messages are split at each newline char since non-printable characters are not allowed. \implementation The RFC only \e recommends the exact message format. This allows us to @@ -119,7 +119,7 @@ namespace log { /**< When syslog format is disabled, messages are not formated as valid syslog messages but sent using plain UDP. */ - void syslog(bool enabled=true); /// Set syslog format + void syslog(bool enabled=true); ///< Set syslog format private: void init(); diff --git a/Utils/Logger/Target.hh b/Utils/Logger/Target.hh index 6f26ddd..f08ceb1 100644 --- a/Utils/Logger/Target.hh +++ b/Utils/Logger/Target.hh @@ -78,12 +78,12 @@ namespace log { stream \li (optional) \e area. If the area is specified, only messages directed at that area are matched, otherwise any area will be allowed - \li (optional) \e level. If the log level is specified, messages will be accepted if their + \li (optional) \e level. If the %log level is specified, messages will be accepted if their level is at least that value. If the value is not specified, the limit will be taken from the stream's default value. Each parameter (stream, area and level) has two representations: A static (compile time - constant) representation, which is the representation also used in the log statements, and a + constant) representation, which is the representation also used in the %log statements, and a dynamic representation, which may be used for manipulating the routing table. The static representation is used, when passing routing parameters via template arguments: diff --git a/Utils/Termlib/AbstractTerminal.hh b/Utils/Termlib/AbstractTerminal.hh index 22b3e0c..b3f396d 100644 --- a/Utils/Termlib/AbstractTerminal.hh +++ b/Utils/Termlib/AbstractTerminal.hh @@ -66,7 +66,7 @@ namespace term { virtual ~AbstractTerminal() {} - virtual void setCallbacks(Callbacks & cb) = 0; /// Register terminal callbacks + virtual void setCallbacks(Callbacks & cb) = 0; ///< Register terminal callbacks virtual std::string terminalType() = 0; ///< Get the terminal type virtual unsigned width() = 0; ///< Get current terminal window width