summaryrefslogtreecommitdiff
path: root/src/dev/net/etherpkt.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev/net/etherpkt.hh')
-rw-r--r--src/dev/net/etherpkt.hh24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/dev/net/etherpkt.hh b/src/dev/net/etherpkt.hh
index 457563293..f84c03a4c 100644
--- a/src/dev/net/etherpkt.hh
+++ b/src/dev/net/etherpkt.hh
@@ -49,33 +49,37 @@
class EthPacketData
{
public:
- /*
+ /**
* Pointer to packet data will be deleted
*/
uint8_t *data;
- /*
- * Length of the current packet
+ /**
+ * Amount of space occupied by the payload in the data buffer
*/
unsigned length;
- public:
+ /**
+ * Effective length, used for modeling timing in the simulator.
+ * This could be different from length if the packets are assumed
+ * to use a tightly packed or compressed format, but it's not worth
+ * the performance/complexity hit to perform that packing or compression
+ * in the simulation.
+ */
+ unsigned simLength;
+
EthPacketData()
- : data(NULL), length(0)
+ : data(nullptr), length(0), simLength(0)
{ }
explicit EthPacketData(unsigned size)
- : data(new uint8_t[size]), length(0)
+ : data(new uint8_t[size]), length(0), simLength(0)
{ }
~EthPacketData() { if (data) delete [] data; }
- public:
-
void serialize(const std::string &base, CheckpointOut &cp) const;
void unserialize(const std::string &base, CheckpointIn &cp);
-
- unsigned size() const { return length; }
};
typedef std::shared_ptr<EthPacketData> EthPacketPtr;