Change the protocol stack processing to pass packets by non-const
reference, rather than const reference and value as was previously done. Also change the queue semantics to return the packet on a deque, rather than requiring a packet as a parameter. The problem with the original approach was that packet UID's were getting skipped. The fix handles the uid properly, and we get sequential packet uid's on the trace file.
This commit is contained in:
1 parent
08bcb4249d
commit
391b3eef11
31 files changed
+152
-179
No files matched your search
+8
-6
@@ -83,14 +83,16 @@ public:
|
||||
bool Enqueue (const Packet& p);
|
||||
/**
|
||||
* Remove a packet from the front of the Queue
|
||||
* \return True if the operation was successful; false otherwise
|
||||
* Must not be called on an empty queue.
|
||||
* \return The packet removed from the queue
|
||||
*/
|
||||
bool Dequeue (Packet &p);
|
||||
Packet Dequeue ();
|
||||
/**
|
||||
* Get a copy of the item at the front of the queue without removing it
|
||||
* \return True if the operation was successful; false otherwise
|
||||
* Must NOT be called on an empty queue
|
||||
* \return The packet at the head of the queue.
|
||||
*/
|
||||
bool Peek (Packet &p);
|
||||
Packet Peek ();
|
||||
|
||||
/**
|
||||
* XXX Doesn't do anything right now, think its supposed to flush the queue
|
||||
@@ -163,8 +165,8 @@ public:
|
||||
private:
|
||||
|
||||
virtual bool DoEnqueue (const Packet& p) = 0;
|
||||
virtual bool DoDequeue (Packet &p) = 0;
|
||||
virtual bool DoPeek (Packet &p) = 0;
|
||||
virtual Packet DoDequeue () = 0;
|
||||
virtual Packet DoPeek () = 0;
|
||||
|
||||
protected:
|
||||
// called by subclasses to notify parent of packet drops.
|
||||
|
||||
Reference in new issue
Block a user