projects
/
gem5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
always initalize the size of a packet (forgotten on checkpoints
[gem5.git]
/
dev
/
etherdump.hh
diff --git
a/dev/etherdump.hh
b/dev/etherdump.hh
index 87824c470d213c3649494718e828c4dc01fd1f37..b127d05e2f4a31273b084551641118e17452a2ea 100644
(file)
--- a/
dev/etherdump.hh
+++ b/
dev/etherdump.hh
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 200
3
The Regents of The University of Michigan
+ * Copyright (c) 200
2-2004
The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@
-34,8
+34,8
@@
#define __ETHERDUMP_H__
#include <fstream>
#define __ETHERDUMP_H__
#include <fstream>
-#include "etherpkt.hh"
-#include "sim_object.hh"
+#include "
dev/
etherpkt.hh"
+#include "sim
/sim
_object.hh"
/*
* Simple object for creating a simple pcap style packet trace
/*
* Simple object for creating a simple pcap style packet trace
@@
-43,8
+43,9
@@
class EtherDump : public SimObject
{
private:
class EtherDump : public SimObject
{
private:
- std::ofstream stream;
- void dumpPacket(PacketPtr packet);
+ std::ostream *stream;
+ const int maxlen;
+ void dumpPacket(PacketPtr &packet);
void init();
Tick curtime;
void init();
Tick curtime;
@@
-52,9
+53,9
@@
class EtherDump : public SimObject
Tick us_freq;
public:
Tick us_freq;
public:
- EtherDump(const std::string &name,
const std::string &file
);
+ 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__
};
#endif // __ETHERDUMP_H__