26 : nextFragmentNr_(1), packetsUnfragmented_(0), packetsReassembled_(0), fragmentsInvalid_(0), fragmentsProcessed_(0)
32 return reassembledPacket_;
38 std::uint8_t fragmentNr (fragment->fragmentNr());
45 fragmentsProcessed_++;
47 if (fragmentNr == 1) {
50 reassembledPacket_ = eth.clone();
55 }
else if (vlanCPresent) {
59 reassembledPacket_->type_length() << fragment->type_length();
61 payloadIter_ = (senf::DataPacket::createAfter(p, fragment->size(),
senf::noinit)).data().begin();
63 payloadIter_ = std::copy(
67 nextFragmentNr_ = fragmentNr + 1;
69 if (! fragment->moreFragment()) {
71 reassembledPacket_.reparse();
72 packetsReassembled_++;
81 unsigned tmp (fragmentsProcessed_);
82 fragmentsProcessed_ = 0;
88 unsigned tmp (fragmentsInvalid_);
89 fragmentsInvalid_ = 0;
95 unsigned tmp (packetsReassembled_);
96 packetsReassembled_ = 0;
102 unsigned tmp (packetsUnfragmented_);
103 packetsUnfragmented_ = 0;
113 route( input, output).autoThrottling(
false);
114 input.onRequest( &EthernetReassemblerModule::onRequest);
118 prefix_ void senf::emu::EthernetReassemblerModule::onRequest()
127 auto const & extOUI (VLanId::payload<EthOUIExtensionPacket>(eth));
bool processFrame(senf::EthernetPacket const ð, EthernetFragmentPacket const &fragment)
ConcretePacket< EthVLanSPacketType > EthVLanSPacket
static const EtherTypes::key_t etherType
EthernetReassemblerModule()
PacketData & data() const
static const EtherTypes::key_t etherType
static std::uint16_t payloadTypeLength(senf::EthernetPacket const ð)
senf::EthernetPacket & reassembledPacket()
senf::detail::packet::size_type size_type
static const EtherTypes::key_t etherType
unsigned packetsUnfragmented()
ConcretePacket< EthVLanCPacketType > EthVLanCPacket
unsigned fragmentsInvalid()
unsigned packetsReassembled()
unsigned fragmentsProcessed()
ConcretePacket< EthernetPacketType > EthernetPacket
EthernetReassemblerBase()