revert logging back to info, removed Rj45Models enum as it was not being used, updated linktypes enum to be used directly
This commit is contained in:
parent
1e8d1ecd9f
commit
f277e96c9a
13 changed files with 12 additions and 22 deletions
|
@ -80,7 +80,7 @@ def handle_link_event(event: LinkData) -> core_pb2.LinkEvent:
|
||||||
unidirectional=event.unidirectional,
|
unidirectional=event.unidirectional,
|
||||||
)
|
)
|
||||||
link = core_pb2.Link(
|
link = core_pb2.Link(
|
||||||
type=event.link_type,
|
type=event.link_type.value,
|
||||||
node_one_id=event.node1_id,
|
node_one_id=event.node1_id,
|
||||||
node_two_id=event.node2_id,
|
node_two_id=event.node2_id,
|
||||||
interface_one=interface_one,
|
interface_one=interface_one,
|
||||||
|
|
|
@ -325,7 +325,7 @@ def convert_link(session: Session, link_data: LinkData) -> core_pb2.Link:
|
||||||
)
|
)
|
||||||
|
|
||||||
return core_pb2.Link(
|
return core_pb2.Link(
|
||||||
type=link_data.link_type,
|
type=link_data.link_type.value,
|
||||||
node_one_id=link_data.node1_id,
|
node_one_id=link_data.node1_id,
|
||||||
node_two_id=link_data.node2_id,
|
node_two_id=link_data.node2_id,
|
||||||
interface_one=interface_one,
|
interface_one=interface_one,
|
||||||
|
|
|
@ -1501,7 +1501,7 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer):
|
||||||
flag = MessageFlags.DELETE.value
|
flag = MessageFlags.DELETE.value
|
||||||
link = LinkData(
|
link = LinkData(
|
||||||
message_type=flag,
|
message_type=flag,
|
||||||
link_type=LinkTypes.WIRELESS.value,
|
link_type=LinkTypes.WIRELESS,
|
||||||
node1_id=node_one.id,
|
node1_id=node_one.id,
|
||||||
node2_id=node_two.id,
|
node2_id=node_two.id,
|
||||||
network_id=emane_one.id,
|
network_id=emane_one.id,
|
||||||
|
|
|
@ -356,7 +356,7 @@ class CoreHandler(socketserver.BaseRequestHandler):
|
||||||
(LinkTlvs.BURST, link_data.burst),
|
(LinkTlvs.BURST, link_data.burst),
|
||||||
(LinkTlvs.SESSION, link_data.session),
|
(LinkTlvs.SESSION, link_data.session),
|
||||||
(LinkTlvs.MBURST, link_data.mburst),
|
(LinkTlvs.MBURST, link_data.mburst),
|
||||||
(LinkTlvs.TYPE, link_data.link_type),
|
(LinkTlvs.TYPE, link_data.link_type.value),
|
||||||
(LinkTlvs.GUI_ATTRIBUTES, link_data.gui_attributes),
|
(LinkTlvs.GUI_ATTRIBUTES, link_data.gui_attributes),
|
||||||
(LinkTlvs.UNIDIRECTIONAL, link_data.unidirectional),
|
(LinkTlvs.UNIDIRECTIONAL, link_data.unidirectional),
|
||||||
(LinkTlvs.EMULATION_ID, link_data.emulation_id),
|
(LinkTlvs.EMULATION_ID, link_data.emulation_id),
|
||||||
|
|
|
@ -34,7 +34,7 @@ class EmaneNet(CoreNetworkBase):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
apitype = NodeTypes.EMANE.value
|
apitype = NodeTypes.EMANE.value
|
||||||
linktype = LinkTypes.WIRED.value
|
linktype = LinkTypes.WIRED
|
||||||
type = "wlan"
|
type = "wlan"
|
||||||
is_emane = True
|
is_emane = True
|
||||||
|
|
||||||
|
|
|
@ -86,16 +86,6 @@ class NodeTypes(Enum):
|
||||||
LXC = 16
|
LXC = 16
|
||||||
|
|
||||||
|
|
||||||
class Rj45Models(Enum):
|
|
||||||
"""
|
|
||||||
RJ45 model types.
|
|
||||||
"""
|
|
||||||
|
|
||||||
LINKED = 0
|
|
||||||
WIRELESS = 1
|
|
||||||
INSTALLED = 2
|
|
||||||
|
|
||||||
|
|
||||||
# Link Message TLV Types
|
# Link Message TLV Types
|
||||||
class LinkTlvs(Enum):
|
class LinkTlvs(Enum):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -577,7 +577,7 @@ class Session:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# wireless link
|
# wireless link
|
||||||
if link_options.type == LinkTypes.WIRELESS.value:
|
if link_options.type == LinkTypes.WIRELESS:
|
||||||
raise CoreError("cannot update wireless link")
|
raise CoreError("cannot update wireless link")
|
||||||
else:
|
else:
|
||||||
if not node_one and not node_two:
|
if not node_one and not node_two:
|
||||||
|
|
|
@ -499,7 +499,7 @@ class BasicRangeModel(WirelessModel):
|
||||||
node1_id=interface1.node.id,
|
node1_id=interface1.node.id,
|
||||||
node2_id=interface2.node.id,
|
node2_id=interface2.node.id,
|
||||||
network_id=self.wlan.id,
|
network_id=self.wlan.id,
|
||||||
link_type=LinkTypes.WIRELESS.value,
|
link_type=LinkTypes.WIRELESS,
|
||||||
)
|
)
|
||||||
|
|
||||||
def sendlinkmsg(
|
def sendlinkmsg(
|
||||||
|
|
|
@ -982,7 +982,7 @@ class CoreNetworkBase(NodeBase):
|
||||||
Base class for networks
|
Base class for networks
|
||||||
"""
|
"""
|
||||||
|
|
||||||
linktype = LinkTypes.WIRED.value
|
linktype = LinkTypes.WIRED
|
||||||
is_emane = False
|
is_emane = False
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|
|
@ -1030,7 +1030,7 @@ class WlanNode(CoreNetwork):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
apitype = NodeTypes.WIRELESS_LAN.value
|
apitype = NodeTypes.WIRELESS_LAN.value
|
||||||
linktype = LinkTypes.WIRED.value
|
linktype = LinkTypes.WIRED
|
||||||
policy = "DROP"
|
policy = "DROP"
|
||||||
type = "wlan"
|
type = "wlan"
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ if TYPE_CHECKING:
|
||||||
def link_data_params(link_data: LinkData) -> Tuple[int, int, bool]:
|
def link_data_params(link_data: LinkData) -> Tuple[int, int, bool]:
|
||||||
node_one = link_data.node1_id
|
node_one = link_data.node1_id
|
||||||
node_two = link_data.node2_id
|
node_two = link_data.node2_id
|
||||||
is_wireless = link_data.link_type == LinkTypes.WIRELESS.value
|
is_wireless = link_data.link_type == LinkTypes.WIRELESS
|
||||||
return node_one, node_two, is_wireless
|
return node_one, node_two, is_wireless
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -551,7 +551,7 @@ class Babel(QuaggaService):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generatequaggaifcconfig(cls, node, ifc):
|
def generatequaggaifcconfig(cls, node, ifc):
|
||||||
if ifc.net and ifc.net.linktype == LinkTypes.WIRELESS.value:
|
if ifc.net and ifc.net.linktype == LinkTypes.WIRELESS:
|
||||||
return " babel wireless\n no babel split-horizon\n"
|
return " babel wireless\n no babel split-horizon\n"
|
||||||
else:
|
else:
|
||||||
return " babel wired\n babel split-horizon\n"
|
return " babel wired\n babel split-horizon\n"
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"level": "DEBUG",
|
"level": "INFO",
|
||||||
"handlers": ["console"]
|
"handlers": ["console"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue