update to move mac learning disable into wlan and hub node startup
This commit is contained in:
parent
440c8ed565
commit
711104df64
1 changed files with 14 additions and 19 deletions
|
@ -1001,23 +1001,14 @@ class HubNode(CoreNetwork):
|
||||||
policy = "ACCEPT"
|
policy = "ACCEPT"
|
||||||
type = "hub"
|
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
|
:return: nothing
|
||||||
: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
|
|
||||||
"""
|
"""
|
||||||
super().__init__(session, _id, name, start, server)
|
super().startup()
|
||||||
|
self.net_client.disable_mac_learning(self.brname)
|
||||||
# TODO: move to startup method
|
|
||||||
if start:
|
|
||||||
self.net_client.disable_mac_learning(self.brname)
|
|
||||||
|
|
||||||
|
|
||||||
class WlanNode(CoreNetwork):
|
class WlanNode(CoreNetwork):
|
||||||
|
@ -1045,14 +1036,18 @@ class WlanNode(CoreNetwork):
|
||||||
:param policy: wlan policy
|
:param policy: wlan policy
|
||||||
"""
|
"""
|
||||||
super().__init__(session, _id, name, start, server, policy)
|
super().__init__(session, _id, name, start, server, policy)
|
||||||
# wireless model such as basic range
|
# wireless and mobility models (BasicRangeModel, Ns2WaypointMobility)
|
||||||
self.model = None
|
self.model = None
|
||||||
# mobility model such as scripted
|
|
||||||
self.mobility = None
|
self.mobility = None
|
||||||
|
|
||||||
# TODO: move to startup method
|
def startup(self):
|
||||||
if start:
|
"""
|
||||||
self.net_client.disable_mac_learning(self.brname)
|
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):
|
def attach(self, netif):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue