summaryrefslogtreecommitdiff
path: root/src/dev/net/ethertap.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev/net/ethertap.hh')
-rw-r--r--src/dev/net/ethertap.hh31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/dev/net/ethertap.hh b/src/dev/net/ethertap.hh
index 718af1808..96cc4710c 100644
--- a/src/dev/net/ethertap.hh
+++ b/src/dev/net/ethertap.hh
@@ -39,9 +39,16 @@
#include <string>
#include "base/pollevent.hh"
+#include "config/use_tuntap.hh"
#include "dev/net/etherint.hh"
#include "dev/net/etherobject.hh"
#include "dev/net/etherpkt.hh"
+
+#if USE_TUNTAP
+#include "params/EtherTap.hh"
+
+#endif
+
#include "params/EtherTapStub.hh"
#include "sim/eventq.hh"
#include "sim/sim_object.hh"
@@ -176,4 +183,28 @@ class EtherTapStub : public EtherTapBase
};
+#if USE_TUNTAP
+class EtherTap : public EtherTapBase
+{
+ public:
+ typedef EtherTapParams Params;
+ EtherTap(const Params *p);
+ ~EtherTap();
+
+ const Params *
+ params() const
+ {
+ return dynamic_cast<const Params *>(_params);
+ }
+
+
+ protected:
+ int tap;
+
+ void recvReal(int revent) override;
+ bool sendReal(const void *data, size_t len) override;
+};
+#endif
+
+
#endif // __DEV_NET_ETHERTAP_HH__