summaryrefslogtreecommitdiff
path: root/src/dev/net/ethertap.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2017-06-03 00:45:09 -0700
committerGabe Black <gabeblack@google.com>2017-06-03 15:23:09 +0000
commitf9ad4066d71748829c11868b5b92ba092ee9513b (patch)
tree003f7c86ad5f15b20c8fba5f3edffeb930afb9c8 /src/dev/net/ethertap.hh
parent0010088c4392438f26f34b9dbab12634c7f650a4 (diff)
downloadgem5-f9ad4066d71748829c11868b5b92ba092ee9513b.tar.xz
dev: Rename EtherTap to be EtherTapStub.
The EtherTap object is going to be reworked so that it connects to a tap device directly, but it's worthwhile to still be able to use the m5tap utility (util/tap) to send/receive packets on systems which don't support tap but do support the pcap API. It can also be used to replay ethernet frames, to capture the ethernet frames coming from gem5 for analysis, to programmatically consume and/or generate the frames, or even to forward them to/from a remote system. Change-Id: Ic7bd763d86cd913ac373dd10a8d6d1fc6b35f95a Reviewed-on: https://gem5-review.googlesource.com/3644 Reviewed-by: Nathan Binkert <nate@binkert.org> Maintainer: Nathan Binkert <nate@binkert.org>
Diffstat (limited to 'src/dev/net/ethertap.hh')
-rw-r--r--src/dev/net/ethertap.hh25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/dev/net/ethertap.hh b/src/dev/net/ethertap.hh
index b27b80f84..b4af6979e 100644
--- a/src/dev/net/ethertap.hh
+++ b/src/dev/net/ethertap.hh
@@ -42,7 +42,7 @@
#include "dev/net/etherint.hh"
#include "dev/net/etherobject.hh"
#include "dev/net/etherpkt.hh"
-#include "params/EtherTap.hh"
+#include "params/EtherTapStub.hh"
#include "sim/eventq.hh"
#include "sim/sim_object.hh"
@@ -51,9 +51,12 @@ class TapListener;
class EtherTapInt;
/*
- * Interface to connect a simulated ethernet device to the real world
+ * Interface to connect a simulated ethernet device to the real world. An
+ * external helper program bridges between this object's TCP port and a
+ * source/sink for Ethernet frames. Each frame going in either direction is
+ * prepended with the frame's length in a 32 bit integer in network byte order.
*/
-class EtherTap : public EtherObject
+class EtherTapStub : public EtherObject
{
protected:
friend class TapEvent;
@@ -87,22 +90,22 @@ class EtherTap : public EtherObject
class TxEvent : public Event
{
protected:
- EtherTap *tap;
+ EtherTapStub *tap;
public:
- TxEvent(EtherTap *_tap) : tap(_tap) {}
+ TxEvent(EtherTapStub *_tap) : tap(_tap) {}
void process() { tap->retransmit(); }
virtual const char *description() const
- { return "EtherTap retransmit"; }
+ { return "EtherTapStub retransmit"; }
};
friend class TxEvent;
TxEvent txEvent;
public:
- typedef EtherTapParams Params;
- EtherTap(const Params *p);
- virtual ~EtherTap();
+ typedef EtherTapStubParams Params;
+ EtherTapStub(const Params *p);
+ virtual ~EtherTapStub();
const Params *
params() const
@@ -122,9 +125,9 @@ class EtherTap : public EtherObject
class EtherTapInt : public EtherInt
{
private:
- EtherTap *tap;
+ EtherTapStub *tap;
public:
- EtherTapInt(const std::string &name, EtherTap *t)
+ EtherTapInt(const std::string &name, EtherTapStub *t)
: EtherInt(name), tap(t)
{ }