Merge with head.
[gem5.git] / src / dev / etherdump.cc
index 04463f3ee4c85d06c7a42665e7118ee9238f8ce6..4710935212d6464875035e3900cec2d1ed7c0d5e 100644 (file)
 #include "base/misc.hh"
 #include "base/output.hh"
 #include "dev/etherdump.hh"
-#include "sim/builder.hh"
 #include "sim/core.hh"
 
 using std::string;
 
-EtherDump::EtherDump(const string &name, const string &file, int max)
-    : SimObject(name), stream(file.c_str()), maxlen(max)
+EtherDump::EtherDump(const Params *p)
+    : SimObject(p), stream(simout.resolve(p->file).c_str()),
+      maxlen(p->maxlen)
 {
 }
 
@@ -116,23 +116,8 @@ EtherDump::dumpPacket(EthPacketPtr &packet)
     stream.flush();
 }
 
-BEGIN_DECLARE_SIM_OBJECT_PARAMS(EtherDump)
-
-    Param<string> file;
-    Param<int> maxlen;
-
-END_DECLARE_SIM_OBJECT_PARAMS(EtherDump)
-
-BEGIN_INIT_SIM_OBJECT_PARAMS(EtherDump)
-
-    INIT_PARAM(file, "file to dump packets to"),
-    INIT_PARAM(maxlen, "max portion of packet data to dump")
-
-END_INIT_SIM_OBJECT_PARAMS(EtherDump)
-
-CREATE_SIM_OBJECT(EtherDump)
+EtherDump *
+EtherDumpParams::create()
 {
-    return new EtherDump(getInstanceName(), simout.resolve(file), maxlen);
+    return new EtherDump(this);
 }
-
-REGISTER_SIM_OBJECT("EtherDump", EtherDump)