}
template <class Reader>
-prefix_ senf::ppi::module::ActiveSocketSource<Reader>::
-ActiveSocketSource(Handle handle)
+prefix_ senf::ppi::module::ActiveSocketSource<Reader>::ActiveSocketSource(Handle handle)
: handle_(handle), event_(handle_, IOEvent::Read)
{
registerEvent( event_, &ActiveSocketSource::read );
// 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 <boost/io/ios_state.hpp>
#include "../../Packets/DefaultBundle/IPv6Packet.hh"
#include "../../Utils/IpChecksum.hh"
#define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
namespace {
senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::ICMPv6Packet>
<< "Checksum : " << p->checksum() << "\n";
}
+///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
\f
// 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()
static void dump(packet p, std::ostream & os);
- static IpTypes::key_t nextPacketKey(packet p) {
+ static key_t nextPacketKey(packet p) {
return p->type();
}
typedef ConcretePacket<ICMPv6PacketType> ICMPv6Packet;
}
+///////////////////////////////hh.e////////////////////////////////////////
+#endif
+#ifndef SENF_PACKETS_DECL_ONLY
+//#include "IPv4Packet.cci"
+//#include "IPv4Packet.ct"
+//#include "IPv4Packet.cti"
#endif
\f
// compile-command: "scons -u test"
// comment-column: 40
// End:
+
// 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 <boost/test/test_tools.hpp>
-#include "ICMPv6Packet.hh"
-#include "ICMPv6TypePacket.hh"
+
BOOST_AUTO_UNIT_TEST(ICMPv6Packet_packet)
{
#define HH_SENF_Packets_DefaultBundle_ICMPv6TypePacket_ 1
// Custom includes
-#include "../../Packets/Packets.hh"
+#include "../Packets.hh"
+#include "IPv6Packet.hh"
#include "ICMPv6Packet.hh"
namespace senf {
///\name Structors and default members
///@{
- ConfigBundle();
+ ConfigBundle(); ///< root node is set to console::root()
ConfigBundle(DirectoryNode & root); ///< Set custom root node
///@}
Source & add(boost::intrusive_ptr<Source> 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:
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)
ss << "\nException at\n";
formatBacktrace(ss, entries, nEntries);
ss << "-- \n" << message_;
- message_ = ss.str();
+ what_ = ss.str();
}
#endif
prefix_ char const * senf::Exception::what()
const throw()
{
- return message().c_str();
+ return what_.c_str();
}
///////////////////////////////////////////////////////////////////////////
// senf::ExceptionMixin
prefix_ senf::ExceptionMixin::ExceptionMixin(std::string const & description)
- : message_(description)
+ : what_(description),
+ message_(description)
{
#ifdef SENF_DEBUG
addBacktrace();
prefix_ void senf::ExceptionMixin::append(std::string text)
{
message_ += text;
+ what_ += text;
}
///////////////////////////////////////////////////////////////////////////
prefix_ char const * senf::WrapException<BaseException>::what()
const throw()
{
- return message().c_str();
+ return what_.c_str();
}
/////////////////////////////cti.e///////////////////////////////////////
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:
string. This should probably be a string constant
describing the exception for most derived
exceptions. */
-
+ std::string what_;
private:
#ifdef SENF_DEBUG
void addBacktrace();
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 = "");
void init(std::string const & descr, int code _SENF_EXC_DEBUG_ARGS_ND);
int code_;
- std::string what_;
};
# ifdef SENF_DEBUG
/** \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 <a
- href="ttp://tools.ietf.org/html/rfc3164">RFC-3164</a>.
+ 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 <a
+ href="http://tools.ietf.org/html/rfc3164">RFC-3164</a>.
This log target has some important benefits:
the default facility is <tt>LOG_USER</tt>
- 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:
<table class="senf fixedcolumn">
<tr><td>senf::log::VERBOSE</td> <td>\c LOG_DEBUG</td></tr>
</table>
\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
/**< 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();
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:
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