/*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2002-2004 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
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;
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__