{
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"
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()
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>
#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_
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;
} else {
safeThis->extended_length_flag() = false;
}
- value(v);
+ safeThis->value(v);
}
/** \brief Internal: Apply transformation to arbitrary aux-parser policy
- Transform must statisfy the interface
+ Transform must satisfy the interface
\code
struct Transform
{
\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