29#ifndef __DEV_NET_PKTFIFO_HH__
30#define __DEV_NET_PKTFIFO_HH__
128 assert(_reserved <= ptr->length);
132 _size += ptr->length;
137 fifo.push_back(entry);
149 _size -= entry->packet->length;
150 _size -= entry->slack;
151 entry->packet = NULL;
168 if (
i !=
fifo.begin()) {
171 assert(prev !=
fifo.end());
172 prev->slack +=
i->packet->length;
173 prev->slack +=
i->slack;
175 _size -=
i->packet->length;
190 return i->number -
fifo.begin()->number;
199 return (--
end)->number -
i->number;
207 total +=
i->packet->length +
i->slack;
void serialize(const std::string &base, CheckpointOut &cp) const
Serialization stuff.
unsigned reserve(unsigned len=0)
std::list< PacketFifoEntry > fifo
const_iterator end() const
void unserialize(const std::string &base, CheckpointIn &cp)
unsigned reserved() const
bool push(EthPacketPtr ptr)
int countPacketsBefore(const_iterator i) const
int countPacketsAfter(const_iterator i) const
fifo_list::iterator iterator
const_iterator begin() const
std::list< PacketFifoEntry > fifo_list
bool copyout(void *dest, unsigned offset, unsigned len)
fifo_list::const_iterator const_iterator
#define panic(...)
This implements a cprintf based panic() function.
const FlagsType total
Print the total.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::ostream CheckpointOut
std::shared_ptr< EthPacketData > EthPacketPtr
void serialize(const std::string &base, CheckpointOut &cp) const
PacketFifoEntry(EthPacketPtr p, uint64_t n)
void unserialize(const std::string &base, CheckpointIn &cp)
PacketFifoEntry(const PacketFifoEntry &s)