update to move mac learning disable into wlan and hub node startup

This commit is contained in:
bharnden 2019-10-23 10:56:01 -07:00
parent 440c8ed565
commit 711104df64

View file

@ -1001,22 +1001,13 @@ class HubNode(CoreNetwork):
policy = "ACCEPT"
type = "hub"
def __init__(self, session, _id=None, name=None, start=True, server=None):
def startup(self):
"""
Creates a HubNode instance.
Startup for a hub node, that disables mac learning after normal startup.
:param core.session.Session session: core session instance
:param int _id: node id
:param str name: node namee
:param bool start: start flag
:param core.emulator.distributed.DistributedServer server: remote server node
will run on, default is None for localhost
:raises CoreCommandError: when there is a command exception
:return: nothing
"""
super().__init__(session, _id, name, start, server)
# TODO: move to startup method
if start:
super().startup()
self.net_client.disable_mac_learning(self.brname)
@ -1045,13 +1036,17 @@ class WlanNode(CoreNetwork):
:param policy: wlan policy
"""
super().__init__(session, _id, name, start, server, policy)
# wireless model such as basic range
# wireless and mobility models (BasicRangeModel, Ns2WaypointMobility)
self.model = None
# mobility model such as scripted
self.mobility = None
# TODO: move to startup method
if start:
def startup(self):
"""
Startup for a wlan node, that disables mac learning after normal startup.
:return: nothing
"""
super().startup()
self.net_client.disable_mac_learning(self.brname)
def attach(self, netif):