From: tho Date: Mon, 12 Jan 2009 12:08:40 +0000 (+0000) Subject: minor fixes X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=cfd663c444dee7e03a4b7579b544db2524332bfb;p=senf.git minor fixes git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1057 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Packets/80221Bundle/MIHPacket.cc b/Packets/80221Bundle/MIHPacket.cc index ce0e086..97407c2 100644 --- a/Packets/80221Bundle/MIHPacket.cc +++ b/Packets/80221Bundle/MIHPacket.cc @@ -37,7 +37,7 @@ prefix_ void senf::MIHPacketType::dump(packet p, std::ostream &os) { boost::io::ios_all_saver ias(os); os << "MIH Packet:\n" - << " protocol header:\n" << "\n" + << " protocol header:\n" << " Version: " << unsigned( p->version()) << "\n" << " Ack-Request: " << p->ackRequest() << "\n" << " Ack-Response: " << p->ackResponse() << "\n" diff --git a/Packets/80221Bundle/MIHPacket.hh b/Packets/80221Bundle/MIHPacket.hh index 2c1da37..a67f0a6 100644 --- a/Packets/80221Bundle/MIHPacket.hh +++ b/Packets/80221Bundle/MIHPacket.hh @@ -35,14 +35,14 @@ namespace senf { - struct MIHF_IdParser : public senf::PacketParserBase + struct MIHF_IdParser : public PacketParserBase { - # include SENF_FIXED_PARSER() + # include SENF_PARSER() SENF_PARSER_FINALIZE ( MIHF_IdParser ); }; - struct MIHPacketParser : public senf::PacketParserBase + struct MIHPacketParser : public PacketParserBase { # include SENF_PARSER() @@ -84,7 +84,16 @@ namespace senf { friend class MIHPacketType; }; - + /** \brief MIH packet + + \par Packet type (typedef): + \ref MIHPacket + + \par Fields: + \ref MIHPacketParser + + \ingroup protocolbundle_80221 + */ struct MIHPacketType : public PacketTypeBase, public PacketTypeMixin diff --git a/Packets/80221Bundle/MIHPacket.test.cc b/Packets/80221Bundle/MIHPacket.test.cc index 9edeabe..e0c9583 100644 --- a/Packets/80221Bundle/MIHPacket.test.cc +++ b/Packets/80221Bundle/MIHPacket.test.cc @@ -30,12 +30,31 @@ #include #include "MIHPacket.hh" +#include "senf/Utils/hexdump.hh" +using namespace senf; #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// - +BOOST_AUTO_UNIT_TEST(MIHPacket_create) +{ + MIHPacket mihPacket (MIHPacket::create()); + // set some fields + mihPacket->fragmentNr() = 42; + mihPacket->transactionId() = 21; + mihPacket.finalizeThis(); + +// mihPacket.dump(std::cout); +// senf::hexdump(mihPacket.data().begin(), mihPacket.data().end(), std::cout); + + unsigned char data[] = { + 0x10, 0x54, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, + 0x01, 0x00, + 0x02, 0x00 + }; + BOOST_CHECK( equal( mihPacket.data().begin(), mihPacket.data().end(), data )); +} ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ diff --git a/Packets/80221Bundle/TLVPacket.cc b/Packets/80221Bundle/TLVPacket.cc index f79d84b..3bf2039 100644 --- a/Packets/80221Bundle/TLVPacket.cc +++ b/Packets/80221Bundle/TLVPacket.cc @@ -163,11 +163,10 @@ prefix_ void senf::DynamicTLVLengthParser::resize(size_type size) size_type current_size (bytes()); SafePacketParserWrapper safeThis (*this); - safe_data_iterator si (data(), i()); if (current_size > size) - data().erase( si, boost::next(si, current_size-size)); + data().erase( i(), boost::next(i(), current_size-size)); else - data().insert( si, size-current_size, 0); + data().insert( i(), size-current_size, 0); if (size > 1) { safeThis->extended_length_flag() = true; @@ -175,7 +174,7 @@ prefix_ void senf::DynamicTLVLengthParser::resize(size_type size) } else { safeThis->extended_length_flag() = false; } - value(v); + safeThis->value(v); } diff --git a/Packets/AuxParser.hh b/Packets/AuxParser.hh index c76926c..412bb2d 100644 --- a/Packets/AuxParser.hh +++ b/Packets/AuxParser.hh @@ -122,7 +122,7 @@ namespace detail { /** \brief Internal: Apply transformation to arbitrary aux-parser policy - Transform must statisfy the interface + Transform must satisfy the interface \code struct Transform { diff --git a/Packets/Mainpage.dox b/Packets/Mainpage.dox index 7482b9f..8847a5c 100644 --- a/Packets/Mainpage.dox +++ b/Packets/Mainpage.dox @@ -67,6 +67,7 @@ \li \ref protocolbundle_default : Some basic default protocols: Ethernet, Ip, TCP, UDP \li \ref protocolbundle_mpegdvb : MPEG and DVB protocols \li \ref protocolbundle_80211 : 802.11 protocols + \li \ref protocolbundle_80221 : 802.21 protocols There are two ways to link with a bundle