From df02047d5a362296bde9d07dba6dba59516fa328 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Fri, 2 Nov 2012 11:32:01 -0500 Subject: dev: Fix ethernet device inheritance structure The Python wrappers and the C++ should have the same object structure. If this is not the case, bad things will happen when the SWIG wrappers cast between an object and any of its base classes. This was not the case for NSGigE and Sinic devices. This patch makes NSGigE and Sinic inherit from the new EtherDevBase class, which in turn inherits from EtherDevice. As a bonus, this removes some duplicated statistics from the Sinic device. --- src/dev/Ethernet.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/dev/Ethernet.py') diff --git a/src/dev/Ethernet.py b/src/dev/Ethernet.py index 57d867fbe..a8b5555d9 100644 --- a/src/dev/Ethernet.py +++ b/src/dev/Ethernet.py @@ -132,6 +132,8 @@ class IGbE_igb(IGbE): class EtherDevBase(EtherDevice): type = 'EtherDevBase' abstract = True + cxx_header = "dev/etherdevice.hh" + hardware_address = Param.EthernetAddr(NextEthernetAddr, "Ethernet Hardware Address") -- cgit v1.2.3