removed node map file and utilities, added formal class methods to session objects and added checks for specific classes where needed
This commit is contained in:
parent
8c348b5ab1
commit
b14012e5e9
24 changed files with 161 additions and 264 deletions
|
@ -1,5 +1,4 @@
|
|||
from core.emulator.enumerations import NodeTypes
|
||||
from core.nodes import nodeutils
|
||||
from core.emane.nodes import EmaneNode
|
||||
from core.services.coreservices import CoreService
|
||||
from core.xml import emanexml
|
||||
|
||||
|
@ -22,7 +21,7 @@ class EmaneTransportService(CoreService):
|
|||
transport_commands = []
|
||||
for interface in node.netifs(sort=True):
|
||||
network_node = node.session.get_node(interface.net.id)
|
||||
if nodeutils.is_node(network_node, NodeTypes.EMANE):
|
||||
if isinstance(network_node, EmaneNode):
|
||||
config = node.session.emane.get_configs(
|
||||
network_node.id, network_node.model.name
|
||||
)
|
||||
|
|
|
@ -4,8 +4,10 @@ Assumes installation of FRR via https://deb.frrouting.org/
|
|||
"""
|
||||
|
||||
from core import constants
|
||||
from core.emulator.enumerations import LinkTypes, NodeTypes
|
||||
from core.nodes import ipaddress, nodeutils
|
||||
from core.emulator.enumerations import LinkTypes
|
||||
from core.nodes import ipaddress
|
||||
from core.nodes.network import PtpNet
|
||||
from core.nodes.physical import Rj45Node
|
||||
from core.services.coreservices import CoreService
|
||||
|
||||
|
||||
|
@ -341,7 +343,7 @@ class FrrService(CoreService):
|
|||
for peerifc in ifc.net.netifs():
|
||||
if peerifc == ifc:
|
||||
continue
|
||||
if nodeutils.is_node(peerifc, NodeTypes.RJ45):
|
||||
if isinstance(peerifc, Rj45Node):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@ -395,7 +397,7 @@ class FRROspfv2(FrrService):
|
|||
Helper to detect whether interface is connected to a notional
|
||||
point-to-point link.
|
||||
"""
|
||||
if nodeutils.is_node(ifc.net, NodeTypes.PEER_TO_PEER):
|
||||
if isinstance(ifc.net, PtpNet):
|
||||
return " ip ospf network point-to-point\n"
|
||||
return ""
|
||||
|
||||
|
@ -481,7 +483,7 @@ class FRROspfv3(FrrService):
|
|||
Helper to detect whether interface is connected to a notional
|
||||
point-to-point link.
|
||||
"""
|
||||
if nodeutils.is_node(ifc.net, NodeTypes.PEER_TO_PEER):
|
||||
if isinstance(ifc.net, PtpNet):
|
||||
return " ipv6 ospf6 network point-to-point\n"
|
||||
return ""
|
||||
|
||||
|
|
|
@ -3,8 +3,11 @@ quagga.py: defines routing services provided by Quagga.
|
|||
"""
|
||||
|
||||
from core import constants
|
||||
from core.emulator.enumerations import LinkTypes, NodeTypes
|
||||
from core.nodes import ipaddress, nodeutils
|
||||
from core.emane.nodes import EmaneNode
|
||||
from core.emulator.enumerations import LinkTypes
|
||||
from core.nodes import ipaddress
|
||||
from core.nodes.network import PtpNet, WlanNode
|
||||
from core.nodes.physical import Rj45Node
|
||||
from core.services.coreservices import CoreService
|
||||
|
||||
|
||||
|
@ -267,7 +270,7 @@ class QuaggaService(CoreService):
|
|||
for peerifc in ifc.net.netifs():
|
||||
if peerifc == ifc:
|
||||
continue
|
||||
if nodeutils.is_node(peerifc, NodeTypes.RJ45):
|
||||
if isinstance(peerifc, Rj45Node):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@ -321,7 +324,7 @@ class Ospfv2(QuaggaService):
|
|||
Helper to detect whether interface is connected to a notional
|
||||
point-to-point link.
|
||||
"""
|
||||
if nodeutils.is_node(ifc.net, NodeTypes.PEER_TO_PEER):
|
||||
if isinstance(ifc.net, PtpNet):
|
||||
return " ip ospf network point-to-point\n"
|
||||
return ""
|
||||
|
||||
|
@ -407,7 +410,7 @@ class Ospfv3(QuaggaService):
|
|||
Helper to detect whether interface is connected to a notional
|
||||
point-to-point link.
|
||||
"""
|
||||
if nodeutils.is_node(ifc.net, NodeTypes.PEER_TO_PEER):
|
||||
if isinstance(ifc.net, PtpNet):
|
||||
return " ipv6 ospf6 network point-to-point\n"
|
||||
return ""
|
||||
|
||||
|
@ -457,9 +460,7 @@ class Ospfv3mdr(Ospfv3):
|
|||
cfg = cls.mtucheck(ifc)
|
||||
# Uncomment the following line to use Address Family Translation for IPv4
|
||||
cfg += " ipv6 ospf6 instance-id 65\n"
|
||||
if ifc.net is not None and nodeutils.is_node(
|
||||
ifc.net, (NodeTypes.WIRELESS_LAN, NodeTypes.EMANE)
|
||||
):
|
||||
if ifc.net is not None and isinstance(ifc.net, (WlanNode, EmaneNode)):
|
||||
return (
|
||||
cfg
|
||||
+ """\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue