gns3-server 3.0.0b3__py3-none-any.whl → 3.0.0rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gns3-server might be problematic. Click here for more details.

Files changed (47) hide show
  1. {gns3_server-3.0.0b3.dist-info → gns3_server-3.0.0rc1.dist-info}/METADATA +31 -31
  2. {gns3_server-3.0.0b3.dist-info → gns3_server-3.0.0rc1.dist-info}/RECORD +47 -47
  3. {gns3_server-3.0.0b3.dist-info → gns3_server-3.0.0rc1.dist-info}/WHEEL +1 -1
  4. gns3server/api/routes/controller/projects.py +2 -0
  5. gns3server/appliances/aruba-arubaoscx.gns3a +39 -0
  6. gns3server/appliances/cisco-iou-l2.gns3a +2 -2
  7. gns3server/appliances/cisco-iou-l3.gns3a +2 -2
  8. gns3server/appliances/debian.gns3a +28 -0
  9. gns3server/appliances/fortiadc.gns3a +46 -4
  10. gns3server/appliances/fortianalyzer.gns3a +42 -0
  11. gns3server/appliances/fortiauthenticator.gns3a +58 -2
  12. gns3server/appliances/fortigate.gns3a +42 -0
  13. gns3server/appliances/fortimanager.gns3a +42 -0
  14. gns3server/appliances/fortiweb.gns3a +56 -0
  15. gns3server/appliances/juniper-junos-space.gns3a +3 -2
  16. gns3server/appliances/juniper-vmx-legacy.gns3a +1 -1
  17. gns3server/appliances/juniper-vmx-vcp.gns3a +1 -1
  18. gns3server/appliances/juniper-vmx-vfp.gns3a +2 -1
  19. gns3server/appliances/juniper-vqfx-pfe.gns3a +1 -1
  20. gns3server/appliances/juniper-vqfx-re.gns3a +2 -1
  21. gns3server/appliances/juniper-vrr.gns3a +1 -1
  22. gns3server/appliances/juniper-vsrx.gns3a +2 -1
  23. gns3server/appliances/pan-vm-fw.gns3a +26 -0
  24. gns3server/appliances/security-onion.gns3a +27 -3
  25. gns3server/appliances/ubuntu-docker.gns3a +1 -1
  26. gns3server/compute/docker/__init__.py +8 -2
  27. gns3server/compute/qemu/qemu_vm.py +26 -10
  28. gns3server/config_samples/gns3_server.conf +13 -3
  29. gns3server/configs/iou_l2_base_startup-config.txt +1 -1
  30. gns3server/configs/iou_l3_base_startup-config.txt +1 -1
  31. gns3server/controller/__init__.py +12 -7
  32. gns3server/controller/appliance_manager.py +7 -2
  33. gns3server/controller/export_project.py +9 -9
  34. gns3server/controller/import_project.py +3 -3
  35. gns3server/controller/project.py +8 -4
  36. gns3server/controller/snapshot.py +3 -8
  37. gns3server/controller/topology.py +30 -1
  38. gns3server/crash_report.py +1 -1
  39. gns3server/schemas/config.py +3 -0
  40. gns3server/static/web-ui/index.html +3 -3
  41. gns3server/static/web-ui/{main.f3840f9b1c0240e6.js → main.4185a8e61824af0d.js} +1 -1
  42. gns3server/utils/__init__.py +20 -0
  43. gns3server/utils/hostname.py +53 -0
  44. gns3server/version.py +1 -1
  45. {gns3_server-3.0.0b3.dist-info → gns3_server-3.0.0rc1.dist-info}/LICENSE +0 -0
  46. {gns3_server-3.0.0b3.dist-info → gns3_server-3.0.0rc1.dist-info}/entry_points.txt +0 -0
  47. {gns3_server-3.0.0b3.dist-info → gns3_server-3.0.0rc1.dist-info}/top_level.txt +0 -0
@@ -21,6 +21,8 @@ import re
21
21
  import shlex
22
22
  import textwrap
23
23
  import posixpath
24
+ import socket
25
+ import errno
24
26
 
25
27
 
26
28
  def force_unix_path(path):
@@ -89,3 +91,21 @@ def parse_version(version):
89
91
  version.append("000000")
90
92
  version.append("final")
91
93
  return tuple(version)
94
+
95
+
96
+ def is_ipv6_enabled() -> bool:
97
+
98
+ if not socket.has_ipv6:
99
+ return False # the socket library has no support for IPv6
100
+ try:
101
+ with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as sock:
102
+ sock.bind(("::1", 0))
103
+ return True
104
+ except OSError as e:
105
+ if e.errno in (errno.EADDRNOTAVAIL, errno.EAFNOSUPPORT):
106
+ # EADDRNOTAVAIL is the errno if IPv6 modules/drivers are loaded but disabled.
107
+ # EAFNOSUPPORT is the errno if IPv6 modules/drivers are not loaded at all.
108
+ return False
109
+ if e.errno == errno.EADDRINUSE:
110
+ return True
111
+ raise
@@ -32,6 +32,28 @@ def is_ios_hostname_valid(hostname: str) -> bool:
32
32
  return False
33
33
 
34
34
 
35
+ def to_ios_hostname(name):
36
+ """
37
+ Convert name to an IOS hostname
38
+ """
39
+
40
+ # Replace invalid characters with hyphens
41
+ name = re.sub(r'[^a-zA-Z0-9-]', '-', name)
42
+
43
+ # Ensure the hostname starts with a letter
44
+ if not re.search(r'^[a-zA-Z]', name):
45
+ name = 'a' + name
46
+
47
+ # Ensure the hostname ends with a letter or digit
48
+ if not re.search(r'[a-zA-Z0-9]$', name):
49
+ name = name.rstrip('-') + '0'
50
+
51
+ # Truncate the hostname to 63 characters
52
+ name = name[:63]
53
+
54
+ return name
55
+
56
+
35
57
  def is_rfc1123_hostname_valid(hostname: str) -> bool:
36
58
  """
37
59
  Check if a hostname is valid according to RFC 1123
@@ -57,3 +79,34 @@ def is_rfc1123_hostname_valid(hostname: str) -> bool:
57
79
 
58
80
  allowed = re.compile(r"(?!-)[a-zA-Z0-9-]{1,63}(?<!-)$")
59
81
  return all(allowed.match(label) for label in labels)
82
+
83
+
84
+ def to_rfc1123_hostname(name: str) -> str:
85
+ """
86
+ Convert name to RFC 1123 hostname
87
+ """
88
+
89
+ # Replace invalid characters with hyphens
90
+ name = re.sub(r'[^a-zA-Z0-9-.]', '-', name)
91
+
92
+ # Remove trailing dot if it exists
93
+ name = name.rstrip('.')
94
+
95
+ # Ensure each label is not longer than 63 characters
96
+ labels = name.split('.')
97
+ labels = [label[:63] for label in labels]
98
+
99
+ # Remove leading and trailing hyphens from each label if they exist
100
+ labels = [label.strip('-') for label in labels]
101
+
102
+ # Check if the TLD is all-numeric and if so, replace it with "invalid"
103
+ if re.match(r"[0-9]+$", labels[-1]):
104
+ labels[-1] = 'invalid'
105
+
106
+ # Join the labels back together
107
+ name = '.'.join(labels)
108
+
109
+ # Ensure the total length is not longer than 253 characters
110
+ name = name[:253]
111
+
112
+ return name
gns3server/version.py CHANGED
@@ -22,7 +22,7 @@
22
22
  # or negative for a release candidate or beta (after the base version
23
23
  # number has been incremented)
24
24
 
25
- __version__ = "3.0.0b3"
25
+ __version__ = "3.0.0rc1"
26
26
  __version_info__ = (3, 0, 0, -99)
27
27
 
28
28
  if "dev" in __version__: