31 #ifndef __DEV_NET_PKTFIFO_HH__
32 #define __DEV_NET_PKTFIFO_HH__
125 assert(_reserved <= ptr->
length);
129 _size += ptr->length;
134 fifo.push_back(entry);
145 _size -= entry->packet->length;
146 _size -= entry->slack;
147 entry->packet = NULL;
162 if (
i !=
fifo.begin()) {
165 assert(prev !=
fifo.end());
166 prev->slack +=
i->packet->length;
167 prev->slack +=
i->slack;
169 _size -=
i->packet->length;
183 return i->number -
fifo.begin()->number;
191 return (--
end)->number - i->number;
198 total +=
i->packet->length +
i->slack;
201 panic(
"total (%d) is not == to size (%d)\n", total,
_size);
212 #endif // __DEV_NET_PKTFIFO_HH__
void unserialize(const std::string &base, CheckpointIn &cp)
void unserialize(const std::string &base, CheckpointIn &cp)
int countPacketsBefore(const_iterator i) const
void serialize(const std::string &base, CheckpointOut &cp) const
Serialization stuff.
fifo_list::const_iterator const_iterator
const_iterator begin() const
std::list< PacketFifoEntry > fifo
std::list< PacketFifoEntry > fifo_list
std::shared_ptr< EthPacketData > EthPacketPtr
unsigned reserve(unsigned len=0)
PacketFifoEntry(const PacketFifoEntry &s)
unsigned reserved() const
void serialize(const std::string &base, CheckpointOut &cp) const
PacketFifoEntry(EthPacketPtr p, uint64_t n)
const FlagsType total
Print the total.
std::ostream CheckpointOut
fifo_list::iterator iterator
int countPacketsAfter(const_iterator i) const
bool copyout(void *dest, unsigned offset, unsigned len)
bool push(EthPacketPtr ptr)
if(it_gpu==gpuTypeMap.end())
const_iterator end() const