summaryrefslogtreecommitdiff
path: root/dev/etherpkt.hh
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-11-13 16:46:56 -0500
committerNathan Binkert <binkertn@umich.edu>2004-11-13 16:46:56 -0500
commit8922d699532cf5027c8cabe53aaf8be4db470764 (patch)
treefac37c5c456d6507f483de7566d965072dbf19c7 /dev/etherpkt.hh
parentacb98fb0f64a3b6a4f2f3151b0d4fb14fdfcf7cf (diff)
downloadgem5-8922d699532cf5027c8cabe53aaf8be4db470764.tar.xz
change the serialization of a packet so that we don't
do a nameOut. This fixes a subtle bug in serialization that can pop up. --HG-- extra : convert_revision : b52df977dcbef1c9bd0d4405ba0b36dff3737cdf
Diffstat (limited to 'dev/etherpkt.hh')
-rw-r--r--dev/etherpkt.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/dev/etherpkt.hh b/dev/etherpkt.hh
index 1b6e9858f..7a7809f0a 100644
--- a/dev/etherpkt.hh
+++ b/dev/etherpkt.hh
@@ -52,13 +52,15 @@ class PacketData : public RefCounted
public:
PacketData() : data(NULL), length(0) { }
+ explicit PacketData(size_t size) : data(new uint8_t[size]), length(0) { }
PacketData(std::auto_ptr<uint8_t> d, int l)
: data(d.release()), length(l) { }
~PacketData() { if (data) delete [] data; }
public:
- void serialize(std::ostream &os);
- void unserialize(Checkpoint *cp, const std::string &section);
+ void serialize(const std::string &base, std::ostream &os);
+ void unserialize(const std::string &base, Checkpoint *cp,
+ const std::string &section);
};
typedef RefCountingPtr<PacketData> PacketPtr;