mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 09:18:08 +00:00
parent
f86358ad71
commit
7ba7c89594
@ -485,9 +485,22 @@ def _create_cloud(node, old_node, icon):
|
||||
port_type = "ethernet"
|
||||
elif old_port["name"].startswith("nio_tap"):
|
||||
port_type = "tap"
|
||||
elif old_port["name"].startswith("nio_udp"):
|
||||
port_type = "udp"
|
||||
else:
|
||||
raise NotImplementedError("The conversion of cloud with {} is not supported".format(old_port["name"]))
|
||||
|
||||
if port_type == "udp":
|
||||
_, lport, rhost, rport = old_port["name"].split(":")
|
||||
port = {
|
||||
"name": "UDP tunnel {}".format(len(ports) + 1),
|
||||
"port_number": len(ports) + 1,
|
||||
"type": port_type,
|
||||
"lport": int(lport),
|
||||
"rhost": rhost,
|
||||
"rport": int(rport)
|
||||
}
|
||||
else:
|
||||
port = {
|
||||
"interface": old_port["name"].split(":")[1],
|
||||
"name": old_port["name"].split(":")[1],
|
||||
|
60
tests/topologies/1_5_cloud_udp/after/1_5_cloud_udp.gns3
Normal file
60
tests/topologies/1_5_cloud_udp/after/1_5_cloud_udp.gns3
Normal file
@ -0,0 +1,60 @@
|
||||
{
|
||||
"auto_start": false,
|
||||
"name": "untitled",
|
||||
"project_id": "a22527ce-c976-48d6-afe9-2a04dea47a99",
|
||||
"revision": 6,
|
||||
"topology": {
|
||||
"computes": [
|
||||
{
|
||||
"compute_id": "local",
|
||||
"host": "127.0.0.1",
|
||||
"name": "Local",
|
||||
"port": 3080,
|
||||
"protocol": "http"
|
||||
}
|
||||
],
|
||||
"drawings": [],
|
||||
"links": [
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"compute_id": "local",
|
||||
"console": null,
|
||||
"console_type": null,
|
||||
"first_port_name": null,
|
||||
"label": {
|
||||
"rotation": 0,
|
||||
"style": "font-family: TypeWriter;font-size: 10;font-weight: bold;fill: #000000;fill-opacity: 1.0;",
|
||||
"text": "Cloud 1",
|
||||
"x": 55,
|
||||
"y": -25
|
||||
},
|
||||
"name": "Cloud 1",
|
||||
"node_id": "ANYSTR",
|
||||
"node_type": "cloud",
|
||||
"port_name_format": "Ethernet{0}",
|
||||
"port_segment_size": 0,
|
||||
"properties": {
|
||||
"interfaces": [
|
||||
],
|
||||
"ports_mapping": [
|
||||
{
|
||||
"lport": 30000,
|
||||
"name": "UDP tunnel 1",
|
||||
"port_number": 1,
|
||||
"rhost": "127.0.0.1",
|
||||
"rport": 20000,
|
||||
"type": "udp"
|
||||
}
|
||||
]
|
||||
},
|
||||
"symbol": ":/symbols/cloud.svg",
|
||||
"x": -210,
|
||||
"y": -167,
|
||||
"z": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "ANYSTR"
|
||||
}
|
55
tests/topologies/1_5_cloud_udp/before/1_5_cloud_udp.gns3
Normal file
55
tests/topologies/1_5_cloud_udp/before/1_5_cloud_udp.gns3
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"auto_start": false,
|
||||
"name": "untitled",
|
||||
"project_id": "a22527ce-c976-48d6-afe9-2a04dea47a99",
|
||||
"revision": 4,
|
||||
"topology": {
|
||||
"links": [
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"description": "Cloud",
|
||||
"id": 1,
|
||||
"label": {
|
||||
"color": "#ff000000",
|
||||
"font": "TypeWriter,10,-1,5,75,0,0,0,0,0",
|
||||
"text": "Cloud 1",
|
||||
"x": 55.6015625,
|
||||
"y": -25.0
|
||||
},
|
||||
"ports": [
|
||||
{
|
||||
"description": "connected to PC1 on port Ethernet0",
|
||||
"id": 2,
|
||||
"link_id": 1,
|
||||
"name": "nio_udp:30000:127.0.0.1:20000",
|
||||
"nio": "NIO_UDP",
|
||||
"stub": true
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"name": "Cloud 1",
|
||||
"nios": [
|
||||
"nio_udp:30000:127.0.0.1:20000"
|
||||
]
|
||||
},
|
||||
"server_id": 1,
|
||||
"type": "Cloud",
|
||||
"x": -210.5,
|
||||
"y": -167.0
|
||||
}
|
||||
],
|
||||
"servers": [
|
||||
{
|
||||
"host": "127.0.0.1",
|
||||
"id": 1,
|
||||
"local": true,
|
||||
"port": 3080,
|
||||
"protocol": "http",
|
||||
"vm": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "topology",
|
||||
"version": "1.5.1"
|
||||
}
|
Loading…
Reference in New Issue
Block a user