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

Packets/80221Bundle: set messageId on finalize

parent 650ae548
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,6 @@ prefix_ void senf::MIHFId_TLVParser::setString(std::string const &id) ...@@ -50,7 +50,6 @@ prefix_ void senf::MIHFId_TLVParser::setString(std::string const &id)
std::copy( id.begin(), id.end(), si); std::copy( id.begin(), id.end(), si);
} }
prefix_ senf::MACAddress senf::MIHFId_TLVParser::asMACAddress() prefix_ senf::MACAddress senf::MIHFId_TLVParser::asMACAddress()
const const
{ {
...@@ -91,47 +90,45 @@ prefix_ void senf::MIHFId_TLVParser::setINet6Address(senf::INet6Address const &a ...@@ -91,47 +90,45 @@ prefix_ void senf::MIHFId_TLVParser::setINet6Address(senf::INet6Address const &a
std::copy( addr.begin(), addr.end(), getNAIEncodedOutputIterator(si)); std::copy( addr.begin(), addr.end(), getNAIEncodedOutputIterator(si));
} }
prefix_ void senf::MIHPacketType::dump(packet p, std::ostream &os) prefix_ void senf::MIHPacketType::dump(packet p, std::ostream &os)
{ {
boost::io::ios_all_saver ias(os); boost::io::ios_all_saver ias(os);
os << "MIH Packet:\n" os << "MIH Packet:\n"
<< " protocol header:\n" << " protocol header:\n"
<< " Version: " << unsigned( p->version()) << "\n" << " Version: " << unsigned( p->version()) << "\n"
<< " Ack-Request: " << p->ackRequest() << "\n" << " Ack-Request: " << p->ackRequest() << "\n"
<< " Ack-Response: " << p->ackResponse() << "\n" << " Ack-Response: " << p->ackResponse() << "\n"
<< " UIR: " << p->uir() << "\n" << " UIR: " << p->uir() << "\n"
<< " more fragment: " << p->moreFragment() << "\n" << " more fragment: " << p->moreFragment() << "\n"
<< " fragment number: " << p->fragmentNr() << "\n" << " fragment number: " << p->fragmentNr() << "\n"
<< " message ID (MID): " << unsigned( p->messageId()) << "\n" << " message ID (MID): " << unsigned( p->messageId()) << "\n"
<< " SID: " << unsigned( p->sid()) << "\n" << " SID: " << unsigned( p->sid()) << "\n"
<< " Opcode: " << unsigned( p->opcode()) << "\n" << " Opcode: " << unsigned( p->opcode()) << "\n"
<< " AID: " << unsigned( p->aid()) << "\n" << " AID: " << unsigned( p->aid()) << "\n"
<< " Transaction ID: " << unsigned( p->transactionId()) << "\n" << " Transaction ID: " << unsigned( p->transactionId()) << "\n"
<< " payload length: " << unsigned( p->payloadLength()) << "\n" << " payload length: " << unsigned( p->payloadLength()) << "\n"
<< " source MIHF_Id TLV:\n" << " source MIHF_Id TLV:\n"
<< " type: " << unsigned (p->src_mihfId().type()) << "\n" << " type: " << unsigned (p->src_mihfId().type()) << "\n"
<< " length: " << unsigned (p->src_mihfId().length()) << "\n" << " length: " << unsigned (p->src_mihfId().length()) << "\n"
<< " value:\n"; << " value:\n";
std::string src_mihfId (p->src_mihfId().asString()); std::string src_mihfId (p->src_mihfId().asString());
hexdump(src_mihfId.begin(), src_mihfId.end(), os); hexdump(src_mihfId.begin(), src_mihfId.end(), os);
os << " destination MIHF_Id TLV:\n" os << " destination MIHF_Id TLV:\n"
<< " type: " << unsigned (p->dst_mihfId().type()) << "\n" << " type: " << unsigned (p->dst_mihfId().type()) << "\n"
<< " length: " << unsigned (p->dst_mihfId().length()) << "\n" << " length: " << unsigned (p->dst_mihfId().length()) << "\n"
<< " value:\n"; << " value:\n";
std::string dst_mihfId (p->dst_mihfId().asString()); std::string dst_mihfId (p->dst_mihfId().asString());
hexdump(dst_mihfId.begin(), dst_mihfId.end(), os); hexdump(dst_mihfId.begin(), dst_mihfId.end(), os);
} }
prefix_ void senf::MIHPacketType::finalize(packet p) prefix_ void senf::MIHPacketType::finalize(packet p)
{ {
p->src_mihfId().shrinkLength(); p->src_mihfId().shrinkLength();
p->dst_mihfId().shrinkLength(); p->dst_mihfId().shrinkLength();
p->payloadLength_() << p.size() - 8; p->payloadLength_() << p.size() - 8;
p->messageId() << key(p.next(nothrow));
} }
prefix_ senf::PacketInterpreterBase::factory_t senf::MIHPacketType::nextPacketType(packet p) prefix_ senf::PacketInterpreterBase::factory_t senf::MIHPacketType::nextPacketType(packet p)
{ {
if (p.data().size() < initSize()) if (p.data().size() < initSize())
...@@ -140,7 +137,6 @@ prefix_ senf::PacketInterpreterBase::factory_t senf::MIHPacketType::nextPacketTy ...@@ -140,7 +137,6 @@ prefix_ senf::PacketInterpreterBase::factory_t senf::MIHPacketType::nextPacketTy
return e ? e->factory() : MIHPayloadPacket::factory(); return e ? e->factory() : MIHPayloadPacket::factory();
} }
prefix_ void senf::MIHPayloadPacketType::dump(packet p, std::ostream &os) prefix_ void senf::MIHPayloadPacketType::dump(packet p, std::ostream &os)
{ {
boost::io::ios_all_saver ias(os); boost::io::ios_all_saver ias(os);
...@@ -148,7 +144,6 @@ prefix_ void senf::MIHPayloadPacketType::dump(packet p, std::ostream &os) ...@@ -148,7 +144,6 @@ prefix_ void senf::MIHPayloadPacketType::dump(packet p, std::ostream &os)
<< " ToDo!\n"; << " ToDo!\n";
} }
#undef prefix_ #undef prefix_
......
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