always initalize the size of a packet (forgotten on checkpoints
[gem5.git] / dev / etherdump.hh
index 62364359e22f70e65cdc39ac051182426f48d7c3..b127d05e2f4a31273b084551641118e17452a2ea 100644 (file)
@@ -43,7 +43,7 @@
 class EtherDump : public SimObject
 {
   private:
-    std::ofstream stream;
+    std::ostream *stream;
     const int maxlen;
     void dumpPacket(PacketPtr &packet);
     void init();
@@ -53,9 +53,9 @@ class EtherDump : public SimObject
     Tick us_freq;
 
   public:
-    EtherDump(const std::string &name, const std::string &file, int max);
+    EtherDump(const std::string &name, std::ostream *_stream, int max);
 
-    inline void dump(PacketPtr &pkt) { if (stream.is_open()) dumpPacket(pkt); }
+    inline void dump(PacketPtr &pkt) { dumpPacket(pkt); }
 };
 
 #endif // __ETHERDUMP_H__