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

minor fixes

parent 437280a5
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
......@@ -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<MIHPacketType>
......
......@@ -30,12 +30,31 @@
#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_
......
......@@ -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);
}
......
......@@ -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
{
......
......@@ -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
......
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