21 #include <boost/io/ios_state.hpp> 36 boost::io::ios_all_saver ias(os);
38 <<
" protocol header:\n" 45 <<
senf::fieldName(
" message ID (MID)") << unsigned( p->messageId()) <<
"\n" 49 <<
senf::fieldName(
" transaction id") << unsigned( p->transactionId()) <<
"\n" 50 <<
senf::fieldName(
" payload length") << unsigned( p->payloadLength()) <<
"\n";
51 p->src_mihfId().dump( os);
52 p->dst_mihfId().dump( os);
57 p->src_mihfId().finalize();
58 p->dst_mihfId().finalize();
59 p->payloadLength_() << p.
size() - 8u;
77 if (p.
data().
size() < p->payloadLength() + 8u)
79 if (p->version() != 1)
93 boost::io::ios_all_saver ias(os);
94 os <<
"MIH Payload (service specific TLVs):\n";
95 typedef parser::tlvList_t::container_type tlvListContainer_t;
96 tlvListContainer_t tlvListContainer (p->tlvList());
103 typedef parser::tlvList_t::container_type tlvContainer_t;
104 tlvContainer_t tlvs (p->tlvList() );
static void dump(packet p, std::ostream &os)
Dump given MIH packet in readable form to given output stream.
static const EtherTypes::key_t etherType
static optional_key_t key(Packet const &p)
Find key of packet from registry.
SENF_PACKET_REGISTRY_REGISTER(senf::EtherTypes, senf::MIHPacketType::etherType, senf::MIHPacket)
static factory_t nextPacketType(packet p)
static void validate(packet p)
std::string fieldName(std::string const &s)
static void finalize(packet p)
void finalize()
shrink size of the TLV length field to minimum
MIH protocol public header.
PacketData & data() const
Access the packets raw data container.
raw_container::const_iterator const_iterator
static size_type initSize()
Get size of new (empty) packet.
Protocol specific packet handle.
static void finalize(packet p)
Packet next() const
Get next packet in chain.
raw_container::iterator iterator
SENF_PACKET_INSTANTIATE_TEMPLATE(senf::MIHPacket)
detail::PacketRegistryImpl< typename Tag::key_t >::Entry Entry
size_type size() const
Returns the number of bytes in the packet data.
static factory_t no_factory()
size_type size() const
Return size of packet in bytes.
static factory_t factory()
Return factory for packets of specific type.
static void dump(packet p, std::ostream &os)
Dump given MIHGenericPayload in readable form to given output stream.
Packet registration facility
Parser for a generic TLV packet.
Invalid packet data access.
Factory const * factory_t