summaryrefslogtreecommitdiff
path: root/src/dev/net/Ethernet.py
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2017-06-03 07:23:05 -0700
committerGabe Black <gabeblack@google.com>2017-06-03 15:24:02 +0000
commitc58537ca206f2fb3829050a4a0e342edef0bd64b (patch)
treeb0813e58558ed89290b11cf9aa4561f19e0ffddc /src/dev/net/Ethernet.py
parent2ce045341b73166cad2ef95b37c87d8d4c590d80 (diff)
downloadgem5-c58537ca206f2fb3829050a4a0e342edef0bd64b.tar.xz
dev: Add a version of EtherTap which uses the tap driver.
The object is called EtherTap (as opposed to EtherTapStub, what the former EtherTap was renamed to), and its existance is gated on the linux/if_tun.h header file existing. That's probably overly strict, but it will hopefully be minimally likely to break the build for other systems. Change-Id: Ie03507fadf0d843a4d4d52f283c44a416c6f2a74 Reviewed-on: https://gem5-review.googlesource.com/3646 Reviewed-by: Nathan Binkert <nate@binkert.org> Maintainer: Nathan Binkert <nate@binkert.org>
Diffstat (limited to 'src/dev/net/Ethernet.py')
-rw-r--r--src/dev/net/Ethernet.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dev/net/Ethernet.py b/src/dev/net/Ethernet.py
index 68867c00f..71665c564 100644
--- a/src/dev/net/Ethernet.py
+++ b/src/dev/net/Ethernet.py
@@ -38,6 +38,7 @@
#
# Authors: Nathan Binkert
+from m5.defines import buildEnv
from m5.SimObject import SimObject
from m5.params import *
from m5.proxy import *
@@ -103,6 +104,14 @@ class EtherTapBase(EtherObject):
dump = Param.EtherDump(NULL, "dump object")
tap = SlavePort("Ethernet interface to connect to gem5's network")
+if buildEnv['USE_TUNTAP']:
+ class EtherTap(EtherTapBase):
+ type = 'EtherTap'
+ cxx_header = "dev/net/ethertap.hh"
+ tun_clone_device = Param.String('/dev/net/tun',
+ "Path to the tun clone device node")
+ tap_device_name = Param.String('gem5-tap', "Tap device name")
+
class EtherTapStub(EtherTapBase):
type = 'EtherTapStub'
cxx_header = "dev/net/ethertap.hh"