Skip to content
Snippets Groups Projects
Commit 9bfcd99b authored by tho's avatar tho
Browse files

Packets/DefaultBundle/ICMP: sorted includes

Utils/Exception: message() does not include backtrace informations
fixed some documentation
parent e3c92e90
No related branches found
No related tags found
No related merge requests found
......@@ -60,8 +60,7 @@ prefix_ senf::ppi::module::ActiveSocketSource<Reader>::ActiveSocketSource(Reader
}
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 );
......
......@@ -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 <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>
......@@ -74,6 +79,7 @@ prefix_ void senf::ICMPv6PacketType::dump(packet p, std::ostream &os)
<< "Checksum : " << p->checksum() << "\n";
}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
......
......@@ -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<ICMPv6PacketType> 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:
......@@ -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 <boost/test/test_tools.hpp>
#include "ICMPv6Packet.hh"
#include "ICMPv6TypePacket.hh"
BOOST_AUTO_UNIT_TEST(ICMPv6Packet_packet)
{
......
......@@ -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 {
......
......@@ -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> 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:
......
......@@ -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)
......
......@@ -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();
}
///////////////////////////////////////////////////////////////////////////
......
......@@ -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;
}
///////////////////////////////////////////////////////////////////////////
......
......@@ -56,7 +56,7 @@ template <class BaseException>
prefix_ char const * senf::WrapException<BaseException>::what()
const throw()
{
return message().c_str();
return what_.c_str();
}
/////////////////////////////cti.e///////////////////////////////////////
......
......@@ -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
......
......@@ -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 <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:
......@@ -66,7 +66,7 @@ namespace log {
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>
......@@ -78,8 +78,8 @@ namespace log {
</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
......@@ -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();
......
......@@ -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:
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment