mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-31 00:24:12 +00:00
parent
ee50790ab5
commit
c90df05e8c
@ -27,6 +27,7 @@ class UDPLink(Link):
|
|||||||
def __init__(self, project, link_id=None):
|
def __init__(self, project, link_id=None):
|
||||||
super().__init__(project, link_id=link_id)
|
super().__init__(project, link_id=link_id)
|
||||||
self._capture_node = None
|
self._capture_node = None
|
||||||
|
self._created = False
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def create(self):
|
def create(self):
|
||||||
@ -69,12 +70,16 @@ class UDPLink(Link):
|
|||||||
"type": "nio_udp"
|
"type": "nio_udp"
|
||||||
}
|
}
|
||||||
yield from node2.post("/adapters/{adapter_number}/ports/{port_number}/nio".format(adapter_number=adapter_number2, port_number=port_number2), data=data)
|
yield from node2.post("/adapters/{adapter_number}/ports/{port_number}/nio".format(adapter_number=adapter_number2, port_number=port_number2), data=data)
|
||||||
|
self._created = True
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def delete(self):
|
def delete(self):
|
||||||
"""
|
"""
|
||||||
Delete the link and free the resources
|
Delete the link and free the resources
|
||||||
"""
|
"""
|
||||||
|
if not self._created:
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
node1 = self._nodes[0]["node"]
|
node1 = self._nodes[0]["node"]
|
||||||
adapter_number1 = self._nodes[0]["adapter_number"]
|
adapter_number1 = self._nodes[0]["adapter_number"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user