//#include "EthernetPacket.ih"
// Custom includes
+#include "LlcSnapPacket.hh"
#include <iomanip>
#include <boost/io/ios_state.hpp>
return e ? e->factory() : no_factory();
}
if (p->type_length() <= 1500)
- return EthLlcSnapPacket::factory();
+ return LlcSnapPacket::factory();
return no_factory();
}
if (k)
p->type_length() << k;
else
- if (p.next().is<EthLlcSnapPacket>())
+ if (p.next().is<LlcSnapPacket>())
p->type_length() << p.next().data().size();
- else
- p->type_length() << 0;
+ // Do NOT reset type_length if the type is not known ... doing this will destroy read packets
}
prefix_ void senf::EthVLanPacketType::dump(packet p, std::ostream & os)
p->type() << key(p.next());
}
-prefix_ void senf::EthLlcSnapPacketType::dump(packet p, std::ostream & os)
-{
- boost::io::ios_all_saver ias(os);
- os << "Ethernet LLC/SNAP"
- << " LLC\n"
- << " DSAP: " << p->dsap() << "\n"
- << " SSAP: " << p->ssap() << "\n"
- << " SNAP\n"
- << " ProtocolId: " << p->protocolId() << "\n"
- << " type : 0x"
- << std::hex << std::setw(4) << std::setfill('0') << p->type() << "\n";
-}
-
-prefix_ void senf::EthLlcSnapPacketType::finalize(packet p)
-{
- p->type() << key(p.next());
-}
-
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_