/*
- * Copyright (c) 2002-2004 The Regents of The University of Michigan
+ * Copyright (c) 2002-2005 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include "base/output.hh"
#include "dev/etherdump.hh"
#include "sim/builder.hh"
-#include "sim/universe.hh"
+#include "sim/root.hh"
using std::string;
EtherDump::init()
{
curtime = time(NULL);
- s_freq = ticksPerSecond;
- us_freq = ticksPerSecond / ULL(1000000);
-
struct pcap_file_header hdr;
hdr.magic = TCPDUMP_MAGIC;
hdr.version_major = PCAP_VERSION_MAJOR;
EtherDump::dumpPacket(PacketPtr &packet)
{
pcap_pkthdr pkthdr;
- pkthdr.seconds = curtime + (curTick / s_freq);
- pkthdr.microseconds = (curTick / us_freq) % ULL(1000000);
+ pkthdr.seconds = curtime + (curTick / Clock::Int::s);
+ pkthdr.microseconds = (curTick / Clock::Int::us) % ULL(1000000);
pkthdr.caplen = std::min(packet->length, maxlen);
pkthdr.len = packet->length;
stream.write(reinterpret_cast<char *>(&pkthdr), sizeof(pkthdr));
BEGIN_INIT_SIM_OBJECT_PARAMS(EtherDump)
- INIT_PARAM_DFLT(file, "file to dump packets to", "etherdump"),
- INIT_PARAM_DFLT(maxlen, "max portion of packet data to dump", 96)
+ INIT_PARAM(file, "file to dump packets to"),
+ INIT_PARAM(maxlen, "max portion of packet data to dump")
END_INIT_SIM_OBJECT_PARAMS(EtherDump)