minor fixes
tho [Mon, 12 Jan 2009 12:08:40 +0000 (12:08 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1057 270642c3-0616-0410-b53a-bc976706d245

Packets/80221Bundle/MIHPacket.cc
Packets/80221Bundle/MIHPacket.hh
Packets/80221Bundle/MIHPacket.test.cc
Packets/80221Bundle/TLVPacket.cc
Packets/AuxParser.hh
Packets/Mainpage.dox

index ce0e086..97407c2 100644 (file)
@@ -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"
index 2c1da37..a67f0a6 100644 (file)
 
 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<MIHPacketType>
index 9edeabe..e0c9583 100644 (file)
 #include <boost/test/test_tools.hpp>
 
 #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_
index f79d84b..3bf2039 100644 (file)
@@ -163,11 +163,10 @@ prefix_ void senf::DynamicTLVLengthParser::resize(size_type size)
     size_type current_size (bytes());
     SafePacketParserWrapper<DynamicTLVLengthParser> 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);
 }
 
 
index c76926c..412bb2d 100644 (file)
@@ -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
         {
index 7482b9f..8847a5c 100644 (file)
@@ -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