fixes #197 removes wireless_link_all and updates example

This commit is contained in:
bharnden 2018-10-09 12:46:27 -07:00
parent 549d6bd84c
commit b839482198
4 changed files with 5 additions and 29 deletions

View file

@ -772,18 +772,6 @@ class EmuSession(Session):
self.emane.set_model(emane_network, model, config)
return emane_network
def wireless_link_all(self, network, nodes):
"""
Link all nodes to the provided wireless network.
:param network: wireless network to link nodes to
:param nodes: nodes to link to wireless network
:return: nothing
"""
for node in nodes:
for common_network, interface_one, interface_two in node.commonnets(network):
common_network.link(interface_one, interface_two)
class CoreEmu(object):
"""

View file

@ -9,7 +9,7 @@ import datetime
import parser
from core.emulator.coreemu import CoreEmu
from core.emulator.emudata import IpPrefixes
from core.emulator.emudata import IpPrefixes, NodeOptions
from core.enumerations import NodeTypes, EventTypes
from core.mobility import BasicRangeModel
@ -29,16 +29,13 @@ def example(options):
wlan = session.add_node(_type=NodeTypes.WIRELESS_LAN)
session.mobility.set_model(wlan, BasicRangeModel)
# create nodes
wireless_nodes = []
# create nodes, must set a position for wlan basic range model
node_options = NodeOptions()
node_options.set_position(0, 0)
for _ in xrange(options.nodes):
node = session.add_node()
node = session.add_node(node_options=node_options)
interface = prefixes.create_interface(node)
session.add_link(node.objid, wlan.objid, interface_one=interface)
wireless_nodes.append(node)
# link all created nodes with the wireless network
session.wireless_link_all(wlan, wireless_nodes)
# instantiate session
session.instantiate()

View file

@ -201,9 +201,6 @@ class TestCore:
interface = ip_prefixes.create_interface(node)
session.add_link(node.objid, wlan_node.objid, interface_one=interface)
# link nodes in wlan
session.wireless_link_all(wlan_node, [node_one, node_two])
# instantiate session
session.instantiate()
@ -234,9 +231,6 @@ class TestCore:
interface = ip_prefixes.create_interface(node)
session.add_link(node.objid, wlan_node.objid, interface_one=interface)
# link nodes in wlan
session.wireless_link_all(wlan_node, [node_one, node_two])
# configure mobility script for session
config = {
"file": _MOBILITY_FILE,

View file

@ -195,9 +195,6 @@ class TestXml:
interface = ip_prefixes.create_interface(node)
session.add_link(node.objid, wlan_node.objid, interface_one=interface)
# link nodes in wlan
session.wireless_link_all(wlan_node, [node_one, node_two])
# instantiate session
session.instantiate()