From c58537ca206f2fb3829050a4a0e342edef0bd64b Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 3 Jun 2017 07:23:05 -0700 Subject: 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 Maintainer: Nathan Binkert --- src/dev/net/Ethernet.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/dev/net/Ethernet.py') 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" -- cgit v1.2.3