gns3-server 3.0.0__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 (1251) hide show
  1. gns3_server-3.0.0.dist-info/LICENSE +674 -0
  2. gns3_server-3.0.0.dist-info/METADATA +868 -0
  3. gns3_server-3.0.0.dist-info/RECORD +1251 -0
  4. gns3_server-3.0.0.dist-info/WHEEL +5 -0
  5. gns3_server-3.0.0.dist-info/entry_points.txt +3 -0
  6. gns3_server-3.0.0.dist-info/top_level.txt +1 -0
  7. gns3server/__init__.py +17 -0
  8. gns3server/__main__.py +20 -0
  9. gns3server/alembic.ini +103 -0
  10. gns3server/api/__init__.py +0 -0
  11. gns3server/api/routes/__init__.py +0 -0
  12. gns3server/api/routes/compute/__init__.py +267 -0
  13. gns3server/api/routes/compute/atm_switch_nodes.py +233 -0
  14. gns3server/api/routes/compute/capabilities.py +51 -0
  15. gns3server/api/routes/compute/cloud_nodes.py +249 -0
  16. gns3server/api/routes/compute/compute.py +143 -0
  17. gns3server/api/routes/compute/dependencies/__init__.py +0 -0
  18. gns3server/api/routes/compute/dependencies/authentication.py +83 -0
  19. gns3server/api/routes/compute/docker_nodes.py +393 -0
  20. gns3server/api/routes/compute/dynamips_nodes.py +367 -0
  21. gns3server/api/routes/compute/ethernet_hub_nodes.py +236 -0
  22. gns3server/api/routes/compute/ethernet_switch_nodes.py +246 -0
  23. gns3server/api/routes/compute/frame_relay_switch_nodes.py +240 -0
  24. gns3server/api/routes/compute/images.py +156 -0
  25. gns3server/api/routes/compute/iou_nodes.py +344 -0
  26. gns3server/api/routes/compute/nat_nodes.py +244 -0
  27. gns3server/api/routes/compute/notifications.py +88 -0
  28. gns3server/api/routes/compute/projects.py +243 -0
  29. gns3server/api/routes/compute/qemu_nodes.py +412 -0
  30. gns3server/api/routes/compute/virtualbox_nodes.py +377 -0
  31. gns3server/api/routes/compute/vmware_nodes.py +355 -0
  32. gns3server/api/routes/compute/vpcs_nodes.py +343 -0
  33. gns3server/api/routes/controller/__init__.py +147 -0
  34. gns3server/api/routes/controller/acl.py +268 -0
  35. gns3server/api/routes/controller/appliances.py +150 -0
  36. gns3server/api/routes/controller/computes.py +231 -0
  37. gns3server/api/routes/controller/controller.py +319 -0
  38. gns3server/api/routes/controller/dependencies/__init__.py +0 -0
  39. gns3server/api/routes/controller/dependencies/authentication.py +117 -0
  40. gns3server/api/routes/controller/dependencies/database.py +38 -0
  41. gns3server/api/routes/controller/dependencies/rbac.py +78 -0
  42. gns3server/api/routes/controller/drawings.py +131 -0
  43. gns3server/api/routes/controller/gns3vm.py +71 -0
  44. gns3server/api/routes/controller/groups.py +231 -0
  45. gns3server/api/routes/controller/images.py +255 -0
  46. gns3server/api/routes/controller/links.py +287 -0
  47. gns3server/api/routes/controller/nodes.py +619 -0
  48. gns3server/api/routes/controller/pools.py +239 -0
  49. gns3server/api/routes/controller/privileges.py +43 -0
  50. gns3server/api/routes/controller/projects.py +595 -0
  51. gns3server/api/routes/controller/roles.py +224 -0
  52. gns3server/api/routes/controller/snapshots.py +124 -0
  53. gns3server/api/routes/controller/symbols.py +133 -0
  54. gns3server/api/routes/controller/templates.py +192 -0
  55. gns3server/api/routes/controller/users.py +254 -0
  56. gns3server/api/routes/index.py +93 -0
  57. gns3server/api/server.py +224 -0
  58. gns3server/appliances/6wind-turbo-router.gns3a +47 -0
  59. gns3server/appliances/IPCop.gns3a +52 -0
  60. gns3server/appliances/a10-vthunder.gns3a +72 -0
  61. gns3server/appliances/aaa.gns3a +20 -0
  62. gns3server/appliances/alcatel-7750.gns3a +74 -0
  63. gns3server/appliances/almalinux.gns3a +84 -0
  64. gns3server/appliances/alpine-linux-virt.gns3a +59 -0
  65. gns3server/appliances/alpine-linux.gns3a +21 -0
  66. gns3server/appliances/arista-ceos.gns3a +20 -0
  67. gns3server/appliances/arista-veos.gns3a +577 -0
  68. gns3server/appliances/aruba-arubaoscx.gns3a +233 -0
  69. gns3server/appliances/aruba-vgw.gns3a +60 -0
  70. gns3server/appliances/aruba-vmc.gns3a +56 -0
  71. gns3server/appliances/asterfusion-vAsterNOS.gns3a +49 -0
  72. gns3server/appliances/asterisk.gns3a +114 -0
  73. gns3server/appliances/bigswitch-bigcloud-fabric.gns3a +42 -0
  74. gns3server/appliances/bird.gns3a +42 -0
  75. gns3server/appliances/bird2.gns3a +57 -0
  76. gns3server/appliances/brocade-vadx.gns3a +43 -0
  77. gns3server/appliances/brocade-vrouter.gns3a +138 -0
  78. gns3server/appliances/brocade-vtm.gns3a +136 -0
  79. gns3server/appliances/bsdrp.gns3a +117 -0
  80. gns3server/appliances/centos-cloud.gns3a +115 -0
  81. gns3server/appliances/centos7.gns3a +72 -0
  82. gns3server/appliances/checkpoint-gaia.gns3a +81 -0
  83. gns3server/appliances/chromium.gns3a +19 -0
  84. gns3server/appliances/cisco-1700.gns3a +39 -0
  85. gns3server/appliances/cisco-2600.gns3a +38 -0
  86. gns3server/appliances/cisco-2691.gns3a +38 -0
  87. gns3server/appliances/cisco-3620.gns3a +38 -0
  88. gns3server/appliances/cisco-3640.gns3a +38 -0
  89. gns3server/appliances/cisco-3660.gns3a +38 -0
  90. gns3server/appliances/cisco-3725.gns3a +38 -0
  91. gns3server/appliances/cisco-3745.gns3a +45 -0
  92. gns3server/appliances/cisco-7200.gns3a +92 -0
  93. gns3server/appliances/cisco-asa.gns3a +86 -0
  94. gns3server/appliances/cisco-asav.gns3a +227 -0
  95. gns3server/appliances/cisco-c8000v.gns3a +108 -0
  96. gns3server/appliances/cisco-cat9k.gns3a +58 -0
  97. gns3server/appliances/cisco-csr1000v.gns3a +316 -0
  98. gns3server/appliances/cisco-dcnm.gns3a +96 -0
  99. gns3server/appliances/cisco-fcnf.gns3a +71 -0
  100. gns3server/appliances/cisco-fmcv.gns3a +139 -0
  101. gns3server/appliances/cisco-fsve.gns3a +57 -0
  102. gns3server/appliances/cisco-ftdv.gns3a +99 -0
  103. gns3server/appliances/cisco-iosv.gns3a +178 -0
  104. gns3server/appliances/cisco-iosvl2.gns3a +95 -0
  105. gns3server/appliances/cisco-iosxrv.gns3a +57 -0
  106. gns3server/appliances/cisco-iosxrv9k.gns3a +188 -0
  107. gns3server/appliances/cisco-iou-l2.gns3a +84 -0
  108. gns3server/appliances/cisco-iou-l3.gns3a +84 -0
  109. gns3server/appliances/cisco-ise.gns3a +154 -0
  110. gns3server/appliances/cisco-ngipsv.gns3a +73 -0
  111. gns3server/appliances/cisco-nxosv.gns3a +56 -0
  112. gns3server/appliances/cisco-nxosv9k.gns3a +433 -0
  113. gns3server/appliances/cisco-pyats.gns3a +19 -0
  114. gns3server/appliances/cisco-smc.gns3a +71 -0
  115. gns3server/appliances/cisco-vWLC.gns3a +140 -0
  116. gns3server/appliances/cisco-wsav.gns3a +44 -0
  117. gns3server/appliances/citrix-netscaler-vpx.gns3a +72 -0
  118. gns3server/appliances/citrix-sd-wan.gns3a +46 -0
  119. gns3server/appliances/citrix-sdwan-center.gns3a +46 -0
  120. gns3server/appliances/clavister-netsheild.gns3a +59 -0
  121. gns3server/appliances/clavister-netwall.gns3a +71 -0
  122. gns3server/appliances/clearos.gns3a +107 -0
  123. gns3server/appliances/cloudrouter.gns3a +72 -0
  124. gns3server/appliances/coreos.gns3a +329 -0
  125. gns3server/appliances/cumulus-vx.gns3a +440 -0
  126. gns3server/appliances/danos.gns3a +57 -0
  127. gns3server/appliances/debian.gns3a +85 -0
  128. gns3server/appliances/deft-linux.gns3a +96 -0
  129. gns3server/appliances/dell-ftos.gns3a +71 -0
  130. gns3server/appliances/dns.gns3a +20 -0
  131. gns3server/appliances/empty-vm.gns3a +199 -0
  132. gns3server/appliances/endhost.gns3a +17 -0
  133. gns3server/appliances/exos.gns3a +51 -0
  134. gns3server/appliances/extreme-networks-voss.gns3a +152 -0
  135. gns3server/appliances/f5-bigip.gns3a +322 -0
  136. gns3server/appliances/f5-bigiq.gns3a +165 -0
  137. gns3server/appliances/fedora-cloud.gns3a +70 -0
  138. gns3server/appliances/firefox.gns3a +59 -0
  139. gns3server/appliances/fortiadc-manager.gns3a +54 -0
  140. gns3server/appliances/fortiadc.gns3a +502 -0
  141. gns3server/appliances/fortianalyzer.gns3a +519 -0
  142. gns3server/appliances/fortiauthenticator.gns3a +251 -0
  143. gns3server/appliances/forticache.gns3a +210 -0
  144. gns3server/appliances/fortigate.gns3a +742 -0
  145. gns3server/appliances/fortimail.gns3a +392 -0
  146. gns3server/appliances/fortimanager.gns3a +519 -0
  147. gns3server/appliances/fortiproxy.gns3a +83 -0
  148. gns3server/appliances/fortirecorder.gns3a +69 -0
  149. gns3server/appliances/fortisandbox.gns3a +210 -0
  150. gns3server/appliances/fortisiem-super_worker.gns3a +210 -0
  151. gns3server/appliances/fortiweb.gns3a +308 -0
  152. gns3server/appliances/freeRouter.gns3a +44 -0
  153. gns3server/appliances/freebsd.gns3a +75 -0
  154. gns3server/appliances/freenas.gns3a +183 -0
  155. gns3server/appliances/frr.gns3a +84 -0
  156. gns3server/appliances/haproxy.gns3a +18 -0
  157. gns3server/appliances/hbcd-pe.gns3a +62 -0
  158. gns3server/appliances/hp-vsr1001.gns3a +149 -0
  159. gns3server/appliances/huawei-ar1kv.gns3a +58 -0
  160. gns3server/appliances/huawei-ce12800.gns3a +43 -0
  161. gns3server/appliances/huawei-ne40e.gns3a +94 -0
  162. gns3server/appliances/huawei-usg6kv.gns3a +50 -0
  163. gns3server/appliances/innovaphone-app.gns3a +50 -0
  164. gns3server/appliances/innovaphone-ipva.gns3a +78 -0
  165. gns3server/appliances/ipfire.gns3a +181 -0
  166. gns3server/appliances/ipterm.gns3a +19 -0
  167. gns3server/appliances/ipxe.gns3a +47 -0
  168. gns3server/appliances/juniper-junos-space.gns3a +46 -0
  169. gns3server/appliances/juniper-vmx-legacy.gns3a +55 -0
  170. gns3server/appliances/juniper-vmx-vcp.gns3a +520 -0
  171. gns3server/appliances/juniper-vmx-vfp.gns3a +281 -0
  172. gns3server/appliances/juniper-vqfx-pfe.gns3a +71 -0
  173. gns3server/appliances/juniper-vqfx-re.gns3a +85 -0
  174. gns3server/appliances/juniper-vrr.gns3a +66 -0
  175. gns3server/appliances/juniper-vsrx.gns3a +332 -0
  176. gns3server/appliances/jupyter.gns3a +20 -0
  177. gns3server/appliances/jupyter27.gns3a +20 -0
  178. gns3server/appliances/kali-linux-cli.gns3a +18 -0
  179. gns3server/appliances/kali-linux.gns3a +248 -0
  180. gns3server/appliances/kemp-vlm.gns3a +111 -0
  181. gns3server/appliances/kerio-connect.gns3a +131 -0
  182. gns3server/appliances/kerio-control.gns3a +143 -0
  183. gns3server/appliances/kerio-operator.gns3a +130 -0
  184. gns3server/appliances/lancom-vrouter.gns3a +45 -0
  185. gns3server/appliances/loadbalancer_org-va.gns3a +56 -0
  186. gns3server/appliances/macos-install.gns3a +72 -0
  187. gns3server/appliances/mcjoin.gns3a +19 -0
  188. gns3server/appliances/microcore-linux.gns3a +72 -0
  189. gns3server/appliances/mikrotik-ccr1036-8g-2s+.gns3a +165 -0
  190. gns3server/appliances/mikrotik-ccr1072-1g-8s+.gns3a +161 -0
  191. gns3server/appliances/mikrotik-chr.gns3a +108 -0
  192. gns3server/appliances/mikrotik-crs328-24p-4s+.gns3a +173 -0
  193. gns3server/appliances/mikrotik-crs328-4c-20s-4s+.gns3a +189 -0
  194. gns3server/appliances/mikrotik-rb1100ahx4-dude-edition.gns3a +155 -0
  195. gns3server/appliances/mikrotik-rb2011uias.gns3a +161 -0
  196. gns3server/appliances/mikrotik-rb3011uias.gns3a +161 -0
  197. gns3server/appliances/mikrotik-rb4011igs+.gns3a +161 -0
  198. gns3server/appliances/mikrotik-rb450g.gns3a +155 -0
  199. gns3server/appliances/mikrotik-rb450gx4.gns3a +155 -0
  200. gns3server/appliances/mikrotik-winbox.gns3a +19 -0
  201. gns3server/appliances/mininet.gns3a +47 -0
  202. gns3server/appliances/net_toolbox.gns3a +20 -0
  203. gns3server/appliances/netapp-ontapsim.gns3a +185 -0
  204. gns3server/appliances/netem.gns3a +44 -0
  205. gns3server/appliances/network_automation.gns3a +19 -0
  206. gns3server/appliances/nixos.gns3a +52 -0
  207. gns3server/appliances/nokia-vsim.gns3a +47 -0
  208. gns3server/appliances/ntopng.gns3a +24 -0
  209. gns3server/appliances/onos.gns3a +19 -0
  210. gns3server/appliances/op5-monitor.gns3a +72 -0
  211. gns3server/appliances/open-media-vault.gns3a +120 -0
  212. gns3server/appliances/openbsd.gns3a +44 -0
  213. gns3server/appliances/opennac.gns3a +45 -0
  214. gns3server/appliances/opensuse.gns3a +47 -0
  215. gns3server/appliances/openvswitch-management.gns3a +21 -0
  216. gns3server/appliances/openvswitch.gns3a +21 -0
  217. gns3server/appliances/openwrt-realview.gns3a +56 -0
  218. gns3server/appliances/openwrt.gns3a +359 -0
  219. gns3server/appliances/opnsense.gns3a +122 -0
  220. gns3server/appliances/oracle-linux-cloud.gns3a +115 -0
  221. gns3server/appliances/ostinato-wireshark.gns3a +20 -0
  222. gns3server/appliances/ostinato.gns3a +75 -0
  223. gns3server/appliances/ovs-snmp.gns3a +18 -0
  224. gns3server/appliances/packetfence-zen.gns3a +151 -0
  225. gns3server/appliances/pan-vm-fw.gns3a +241 -0
  226. gns3server/appliances/parrot-os.gns3a +68 -0
  227. gns3server/appliances/pfsense.gns3a +122 -0
  228. gns3server/appliances/proxmox-mg.gns3a +69 -0
  229. gns3server/appliances/puppy-linux.gns3a +82 -0
  230. gns3server/appliances/python-go-perl-php.gns3a +17 -0
  231. gns3server/appliances/raspian.gns3a +79 -0
  232. gns3server/appliances/reactos.gns3a +67 -0
  233. gns3server/appliances/rhel.gns3a +207 -0
  234. gns3server/appliances/riverbed-steelhead-ng-vcx.gns3a +68 -0
  235. gns3server/appliances/rockylinux.gns3a +100 -0
  236. gns3server/appliances/security-onion.gns3a +108 -0
  237. gns3server/appliances/smoothwall.gns3a +54 -0
  238. gns3server/appliances/sophos-iview.gns3a +66 -0
  239. gns3server/appliances/sophos-utm.gns3a +263 -0
  240. gns3server/appliances/sophos-xg.gns3a +198 -0
  241. gns3server/appliances/stonework.gns3a +21 -0
  242. gns3server/appliances/tacacs-gui.gns3a +57 -0
  243. gns3server/appliances/tinycore-linux.gns3a +73 -0
  244. gns3server/appliances/trendmicro-imsva.gns3a +54 -0
  245. gns3server/appliances/trendmicro-iwsva.gns3a +53 -0
  246. gns3server/appliances/truenas.gns3a +104 -0
  247. gns3server/appliances/turnkey-wordpress.gns3a +20 -0
  248. gns3server/appliances/ubuntu-cloud.gns3a +116 -0
  249. gns3server/appliances/ubuntu-docker.gns3a +20 -0
  250. gns3server/appliances/ubuntu-gui.gns3a +98 -0
  251. gns3server/appliances/untangle.gns3a +208 -0
  252. gns3server/appliances/viptela-edge-genericx86-64.gns3a +84 -0
  253. gns3server/appliances/viptela-smart-genericx86-64.gns3a +82 -0
  254. gns3server/appliances/viptela-vmanage-genericx86-64.gns3a +95 -0
  255. gns3server/appliances/vpp.gns3a +45 -0
  256. gns3server/appliances/vrin.gns3a +118 -0
  257. gns3server/appliances/vyos.gns3a +179 -0
  258. gns3server/appliances/watchguard-fireboxv.gns3a +45 -0
  259. gns3server/appliances/watchguard-xtmv.gns3a +45 -0
  260. gns3server/appliances/webterm.gns3a +20 -0
  261. gns3server/appliances/windows-11-dev-env.gns3a +74 -0
  262. gns3server/appliances/windows-xp+ie.gns3a +52 -0
  263. gns3server/appliances/windows.gns3a +125 -0
  264. gns3server/appliances/windows_server.gns3a +83 -0
  265. gns3server/appliances/zentyal-server.gns3a +159 -0
  266. gns3server/appliances/zeroshell.gns3a +103 -0
  267. gns3server/compute/__init__.py +38 -0
  268. gns3server/compute/adapters/__init__.py +0 -0
  269. gns3server/compute/adapters/adapter.py +104 -0
  270. gns3server/compute/adapters/ethernet_adapter.py +33 -0
  271. gns3server/compute/adapters/serial_adapter.py +32 -0
  272. gns3server/compute/base_manager.py +547 -0
  273. gns3server/compute/base_node.py +979 -0
  274. gns3server/compute/builtin/__init__.py +46 -0
  275. gns3server/compute/builtin/builtin_node_factory.py +42 -0
  276. gns3server/compute/builtin/nodes/__init__.py +0 -0
  277. gns3server/compute/builtin/nodes/cloud.py +548 -0
  278. gns3server/compute/builtin/nodes/ethernet_hub.py +104 -0
  279. gns3server/compute/builtin/nodes/ethernet_switch.py +104 -0
  280. gns3server/compute/builtin/nodes/nat.py +97 -0
  281. gns3server/compute/compute_error.py +48 -0
  282. gns3server/compute/docker/__init__.py +320 -0
  283. gns3server/compute/docker/docker_error.py +33 -0
  284. gns3server/compute/docker/docker_vm.py +1378 -0
  285. gns3server/compute/docker/resources/bin/udhcpc +15 -0
  286. gns3server/compute/docker/resources/etc/udhcpc/default.script +138 -0
  287. gns3server/compute/docker/resources/init.sh +102 -0
  288. gns3server/compute/docker/resources/run-cmd.sh +6 -0
  289. gns3server/compute/dynamips/__init__.py +661 -0
  290. gns3server/compute/dynamips/adapters/__init__.py +0 -0
  291. gns3server/compute/dynamips/adapters/adapter.py +165 -0
  292. gns3server/compute/dynamips/adapters/c1700_mb_1fe.py +36 -0
  293. gns3server/compute/dynamips/adapters/c1700_mb_wic1.py +37 -0
  294. gns3server/compute/dynamips/adapters/c2600_mb_1e.py +36 -0
  295. gns3server/compute/dynamips/adapters/c2600_mb_1fe.py +37 -0
  296. gns3server/compute/dynamips/adapters/c2600_mb_2e.py +36 -0
  297. gns3server/compute/dynamips/adapters/c2600_mb_2fe.py +36 -0
  298. gns3server/compute/dynamips/adapters/c7200_io_2fe.py +36 -0
  299. gns3server/compute/dynamips/adapters/c7200_io_fe.py +36 -0
  300. gns3server/compute/dynamips/adapters/c7200_io_ge_e.py +36 -0
  301. gns3server/compute/dynamips/adapters/gt96100_fe.py +31 -0
  302. gns3server/compute/dynamips/adapters/leopard_2fe.py +37 -0
  303. gns3server/compute/dynamips/adapters/nm_16esw.py +32 -0
  304. gns3server/compute/dynamips/adapters/nm_1e.py +32 -0
  305. gns3server/compute/dynamips/adapters/nm_1fe_tx.py +32 -0
  306. gns3server/compute/dynamips/adapters/nm_4e.py +32 -0
  307. gns3server/compute/dynamips/adapters/nm_4t.py +32 -0
  308. gns3server/compute/dynamips/adapters/pa_2fe_tx.py +32 -0
  309. gns3server/compute/dynamips/adapters/pa_4e.py +32 -0
  310. gns3server/compute/dynamips/adapters/pa_4t.py +32 -0
  311. gns3server/compute/dynamips/adapters/pa_8e.py +32 -0
  312. gns3server/compute/dynamips/adapters/pa_8t.py +32 -0
  313. gns3server/compute/dynamips/adapters/pa_a1.py +32 -0
  314. gns3server/compute/dynamips/adapters/pa_fe_tx.py +32 -0
  315. gns3server/compute/dynamips/adapters/pa_ge.py +32 -0
  316. gns3server/compute/dynamips/adapters/pa_pos_oc3.py +32 -0
  317. gns3server/compute/dynamips/adapters/wic_1enet.py +40 -0
  318. gns3server/compute/dynamips/adapters/wic_1t.py +40 -0
  319. gns3server/compute/dynamips/adapters/wic_2t.py +40 -0
  320. gns3server/compute/dynamips/dynamips_error.py +26 -0
  321. gns3server/compute/dynamips/dynamips_factory.py +71 -0
  322. gns3server/compute/dynamips/dynamips_hypervisor.py +333 -0
  323. gns3server/compute/dynamips/hypervisor.py +210 -0
  324. gns3server/compute/dynamips/nios/__init__.py +0 -0
  325. gns3server/compute/dynamips/nios/nio.py +352 -0
  326. gns3server/compute/dynamips/nios/nio_generic_ethernet.py +73 -0
  327. gns3server/compute/dynamips/nios/nio_linux_ethernet.py +72 -0
  328. gns3server/compute/dynamips/nios/nio_null.py +51 -0
  329. gns3server/compute/dynamips/nios/nio_tap.py +66 -0
  330. gns3server/compute/dynamips/nios/nio_udp.py +136 -0
  331. gns3server/compute/dynamips/nios/nio_unix.py +88 -0
  332. gns3server/compute/dynamips/nios/nio_vde.py +88 -0
  333. gns3server/compute/dynamips/nodes/__init__.py +0 -0
  334. gns3server/compute/dynamips/nodes/atm_switch.py +514 -0
  335. gns3server/compute/dynamips/nodes/bridge.py +107 -0
  336. gns3server/compute/dynamips/nodes/c1700.py +160 -0
  337. gns3server/compute/dynamips/nodes/c2600.py +171 -0
  338. gns3server/compute/dynamips/nodes/c2691.py +112 -0
  339. gns3server/compute/dynamips/nodes/c3600.py +155 -0
  340. gns3server/compute/dynamips/nodes/c3725.py +112 -0
  341. gns3server/compute/dynamips/nodes/c3745.py +112 -0
  342. gns3server/compute/dynamips/nodes/c7200.py +268 -0
  343. gns3server/compute/dynamips/nodes/device.py +134 -0
  344. gns3server/compute/dynamips/nodes/ethernet_hub.py +241 -0
  345. gns3server/compute/dynamips/nodes/ethernet_switch.py +496 -0
  346. gns3server/compute/dynamips/nodes/frame_relay_switch.py +379 -0
  347. gns3server/compute/dynamips/nodes/router.py +1797 -0
  348. gns3server/compute/error.py +40 -0
  349. gns3server/compute/iou/__init__.py +64 -0
  350. gns3server/compute/iou/iou_error.py +25 -0
  351. gns3server/compute/iou/iou_vm.py +1482 -0
  352. gns3server/compute/iou/utils/__init__.py +0 -0
  353. gns3server/compute/iou/utils/iou_export.py +233 -0
  354. gns3server/compute/iou/utils/iou_import.py +232 -0
  355. gns3server/compute/nios/__init__.py +0 -0
  356. gns3server/compute/nios/nio.py +120 -0
  357. gns3server/compute/nios/nio_ethernet.py +56 -0
  358. gns3server/compute/nios/nio_tap.py +56 -0
  359. gns3server/compute/nios/nio_udp.py +82 -0
  360. gns3server/compute/notification_manager.py +73 -0
  361. gns3server/compute/port_manager.py +402 -0
  362. gns3server/compute/project.py +434 -0
  363. gns3server/compute/project_manager.py +122 -0
  364. gns3server/compute/qemu/__init__.py +304 -0
  365. gns3server/compute/qemu/qemu_error.py +26 -0
  366. gns3server/compute/qemu/qemu_vm.py +2697 -0
  367. gns3server/compute/qemu/resources/config.img.zip +0 -0
  368. gns3server/compute/qemu/utils/__init__.py +0 -0
  369. gns3server/compute/qemu/utils/guest_cid.py +38 -0
  370. gns3server/compute/qemu/utils/qcow2.py +138 -0
  371. gns3server/compute/qemu/utils/ziputils.py +55 -0
  372. gns3server/compute/ubridge/__init__.py +0 -0
  373. gns3server/compute/ubridge/hypervisor.py +256 -0
  374. gns3server/compute/ubridge/ubridge_error.py +32 -0
  375. gns3server/compute/ubridge/ubridge_hypervisor.py +285 -0
  376. gns3server/compute/virtualbox/__init__.py +212 -0
  377. gns3server/compute/virtualbox/virtualbox_error.py +26 -0
  378. gns3server/compute/virtualbox/virtualbox_vm.py +1255 -0
  379. gns3server/compute/vmware/__init__.py +725 -0
  380. gns3server/compute/vmware/vmware_error.py +26 -0
  381. gns3server/compute/vmware/vmware_vm.py +1007 -0
  382. gns3server/compute/vpcs/__init__.py +91 -0
  383. gns3server/compute/vpcs/vpcs_error.py +26 -0
  384. gns3server/compute/vpcs/vpcs_vm.py +595 -0
  385. gns3server/config.py +284 -0
  386. gns3server/config_samples/gns3_server.conf +160 -0
  387. gns3server/configs/ios_base_startup-config.txt +26 -0
  388. gns3server/configs/ios_etherswitch_startup-config.txt +181 -0
  389. gns3server/configs/iou_l2_base_startup-config.txt +133 -0
  390. gns3server/configs/iou_l3_base_startup-config.txt +109 -0
  391. gns3server/configs/vpcs_base_config.txt +9 -0
  392. gns3server/controller/__init__.py +691 -0
  393. gns3server/controller/appliance.py +86 -0
  394. gns3server/controller/appliance_manager.py +486 -0
  395. gns3server/controller/appliance_to_template.py +132 -0
  396. gns3server/controller/compute.py +677 -0
  397. gns3server/controller/controller_error.py +77 -0
  398. gns3server/controller/drawing.py +229 -0
  399. gns3server/controller/export_project.py +336 -0
  400. gns3server/controller/gns3vm/__init__.py +412 -0
  401. gns3server/controller/gns3vm/base_gns3_vm.py +303 -0
  402. gns3server/controller/gns3vm/gns3_vm_error.py +28 -0
  403. gns3server/controller/gns3vm/hyperv_gns3_vm.py +346 -0
  404. gns3server/controller/gns3vm/remote_gns3_vm.py +73 -0
  405. gns3server/controller/gns3vm/virtualbox_gns3_vm.py +480 -0
  406. gns3server/controller/gns3vm/vmware_gns3_vm.py +216 -0
  407. gns3server/controller/import_project.py +332 -0
  408. gns3server/controller/link.py +461 -0
  409. gns3server/controller/node.py +840 -0
  410. gns3server/controller/notification.py +149 -0
  411. gns3server/controller/ports/__init__.py +0 -0
  412. gns3server/controller/ports/atm_port.py +51 -0
  413. gns3server/controller/ports/ethernet_port.py +49 -0
  414. gns3server/controller/ports/fastethernet_port.py +43 -0
  415. gns3server/controller/ports/frame_relay_port.py +43 -0
  416. gns3server/controller/ports/gigabitethernet_port.py +43 -0
  417. gns3server/controller/ports/port.py +109 -0
  418. gns3server/controller/ports/port_factory.py +213 -0
  419. gns3server/controller/ports/pos_port.py +52 -0
  420. gns3server/controller/ports/serial_port.py +63 -0
  421. gns3server/controller/project.py +1399 -0
  422. gns3server/controller/snapshot.py +140 -0
  423. gns3server/controller/symbol_themes.py +153 -0
  424. gns3server/controller/symbols.py +168 -0
  425. gns3server/controller/topology.py +788 -0
  426. gns3server/controller/udp_link.py +245 -0
  427. gns3server/core/__init__.py +0 -0
  428. gns3server/core/tasks.py +99 -0
  429. gns3server/crash_report.py +167 -0
  430. gns3server/db/__init__.py +0 -0
  431. gns3server/db/models/__init__.py +38 -0
  432. gns3server/db/models/acl.py +46 -0
  433. gns3server/db/models/base.py +117 -0
  434. gns3server/db/models/computes.py +33 -0
  435. gns3server/db/models/images.py +43 -0
  436. gns3server/db/models/pools.py +52 -0
  437. gns3server/db/models/privileges.py +359 -0
  438. gns3server/db/models/roles.py +57 -0
  439. gns3server/db/models/templates.py +272 -0
  440. gns3server/db/models/users.py +94 -0
  441. gns3server/db/repositories/__init__.py +0 -0
  442. gns3server/db/repositories/base.py +24 -0
  443. gns3server/db/repositories/computes.py +93 -0
  444. gns3server/db/repositories/images.py +141 -0
  445. gns3server/db/repositories/pools.py +218 -0
  446. gns3server/db/repositories/rbac.py +430 -0
  447. gns3server/db/repositories/templates.py +172 -0
  448. gns3server/db/repositories/users.py +289 -0
  449. gns3server/db/tasks.py +230 -0
  450. gns3server/db_migrations/README +5 -0
  451. gns3server/db_migrations/env.py +101 -0
  452. gns3server/db_migrations/script.py.mako +24 -0
  453. gns3server/db_migrations/versions/7ceeddd9c9a8_init.py +28 -0
  454. gns3server/db_migrations/versions/9a5292aa4389_add_mac_address_field_in_docker_.py +27 -0
  455. gns3server/disks/OVMF.fd +0 -0
  456. gns3server/disks/OVMF_CODE.fd +0 -0
  457. gns3server/disks/OVMF_VARS.fd +0 -0
  458. gns3server/disks/empty100G.qcow2 +0 -0
  459. gns3server/disks/empty10G.qcow2 +0 -0
  460. gns3server/disks/empty150G.qcow2 +0 -0
  461. gns3server/disks/empty1T.qcow2 +0 -0
  462. gns3server/disks/empty200G.qcow2 +0 -0
  463. gns3server/disks/empty20G.qcow2 +0 -0
  464. gns3server/disks/empty250G.qcow2 +0 -0
  465. gns3server/disks/empty30G.qcow2 +0 -0
  466. gns3server/disks/empty40G.qcow2 +0 -0
  467. gns3server/disks/empty500G.qcow2 +0 -0
  468. gns3server/disks/empty50G.qcow2 +0 -0
  469. gns3server/disks/empty8G.qcow2 +0 -0
  470. gns3server/gns3_server.egg-info/PKG-INFO +307 -0
  471. gns3server/gns3_server.egg-info/SOURCES.txt +0 -0
  472. gns3server/gns3_server.egg-info/dependency_links.txt +1 -0
  473. gns3server/gns3_server.egg-info/entry_points.txt +4 -0
  474. gns3server/gns3_server.egg-info/not-zip-safe +1 -0
  475. gns3server/gns3_server.egg-info/requires.txt +31 -0
  476. gns3server/gns3_server.egg-info/top_level.txt +2 -0
  477. gns3server/logger.py +164 -0
  478. gns3server/main.py +81 -0
  479. gns3server/schemas/__init__.py +85 -0
  480. gns3server/schemas/common.py +71 -0
  481. gns3server/schemas/compute/__init__.py +0 -0
  482. gns3server/schemas/compute/atm_switch_nodes.py +55 -0
  483. gns3server/schemas/compute/cloud_nodes.py +137 -0
  484. gns3server/schemas/compute/docker_nodes.py +75 -0
  485. gns3server/schemas/compute/dynamips_nodes.py +197 -0
  486. gns3server/schemas/compute/ethernet_hub_nodes.py +63 -0
  487. gns3server/schemas/compute/ethernet_switch_nodes.py +100 -0
  488. gns3server/schemas/compute/frame_relay_switch_nodes.py +55 -0
  489. gns3server/schemas/compute/iou_nodes.py +76 -0
  490. gns3server/schemas/compute/nat_nodes.py +122 -0
  491. gns3server/schemas/compute/nios.py +66 -0
  492. gns3server/schemas/compute/qemu_nodes.py +245 -0
  493. gns3server/schemas/compute/virtualbox_nodes.py +97 -0
  494. gns3server/schemas/compute/vmware_nodes.py +102 -0
  495. gns3server/schemas/compute/vpcs_nodes.py +68 -0
  496. gns3server/schemas/config.py +197 -0
  497. gns3server/schemas/controller/__init__.py +0 -0
  498. gns3server/schemas/controller/appliances.py +466 -0
  499. gns3server/schemas/controller/base.py +25 -0
  500. gns3server/schemas/controller/capabilities.py +34 -0
  501. gns3server/schemas/controller/computes.py +168 -0
  502. gns3server/schemas/controller/drawings.py +34 -0
  503. gns3server/schemas/controller/gns3vm.py +56 -0
  504. gns3server/schemas/controller/images.py +44 -0
  505. gns3server/schemas/controller/iou_license.py +23 -0
  506. gns3server/schemas/controller/labels.py +30 -0
  507. gns3server/schemas/controller/links.py +94 -0
  508. gns3server/schemas/controller/nodes.py +177 -0
  509. gns3server/schemas/controller/pools.py +81 -0
  510. gns3server/schemas/controller/projects.py +116 -0
  511. gns3server/schemas/controller/rbac.py +113 -0
  512. gns3server/schemas/controller/snapshots.py +42 -0
  513. gns3server/schemas/controller/templates/__init__.py +83 -0
  514. gns3server/schemas/controller/templates/cloud_templates.py +44 -0
  515. gns3server/schemas/controller/templates/docker_templates.py +59 -0
  516. gns3server/schemas/controller/templates/dynamips_templates.py +199 -0
  517. gns3server/schemas/controller/templates/ethernet_hub_templates.py +46 -0
  518. gns3server/schemas/controller/templates/ethernet_switch_templates.py +57 -0
  519. gns3server/schemas/controller/templates/iou_templates.py +47 -0
  520. gns3server/schemas/controller/templates/qemu_templates.py +94 -0
  521. gns3server/schemas/controller/templates/virtualbox_templates.py +64 -0
  522. gns3server/schemas/controller/templates/vmware_templates.py +61 -0
  523. gns3server/schemas/controller/templates/vpcs_templates.py +39 -0
  524. gns3server/schemas/controller/tokens.py +29 -0
  525. gns3server/schemas/controller/topology.py +82 -0
  526. gns3server/schemas/controller/users.py +105 -0
  527. gns3server/schemas/link.py +0 -0
  528. gns3server/schemas/qemu_disk_image.py +103 -0
  529. gns3server/schemas/version.py +25 -0
  530. gns3server/server.py +348 -0
  531. gns3server/services/__init__.py +19 -0
  532. gns3server/services/authentication.py +83 -0
  533. gns3server/services/computes.py +82 -0
  534. gns3server/services/templates.py +329 -0
  535. gns3server/static/.gitkeep +0 -0
  536. gns3server/static/favicon.ico +0 -0
  537. gns3server/static/redoc.standalone.js +1782 -0
  538. gns3server/static/swagger-ui-bundle.js +2 -0
  539. gns3server/static/swagger-ui.css +3 -0
  540. gns3server/static/web-ui/3rdpartylicenses.txt +2604 -0
  541. gns3server/static/web-ui/465.92c7ab880f2504d3.js +1 -0
  542. gns3server/static/web-ui/MaterialIcons-Regular.196fa4a92dd6fa73.ttf +0 -0
  543. gns3server/static/web-ui/MaterialIcons-Regular.1e50f5c2ffa6aba4.eot +0 -0
  544. gns3server/static/web-ui/MaterialIcons-Regular.7ea2023eeca07427.woff2 +0 -0
  545. gns3server/static/web-ui/MaterialIcons-Regular.db852539204b1a34.woff +0 -0
  546. gns3server/static/web-ui/NotoSans-Bold.635e9291df1a5a00.woff2 +0 -0
  547. gns3server/static/web-ui/NotoSans-Bold.885427cced6d8c94.woff +0 -0
  548. gns3server/static/web-ui/NotoSans-Bold.93203a43bc93ad9c.svg +8453 -0
  549. gns3server/static/web-ui/NotoSans-Bold.a7ab189a45f553b4.eot +0 -0
  550. gns3server/static/web-ui/NotoSans-Bold.e989c11744b36f58.ttf +0 -0
  551. gns3server/static/web-ui/NotoSans-BoldItalic.2baf33b639fc86a4.woff +0 -0
  552. gns3server/static/web-ui/NotoSans-BoldItalic.2eea9ba02e25c1d3.ttf +0 -0
  553. gns3server/static/web-ui/NotoSans-BoldItalic.46a5eec91da0d900.svg +8453 -0
  554. gns3server/static/web-ui/NotoSans-BoldItalic.7fdef73b477daa73.eot +0 -0
  555. gns3server/static/web-ui/NotoSans-BoldItalic.c62f70f121f271aa.woff2 +0 -0
  556. gns3server/static/web-ui/NotoSans-Italic.219ee88e5bc4e168.ttf +0 -0
  557. gns3server/static/web-ui/NotoSans-Italic.3d6f7cf772169c8d.svg +8453 -0
  558. gns3server/static/web-ui/NotoSans-Italic.77cd3818b5a2cb97.woff +0 -0
  559. gns3server/static/web-ui/NotoSans-Italic.85194585ae9d8c36.eot +0 -0
  560. gns3server/static/web-ui/NotoSans-Italic.eee02500e81db981.woff2 +0 -0
  561. gns3server/static/web-ui/NotoSans-Regular.156b7584192d70ed.eot +0 -0
  562. gns3server/static/web-ui/NotoSans-Regular.374d132a6803e279.woff2 +0 -0
  563. gns3server/static/web-ui/NotoSans-Regular.595e3f5876719740.woff +0 -0
  564. gns3server/static/web-ui/NotoSans-Regular.bb384defbe36eaec.svg +8453 -0
  565. gns3server/static/web-ui/NotoSans-Regular.e6139cb1663a1c57.ttf +0 -0
  566. gns3server/static/web-ui/ReleaseNotes.txt +179 -0
  567. gns3server/static/web-ui/assets/favicon.ico +0 -0
  568. gns3server/static/web-ui/assets/gns3_icon.svg +88 -0
  569. gns3server/static/web-ui/assets/gns3_icon_black.svg +88 -0
  570. gns3server/static/web-ui/assets/icons/mac/icon.icns +0 -0
  571. gns3server/static/web-ui/assets/icons/png/1024x1024.png +0 -0
  572. gns3server/static/web-ui/assets/icons/png/128x128.png +0 -0
  573. gns3server/static/web-ui/assets/icons/png/16x16.png +0 -0
  574. gns3server/static/web-ui/assets/icons/png/24x24.png +0 -0
  575. gns3server/static/web-ui/assets/icons/png/256x256.png +0 -0
  576. gns3server/static/web-ui/assets/icons/png/32x32.png +0 -0
  577. gns3server/static/web-ui/assets/icons/png/48x48.png +0 -0
  578. gns3server/static/web-ui/assets/icons/png/512x512.png +0 -0
  579. gns3server/static/web-ui/assets/icons/png/64x64.png +0 -0
  580. gns3server/static/web-ui/assets/icons/win/icon.ico +0 -0
  581. gns3server/static/web-ui/assets/logo-header.png +0 -0
  582. gns3server/static/web-ui/assets/resources/images/filter-capture.svg +428 -0
  583. gns3server/static/web-ui/assets/resources/images/filter.svg +708 -0
  584. gns3server/static/web-ui/assets/resources/images/inspect.svg +312 -0
  585. gns3server/static/web-ui/assets/resources/images/pause.svg +752 -0
  586. gns3server/static/web-ui/favicon.ico +0 -0
  587. gns3server/static/web-ui/index.html +51 -0
  588. gns3server/static/web-ui/main.f802edd2b8c6db1d.js +1 -0
  589. gns3server/static/web-ui/polyfills.319c79dd175e50d0.js +1 -0
  590. gns3server/static/web-ui/roboto-latin-100.539f0a96b40596f7.woff2 +0 -0
  591. gns3server/static/web-ui/roboto-latin-100.5ba994dac3e79ea8.woff +0 -0
  592. gns3server/static/web-ui/roboto-latin-100italic.41ba64219cb743c9.woff2 +0 -0
  593. gns3server/static/web-ui/roboto-latin-100italic.d61e7e8b07c0638c.woff +0 -0
  594. gns3server/static/web-ui/roboto-latin-300.4d8f8086236bad80.woff2 +0 -0
  595. gns3server/static/web-ui/roboto-latin-300.6c1bc461047e61f5.woff +0 -0
  596. gns3server/static/web-ui/roboto-latin-300italic.3a529751a590d3c1.woff +0 -0
  597. gns3server/static/web-ui/roboto-latin-300italic.45164643b3bd5824.woff2 +0 -0
  598. gns3server/static/web-ui/roboto-latin-400.1e2d4d3a272629cd.woff2 +0 -0
  599. gns3server/static/web-ui/roboto-latin-400.7e4a045b9373d9c1.woff +0 -0
  600. gns3server/static/web-ui/roboto-latin-400italic.68431199e5b90ea8.woff +0 -0
  601. gns3server/static/web-ui/roboto-latin-400italic.bb3c6955c4334c8a.woff2 +0 -0
  602. gns3server/static/web-ui/roboto-latin-500.1dfbc3dbf815e3f3.woff2 +0 -0
  603. gns3server/static/web-ui/roboto-latin-500.e21fe97fd2329ff7.woff +0 -0
  604. gns3server/static/web-ui/roboto-latin-500italic.7543a42b12b1452f.woff2 +0 -0
  605. gns3server/static/web-ui/roboto-latin-500italic.aaff6867154023d3.woff +0 -0
  606. gns3server/static/web-ui/roboto-latin-700.02633003129d1e63.woff +0 -0
  607. gns3server/static/web-ui/roboto-latin-700.12893bfc0762b0f3.woff2 +0 -0
  608. gns3server/static/web-ui/roboto-latin-700italic.bc7179e004e40113.woff2 +0 -0
  609. gns3server/static/web-ui/roboto-latin-700italic.e53062e27c63fafb.woff +0 -0
  610. gns3server/static/web-ui/roboto-latin-900.282ba77fda1349f3.woff2 +0 -0
  611. gns3server/static/web-ui/roboto-latin-900.4962e810cbb4d3e5.woff +0 -0
  612. gns3server/static/web-ui/roboto-latin-900italic.2394134a78bbaef8.woff +0 -0
  613. gns3server/static/web-ui/roboto-latin-900italic.9c1f80840351fa12.woff2 +0 -0
  614. gns3server/static/web-ui/runtime.24fa95b7061d7056.js +1 -0
  615. gns3server/static/web-ui/styles.6e966072487df0b7.css +5 -0
  616. gns3server/symbols/.gitkeep +0 -0
  617. gns3server/symbols/affinity/circle/blue/atm.svg +5 -0
  618. gns3server/symbols/affinity/circle/blue/bug.svg +8 -0
  619. gns3server/symbols/affinity/circle/blue/camera.svg +5 -0
  620. gns3server/symbols/affinity/circle/blue/camera_dome.svg +8 -0
  621. gns3server/symbols/affinity/circle/blue/client.svg +5 -0
  622. gns3server/symbols/affinity/circle/blue/client_vm.svg +6 -0
  623. gns3server/symbols/affinity/circle/blue/cloud.svg +5 -0
  624. gns3server/symbols/affinity/circle/blue/coffee.svg +6 -0
  625. gns3server/symbols/affinity/circle/blue/cog.svg +5 -0
  626. gns3server/symbols/affinity/circle/blue/communications.svg +5 -0
  627. gns3server/symbols/affinity/circle/blue/conversation.svg +12 -0
  628. gns3server/symbols/affinity/circle/blue/dna.svg +7 -0
  629. gns3server/symbols/affinity/circle/blue/dna2.svg +7 -0
  630. gns3server/symbols/affinity/circle/blue/docker.svg +11 -0
  631. gns3server/symbols/affinity/circle/blue/dslam.svg +5 -0
  632. gns3server/symbols/affinity/circle/blue/factory.svg +6 -0
  633. gns3server/symbols/affinity/circle/blue/fingerprint.svg +5 -0
  634. gns3server/symbols/affinity/circle/blue/firewall.svg +5 -0
  635. gns3server/symbols/affinity/circle/blue/firewall3.svg +5 -0
  636. gns3server/symbols/affinity/circle/blue/globe.svg +5 -0
  637. gns3server/symbols/affinity/circle/blue/grid.svg +5 -0
  638. gns3server/symbols/affinity/circle/blue/grid2.svg +5 -0
  639. gns3server/symbols/affinity/circle/blue/health.svg +5 -0
  640. gns3server/symbols/affinity/circle/blue/house.svg +9 -0
  641. gns3server/symbols/affinity/circle/blue/hub.svg +5 -0
  642. gns3server/symbols/affinity/circle/blue/inspect.svg +7 -0
  643. gns3server/symbols/affinity/circle/blue/inspect2.svg +6 -0
  644. gns3server/symbols/affinity/circle/blue/interconnect.svg +5 -0
  645. gns3server/symbols/affinity/circle/blue/ip_phone.svg +21 -0
  646. gns3server/symbols/affinity/circle/blue/isdn.svg +5 -0
  647. gns3server/symbols/affinity/circle/blue/laptop.svg +6 -0
  648. gns3server/symbols/affinity/circle/blue/ldap.svg +5 -0
  649. gns3server/symbols/affinity/circle/blue/light_bulb.svg +11 -0
  650. gns3server/symbols/affinity/circle/blue/link.svg +5 -0
  651. gns3server/symbols/affinity/circle/blue/loadbalancer.svg +5 -0
  652. gns3server/symbols/affinity/circle/blue/nas.svg +5 -0
  653. gns3server/symbols/affinity/circle/blue/nat.svg +60 -0
  654. gns3server/symbols/affinity/circle/blue/nat2.svg +55 -0
  655. gns3server/symbols/affinity/circle/blue/office.svg +5 -0
  656. gns3server/symbols/affinity/circle/blue/optical.svg +8 -0
  657. gns3server/symbols/affinity/circle/blue/phone_cloud.svg +6 -0
  658. gns3server/symbols/affinity/circle/blue/phone_old.svg +5 -0
  659. gns3server/symbols/affinity/circle/blue/phone_wireless.svg +8 -0
  660. gns3server/symbols/affinity/circle/blue/pinpoint.svg +5 -0
  661. gns3server/symbols/affinity/circle/blue/printer.svg +7 -0
  662. gns3server/symbols/affinity/circle/blue/rj45.svg +5 -0
  663. gns3server/symbols/affinity/circle/blue/router.svg +5 -0
  664. gns3server/symbols/affinity/circle/blue/router2.svg +5 -0
  665. gns3server/symbols/affinity/circle/blue/router_cloud.svg +6 -0
  666. gns3server/symbols/affinity/circle/blue/satellite.svg +6 -0
  667. gns3server/symbols/affinity/circle/blue/satellite_dish.svg +7 -0
  668. gns3server/symbols/affinity/circle/blue/scull.svg +8 -0
  669. gns3server/symbols/affinity/circle/blue/server.svg +5 -0
  670. gns3server/symbols/affinity/circle/blue/server_cluster.svg +7 -0
  671. gns3server/symbols/affinity/circle/blue/shield.svg +7 -0
  672. gns3server/symbols/affinity/circle/blue/statistics.svg +7 -0
  673. gns3server/symbols/affinity/circle/blue/storage.svg +5 -0
  674. gns3server/symbols/affinity/circle/blue/switch.svg +8 -0
  675. gns3server/symbols/affinity/circle/blue/switch_multilayer.svg +5 -0
  676. gns3server/symbols/affinity/circle/blue/tablet.svg +11 -0
  677. gns3server/symbols/affinity/circle/blue/template.svg +4 -0
  678. gns3server/symbols/affinity/circle/blue/tree.svg +5 -0
  679. gns3server/symbols/affinity/circle/blue/user.svg +7 -0
  680. gns3server/symbols/affinity/circle/blue/virtualbox.svg +7 -0
  681. gns3server/symbols/affinity/circle/blue/vm.svg +7 -0
  682. gns3server/symbols/affinity/circle/blue/vmware.svg +7 -0
  683. gns3server/symbols/affinity/circle/blue/vrf.svg +8 -0
  684. gns3server/symbols/affinity/circle/blue/wifi.svg +5 -0
  685. gns3server/symbols/affinity/circle/blue/wlc.svg +5 -0
  686. gns3server/symbols/affinity/circle/blue/xml.svg +5 -0
  687. gns3server/symbols/affinity/circle/gray/atm.svg +5 -0
  688. gns3server/symbols/affinity/circle/gray/bug.svg +8 -0
  689. gns3server/symbols/affinity/circle/gray/camera.svg +5 -0
  690. gns3server/symbols/affinity/circle/gray/camera_dome.svg +8 -0
  691. gns3server/symbols/affinity/circle/gray/client.svg +5 -0
  692. gns3server/symbols/affinity/circle/gray/client_vm.svg +6 -0
  693. gns3server/symbols/affinity/circle/gray/cloud.svg +5 -0
  694. gns3server/symbols/affinity/circle/gray/coffee.svg +6 -0
  695. gns3server/symbols/affinity/circle/gray/cog.svg +5 -0
  696. gns3server/symbols/affinity/circle/gray/communications.svg +5 -0
  697. gns3server/symbols/affinity/circle/gray/conversation.svg +12 -0
  698. gns3server/symbols/affinity/circle/gray/dna.svg +7 -0
  699. gns3server/symbols/affinity/circle/gray/dna2.svg +7 -0
  700. gns3server/symbols/affinity/circle/gray/docker.svg +11 -0
  701. gns3server/symbols/affinity/circle/gray/dslam.svg +5 -0
  702. gns3server/symbols/affinity/circle/gray/factory.svg +7 -0
  703. gns3server/symbols/affinity/circle/gray/fingerprint.svg +5 -0
  704. gns3server/symbols/affinity/circle/gray/firewall.svg +5 -0
  705. gns3server/symbols/affinity/circle/gray/firewall3.svg +5 -0
  706. gns3server/symbols/affinity/circle/gray/globe.svg +5 -0
  707. gns3server/symbols/affinity/circle/gray/grid.svg +5 -0
  708. gns3server/symbols/affinity/circle/gray/grid2.svg +5 -0
  709. gns3server/symbols/affinity/circle/gray/health.svg +5 -0
  710. gns3server/symbols/affinity/circle/gray/house.svg +9 -0
  711. gns3server/symbols/affinity/circle/gray/hub.svg +5 -0
  712. gns3server/symbols/affinity/circle/gray/inspect.svg +7 -0
  713. gns3server/symbols/affinity/circle/gray/inspect2.svg +6 -0
  714. gns3server/symbols/affinity/circle/gray/interconnect.svg +5 -0
  715. gns3server/symbols/affinity/circle/gray/ip_phone.svg +21 -0
  716. gns3server/symbols/affinity/circle/gray/isdn.svg +5 -0
  717. gns3server/symbols/affinity/circle/gray/laptop.svg +6 -0
  718. gns3server/symbols/affinity/circle/gray/ldap.svg +5 -0
  719. gns3server/symbols/affinity/circle/gray/light_bulb.svg +11 -0
  720. gns3server/symbols/affinity/circle/gray/link.svg +5 -0
  721. gns3server/symbols/affinity/circle/gray/loadbalancer.svg +5 -0
  722. gns3server/symbols/affinity/circle/gray/nas.svg +5 -0
  723. gns3server/symbols/affinity/circle/gray/nat.svg +60 -0
  724. gns3server/symbols/affinity/circle/gray/nat2.svg +55 -0
  725. gns3server/symbols/affinity/circle/gray/office.svg +5 -0
  726. gns3server/symbols/affinity/circle/gray/optical.svg +8 -0
  727. gns3server/symbols/affinity/circle/gray/phone_cloud.svg +6 -0
  728. gns3server/symbols/affinity/circle/gray/phone_old.svg +5 -0
  729. gns3server/symbols/affinity/circle/gray/phone_wireless.svg +8 -0
  730. gns3server/symbols/affinity/circle/gray/pinpoint.svg +5 -0
  731. gns3server/symbols/affinity/circle/gray/printer.svg +25 -0
  732. gns3server/symbols/affinity/circle/gray/rj45.svg +5 -0
  733. gns3server/symbols/affinity/circle/gray/router.svg +5 -0
  734. gns3server/symbols/affinity/circle/gray/router2.svg +5 -0
  735. gns3server/symbols/affinity/circle/gray/router_cloud.svg +6 -0
  736. gns3server/symbols/affinity/circle/gray/satellite.svg +6 -0
  737. gns3server/symbols/affinity/circle/gray/satellite_dish.svg +7 -0
  738. gns3server/symbols/affinity/circle/gray/scull.svg +8 -0
  739. gns3server/symbols/affinity/circle/gray/server.svg +5 -0
  740. gns3server/symbols/affinity/circle/gray/server_cluster.svg +7 -0
  741. gns3server/symbols/affinity/circle/gray/shield.svg +7 -0
  742. gns3server/symbols/affinity/circle/gray/statistics.svg +7 -0
  743. gns3server/symbols/affinity/circle/gray/storage.svg +5 -0
  744. gns3server/symbols/affinity/circle/gray/switch.svg +8 -0
  745. gns3server/symbols/affinity/circle/gray/switch_multilayer.svg +5 -0
  746. gns3server/symbols/affinity/circle/gray/tablet.svg +11 -0
  747. gns3server/symbols/affinity/circle/gray/template.svg +4 -0
  748. gns3server/symbols/affinity/circle/gray/tree.svg +5 -0
  749. gns3server/symbols/affinity/circle/gray/user.svg +7 -0
  750. gns3server/symbols/affinity/circle/gray/virtualbox.svg +7 -0
  751. gns3server/symbols/affinity/circle/gray/vm.svg +7 -0
  752. gns3server/symbols/affinity/circle/gray/vmware.svg +7 -0
  753. gns3server/symbols/affinity/circle/gray/vrf.svg +8 -0
  754. gns3server/symbols/affinity/circle/gray/wifi.svg +5 -0
  755. gns3server/symbols/affinity/circle/gray/wlc.svg +5 -0
  756. gns3server/symbols/affinity/circle/gray/xml.svg +5 -0
  757. gns3server/symbols/affinity/circle/green/atm.svg +5 -0
  758. gns3server/symbols/affinity/circle/green/bug.svg +8 -0
  759. gns3server/symbols/affinity/circle/green/camera.svg +5 -0
  760. gns3server/symbols/affinity/circle/green/camera_dome.svg +8 -0
  761. gns3server/symbols/affinity/circle/green/client.svg +5 -0
  762. gns3server/symbols/affinity/circle/green/client_vm.svg +6 -0
  763. gns3server/symbols/affinity/circle/green/cloud.svg +5 -0
  764. gns3server/symbols/affinity/circle/green/coffee.svg +6 -0
  765. gns3server/symbols/affinity/circle/green/cog.svg +5 -0
  766. gns3server/symbols/affinity/circle/green/communications.svg +5 -0
  767. gns3server/symbols/affinity/circle/green/conversation.svg +12 -0
  768. gns3server/symbols/affinity/circle/green/dna.svg +7 -0
  769. gns3server/symbols/affinity/circle/green/dna2.svg +7 -0
  770. gns3server/symbols/affinity/circle/green/docker.svg +11 -0
  771. gns3server/symbols/affinity/circle/green/dslam.svg +5 -0
  772. gns3server/symbols/affinity/circle/green/factory.svg +6 -0
  773. gns3server/symbols/affinity/circle/green/fingerprint.svg +5 -0
  774. gns3server/symbols/affinity/circle/green/firewall.svg +5 -0
  775. gns3server/symbols/affinity/circle/green/firewall3.svg +5 -0
  776. gns3server/symbols/affinity/circle/green/globe.svg +5 -0
  777. gns3server/symbols/affinity/circle/green/grid.svg +5 -0
  778. gns3server/symbols/affinity/circle/green/grid2.svg +5 -0
  779. gns3server/symbols/affinity/circle/green/health.svg +5 -0
  780. gns3server/symbols/affinity/circle/green/house.svg +9 -0
  781. gns3server/symbols/affinity/circle/green/hub.svg +5 -0
  782. gns3server/symbols/affinity/circle/green/inspect.svg +7 -0
  783. gns3server/symbols/affinity/circle/green/inspect2.svg +6 -0
  784. gns3server/symbols/affinity/circle/green/interconnect.svg +5 -0
  785. gns3server/symbols/affinity/circle/green/ip_phone.svg +21 -0
  786. gns3server/symbols/affinity/circle/green/isdn.svg +5 -0
  787. gns3server/symbols/affinity/circle/green/laptop.svg +6 -0
  788. gns3server/symbols/affinity/circle/green/ldap.svg +5 -0
  789. gns3server/symbols/affinity/circle/green/light_bulb.svg +11 -0
  790. gns3server/symbols/affinity/circle/green/link.svg +5 -0
  791. gns3server/symbols/affinity/circle/green/loadbalancer.svg +5 -0
  792. gns3server/symbols/affinity/circle/green/nas.svg +5 -0
  793. gns3server/symbols/affinity/circle/green/nat.svg +60 -0
  794. gns3server/symbols/affinity/circle/green/nat2.svg +55 -0
  795. gns3server/symbols/affinity/circle/green/office.svg +5 -0
  796. gns3server/symbols/affinity/circle/green/optical.svg +8 -0
  797. gns3server/symbols/affinity/circle/green/phone_cloud.svg +6 -0
  798. gns3server/symbols/affinity/circle/green/phone_old.svg +5 -0
  799. gns3server/symbols/affinity/circle/green/phone_wireless.svg +8 -0
  800. gns3server/symbols/affinity/circle/green/pinpoint.svg +5 -0
  801. gns3server/symbols/affinity/circle/green/printer.svg +7 -0
  802. gns3server/symbols/affinity/circle/green/rj45.svg +5 -0
  803. gns3server/symbols/affinity/circle/green/router.svg +5 -0
  804. gns3server/symbols/affinity/circle/green/router2.svg +5 -0
  805. gns3server/symbols/affinity/circle/green/router_cloud.svg +6 -0
  806. gns3server/symbols/affinity/circle/green/satellite.svg +6 -0
  807. gns3server/symbols/affinity/circle/green/satellite_dish.svg +7 -0
  808. gns3server/symbols/affinity/circle/green/scull.svg +8 -0
  809. gns3server/symbols/affinity/circle/green/server.svg +5 -0
  810. gns3server/symbols/affinity/circle/green/server_cluster.svg +7 -0
  811. gns3server/symbols/affinity/circle/green/shield.svg +7 -0
  812. gns3server/symbols/affinity/circle/green/statistics.svg +7 -0
  813. gns3server/symbols/affinity/circle/green/storage.svg +5 -0
  814. gns3server/symbols/affinity/circle/green/switch.svg +8 -0
  815. gns3server/symbols/affinity/circle/green/switch_multilayer.svg +5 -0
  816. gns3server/symbols/affinity/circle/green/tablet.svg +11 -0
  817. gns3server/symbols/affinity/circle/green/template.svg +4 -0
  818. gns3server/symbols/affinity/circle/green/tree.svg +5 -0
  819. gns3server/symbols/affinity/circle/green/user.svg +7 -0
  820. gns3server/symbols/affinity/circle/green/virtualbox.svg +7 -0
  821. gns3server/symbols/affinity/circle/green/vm.svg +7 -0
  822. gns3server/symbols/affinity/circle/green/vmware.svg +7 -0
  823. gns3server/symbols/affinity/circle/green/vrf.svg +8 -0
  824. gns3server/symbols/affinity/circle/green/wifi.svg +5 -0
  825. gns3server/symbols/affinity/circle/green/wlc.svg +5 -0
  826. gns3server/symbols/affinity/circle/green/xml.svg +5 -0
  827. gns3server/symbols/affinity/circle/red/atm.svg +5 -0
  828. gns3server/symbols/affinity/circle/red/bug.svg +8 -0
  829. gns3server/symbols/affinity/circle/red/camera.svg +5 -0
  830. gns3server/symbols/affinity/circle/red/camera_dome.svg +8 -0
  831. gns3server/symbols/affinity/circle/red/client.svg +5 -0
  832. gns3server/symbols/affinity/circle/red/client_vm.svg +6 -0
  833. gns3server/symbols/affinity/circle/red/cloud.svg +5 -0
  834. gns3server/symbols/affinity/circle/red/coffee.svg +6 -0
  835. gns3server/symbols/affinity/circle/red/cog.svg +5 -0
  836. gns3server/symbols/affinity/circle/red/communications.svg +5 -0
  837. gns3server/symbols/affinity/circle/red/conversation.svg +12 -0
  838. gns3server/symbols/affinity/circle/red/dna.svg +7 -0
  839. gns3server/symbols/affinity/circle/red/dna2.svg +7 -0
  840. gns3server/symbols/affinity/circle/red/docker.svg +11 -0
  841. gns3server/symbols/affinity/circle/red/dslam.svg +5 -0
  842. gns3server/symbols/affinity/circle/red/factory.svg +6 -0
  843. gns3server/symbols/affinity/circle/red/fingerprint.svg +5 -0
  844. gns3server/symbols/affinity/circle/red/firewall.svg +5 -0
  845. gns3server/symbols/affinity/circle/red/firewall3.svg +5 -0
  846. gns3server/symbols/affinity/circle/red/globe.svg +5 -0
  847. gns3server/symbols/affinity/circle/red/grid.svg +5 -0
  848. gns3server/symbols/affinity/circle/red/grid2.svg +5 -0
  849. gns3server/symbols/affinity/circle/red/health.svg +5 -0
  850. gns3server/symbols/affinity/circle/red/house.svg +9 -0
  851. gns3server/symbols/affinity/circle/red/hub.svg +5 -0
  852. gns3server/symbols/affinity/circle/red/inspect.svg +7 -0
  853. gns3server/symbols/affinity/circle/red/inspect2.svg +6 -0
  854. gns3server/symbols/affinity/circle/red/interconnect.svg +5 -0
  855. gns3server/symbols/affinity/circle/red/ip_phone.svg +21 -0
  856. gns3server/symbols/affinity/circle/red/isdn.svg +5 -0
  857. gns3server/symbols/affinity/circle/red/laptop.svg +6 -0
  858. gns3server/symbols/affinity/circle/red/ldap.svg +5 -0
  859. gns3server/symbols/affinity/circle/red/light_bulb.svg +11 -0
  860. gns3server/symbols/affinity/circle/red/link.svg +5 -0
  861. gns3server/symbols/affinity/circle/red/loadbalancer.svg +5 -0
  862. gns3server/symbols/affinity/circle/red/nas.svg +5 -0
  863. gns3server/symbols/affinity/circle/red/nat.svg +60 -0
  864. gns3server/symbols/affinity/circle/red/nat2.svg +55 -0
  865. gns3server/symbols/affinity/circle/red/office.svg +5 -0
  866. gns3server/symbols/affinity/circle/red/optical.svg +8 -0
  867. gns3server/symbols/affinity/circle/red/phone_cloud.svg +6 -0
  868. gns3server/symbols/affinity/circle/red/phone_old.svg +5 -0
  869. gns3server/symbols/affinity/circle/red/phone_wireless.svg +8 -0
  870. gns3server/symbols/affinity/circle/red/pinpoint.svg +5 -0
  871. gns3server/symbols/affinity/circle/red/printer.svg +7 -0
  872. gns3server/symbols/affinity/circle/red/rj45.svg +5 -0
  873. gns3server/symbols/affinity/circle/red/router.svg +5 -0
  874. gns3server/symbols/affinity/circle/red/router2.svg +5 -0
  875. gns3server/symbols/affinity/circle/red/router_cloud.svg +6 -0
  876. gns3server/symbols/affinity/circle/red/satellite.svg +6 -0
  877. gns3server/symbols/affinity/circle/red/satellite_dish.svg +7 -0
  878. gns3server/symbols/affinity/circle/red/scull.svg +8 -0
  879. gns3server/symbols/affinity/circle/red/server.svg +5 -0
  880. gns3server/symbols/affinity/circle/red/server_cluster.svg +7 -0
  881. gns3server/symbols/affinity/circle/red/shield.svg +7 -0
  882. gns3server/symbols/affinity/circle/red/statistics.svg +7 -0
  883. gns3server/symbols/affinity/circle/red/storage.svg +5 -0
  884. gns3server/symbols/affinity/circle/red/switch.svg +8 -0
  885. gns3server/symbols/affinity/circle/red/switch_multilayer.svg +5 -0
  886. gns3server/symbols/affinity/circle/red/tablet.svg +11 -0
  887. gns3server/symbols/affinity/circle/red/template.svg +4 -0
  888. gns3server/symbols/affinity/circle/red/tree.svg +5 -0
  889. gns3server/symbols/affinity/circle/red/user.svg +7 -0
  890. gns3server/symbols/affinity/circle/red/virtualbox.svg +7 -0
  891. gns3server/symbols/affinity/circle/red/vm.svg +7 -0
  892. gns3server/symbols/affinity/circle/red/vmware.svg +7 -0
  893. gns3server/symbols/affinity/circle/red/vrf.svg +8 -0
  894. gns3server/symbols/affinity/circle/red/wifi.svg +5 -0
  895. gns3server/symbols/affinity/circle/red/wlc.svg +5 -0
  896. gns3server/symbols/affinity/circle/red/xml.svg +5 -0
  897. gns3server/symbols/affinity/square/blue/atm.svg +5 -0
  898. gns3server/symbols/affinity/square/blue/bug.svg +5 -0
  899. gns3server/symbols/affinity/square/blue/camera.svg +12 -0
  900. gns3server/symbols/affinity/square/blue/camera_dome.svg +8 -0
  901. gns3server/symbols/affinity/square/blue/client.svg +8 -0
  902. gns3server/symbols/affinity/square/blue/client_vm.svg +8 -0
  903. gns3server/symbols/affinity/square/blue/cloud.svg +12 -0
  904. gns3server/symbols/affinity/square/blue/coffee.svg +5 -0
  905. gns3server/symbols/affinity/square/blue/cog.svg +8 -0
  906. gns3server/symbols/affinity/square/blue/communications.svg +8 -0
  907. gns3server/symbols/affinity/square/blue/conversation.svg +12 -0
  908. gns3server/symbols/affinity/square/blue/dna.svg +7 -0
  909. gns3server/symbols/affinity/square/blue/dna2.svg +7 -0
  910. gns3server/symbols/affinity/square/blue/docker.svg +11 -0
  911. gns3server/symbols/affinity/square/blue/dslam.svg +8 -0
  912. gns3server/symbols/affinity/square/blue/factory.svg +5 -0
  913. gns3server/symbols/affinity/square/blue/fingerprint.svg +9 -0
  914. gns3server/symbols/affinity/square/blue/firewall.svg +7 -0
  915. gns3server/symbols/affinity/square/blue/firewall3.svg +6 -0
  916. gns3server/symbols/affinity/square/blue/globe.svg +5 -0
  917. gns3server/symbols/affinity/square/blue/grid.svg +7 -0
  918. gns3server/symbols/affinity/square/blue/grid2.svg +7 -0
  919. gns3server/symbols/affinity/square/blue/health.svg +5 -0
  920. gns3server/symbols/affinity/square/blue/house.svg +6 -0
  921. gns3server/symbols/affinity/square/blue/hub.svg +7 -0
  922. gns3server/symbols/affinity/square/blue/inspect.svg +5 -0
  923. gns3server/symbols/affinity/square/blue/inspect2.svg +9 -0
  924. gns3server/symbols/affinity/square/blue/interconnect.svg +8 -0
  925. gns3server/symbols/affinity/square/blue/ip_phone.svg +23 -0
  926. gns3server/symbols/affinity/square/blue/isdn.svg +7 -0
  927. gns3server/symbols/affinity/square/blue/laptop.svg +8 -0
  928. gns3server/symbols/affinity/square/blue/ldap.svg +5 -0
  929. gns3server/symbols/affinity/square/blue/light_bulb.svg +11 -0
  930. gns3server/symbols/affinity/square/blue/link.svg +5 -0
  931. gns3server/symbols/affinity/square/blue/loadbalancer.svg +5 -0
  932. gns3server/symbols/affinity/square/blue/nas.svg +7 -0
  933. gns3server/symbols/affinity/square/blue/nat.svg +58 -0
  934. gns3server/symbols/affinity/square/blue/nat2.svg +74 -0
  935. gns3server/symbols/affinity/square/blue/office.svg +5 -0
  936. gns3server/symbols/affinity/square/blue/optical.svg +8 -0
  937. gns3server/symbols/affinity/square/blue/phone_cloud.svg +8 -0
  938. gns3server/symbols/affinity/square/blue/phone_old.svg +7 -0
  939. gns3server/symbols/affinity/square/blue/phone_wireless.svg +10 -0
  940. gns3server/symbols/affinity/square/blue/pinpoint.svg +9 -0
  941. gns3server/symbols/affinity/square/blue/printer.svg +27 -0
  942. gns3server/symbols/affinity/square/blue/rj45.svg +14 -0
  943. gns3server/symbols/affinity/square/blue/router.svg +7 -0
  944. gns3server/symbols/affinity/square/blue/router2.svg +5 -0
  945. gns3server/symbols/affinity/square/blue/router_cloud.svg +7 -0
  946. gns3server/symbols/affinity/square/blue/satellite.svg +8 -0
  947. gns3server/symbols/affinity/square/blue/satellite_dish.svg +7 -0
  948. gns3server/symbols/affinity/square/blue/scull.svg +10 -0
  949. gns3server/symbols/affinity/square/blue/server.svg +5 -0
  950. gns3server/symbols/affinity/square/blue/server_cluster.svg +9 -0
  951. gns3server/symbols/affinity/square/blue/shield.svg +5 -0
  952. gns3server/symbols/affinity/square/blue/statistics.svg +7 -0
  953. gns3server/symbols/affinity/square/blue/storage.svg +7 -0
  954. gns3server/symbols/affinity/square/blue/switch.svg +10 -0
  955. gns3server/symbols/affinity/square/blue/switch_multilayer.svg +8 -0
  956. gns3server/symbols/affinity/square/blue/tablet.svg +9 -0
  957. gns3server/symbols/affinity/square/blue/template.svg +4 -0
  958. gns3server/symbols/affinity/square/blue/tree.svg +5 -0
  959. gns3server/symbols/affinity/square/blue/user.svg +7 -0
  960. gns3server/symbols/affinity/square/blue/virtualbox.svg +7 -0
  961. gns3server/symbols/affinity/square/blue/vm.svg +7 -0
  962. gns3server/symbols/affinity/square/blue/vmware.svg +7 -0
  963. gns3server/symbols/affinity/square/blue/vrf.svg +5 -0
  964. gns3server/symbols/affinity/square/blue/wifi.svg +13 -0
  965. gns3server/symbols/affinity/square/blue/wlc.svg +7 -0
  966. gns3server/symbols/affinity/square/blue/xml.svg +10 -0
  967. gns3server/symbols/affinity/square/gray/atm.svg +5 -0
  968. gns3server/symbols/affinity/square/gray/bug.svg +5 -0
  969. gns3server/symbols/affinity/square/gray/camera.svg +12 -0
  970. gns3server/symbols/affinity/square/gray/camera_dome.svg +8 -0
  971. gns3server/symbols/affinity/square/gray/client.svg +8 -0
  972. gns3server/symbols/affinity/square/gray/client_vm.svg +8 -0
  973. gns3server/symbols/affinity/square/gray/cloud.svg +12 -0
  974. gns3server/symbols/affinity/square/gray/coffee.svg +5 -0
  975. gns3server/symbols/affinity/square/gray/cog.svg +8 -0
  976. gns3server/symbols/affinity/square/gray/communications.svg +8 -0
  977. gns3server/symbols/affinity/square/gray/conversation.svg +12 -0
  978. gns3server/symbols/affinity/square/gray/dna.svg +7 -0
  979. gns3server/symbols/affinity/square/gray/dna2.svg +7 -0
  980. gns3server/symbols/affinity/square/gray/docker.svg +11 -0
  981. gns3server/symbols/affinity/square/gray/dslam.svg +8 -0
  982. gns3server/symbols/affinity/square/gray/factory.svg +5 -0
  983. gns3server/symbols/affinity/square/gray/fingerprint.svg +9 -0
  984. gns3server/symbols/affinity/square/gray/firewall.svg +7 -0
  985. gns3server/symbols/affinity/square/gray/firewall3.svg +6 -0
  986. gns3server/symbols/affinity/square/gray/globe.svg +5 -0
  987. gns3server/symbols/affinity/square/gray/grid.svg +7 -0
  988. gns3server/symbols/affinity/square/gray/grid2.svg +7 -0
  989. gns3server/symbols/affinity/square/gray/health.svg +5 -0
  990. gns3server/symbols/affinity/square/gray/house.svg +6 -0
  991. gns3server/symbols/affinity/square/gray/hub.svg +7 -0
  992. gns3server/symbols/affinity/square/gray/inspect.svg +5 -0
  993. gns3server/symbols/affinity/square/gray/inspect2.svg +9 -0
  994. gns3server/symbols/affinity/square/gray/interconnect.svg +8 -0
  995. gns3server/symbols/affinity/square/gray/ip_phone.svg +23 -0
  996. gns3server/symbols/affinity/square/gray/isdn.svg +7 -0
  997. gns3server/symbols/affinity/square/gray/laptop.svg +8 -0
  998. gns3server/symbols/affinity/square/gray/ldap.svg +5 -0
  999. gns3server/symbols/affinity/square/gray/light_bulb.svg +11 -0
  1000. gns3server/symbols/affinity/square/gray/link.svg +5 -0
  1001. gns3server/symbols/affinity/square/gray/loadbalancer.svg +5 -0
  1002. gns3server/symbols/affinity/square/gray/nas.svg +7 -0
  1003. gns3server/symbols/affinity/square/gray/nat.svg +58 -0
  1004. gns3server/symbols/affinity/square/gray/nat2.svg +74 -0
  1005. gns3server/symbols/affinity/square/gray/office.svg +5 -0
  1006. gns3server/symbols/affinity/square/gray/optical.svg +8 -0
  1007. gns3server/symbols/affinity/square/gray/phone_cloud.svg +8 -0
  1008. gns3server/symbols/affinity/square/gray/phone_old.svg +7 -0
  1009. gns3server/symbols/affinity/square/gray/phone_wireless.svg +10 -0
  1010. gns3server/symbols/affinity/square/gray/pinpoint.svg +9 -0
  1011. gns3server/symbols/affinity/square/gray/printer.svg +27 -0
  1012. gns3server/symbols/affinity/square/gray/rj45.svg +14 -0
  1013. gns3server/symbols/affinity/square/gray/router.svg +7 -0
  1014. gns3server/symbols/affinity/square/gray/router2.svg +5 -0
  1015. gns3server/symbols/affinity/square/gray/router_cloud.svg +7 -0
  1016. gns3server/symbols/affinity/square/gray/satellite.svg +8 -0
  1017. gns3server/symbols/affinity/square/gray/satellite_dish.svg +7 -0
  1018. gns3server/symbols/affinity/square/gray/scull.svg +10 -0
  1019. gns3server/symbols/affinity/square/gray/server.svg +5 -0
  1020. gns3server/symbols/affinity/square/gray/server_cluster.svg +9 -0
  1021. gns3server/symbols/affinity/square/gray/shield.svg +5 -0
  1022. gns3server/symbols/affinity/square/gray/statistics.svg +7 -0
  1023. gns3server/symbols/affinity/square/gray/storage.svg +5 -0
  1024. gns3server/symbols/affinity/square/gray/switch.svg +10 -0
  1025. gns3server/symbols/affinity/square/gray/switch_multilayer.svg +9 -0
  1026. gns3server/symbols/affinity/square/gray/tablet.svg +9 -0
  1027. gns3server/symbols/affinity/square/gray/template.svg +4 -0
  1028. gns3server/symbols/affinity/square/gray/tree.svg +5 -0
  1029. gns3server/symbols/affinity/square/gray/user.svg +7 -0
  1030. gns3server/symbols/affinity/square/gray/virtualbox.svg +7 -0
  1031. gns3server/symbols/affinity/square/gray/vm.svg +7 -0
  1032. gns3server/symbols/affinity/square/gray/vmware.svg +7 -0
  1033. gns3server/symbols/affinity/square/gray/vrf.svg +5 -0
  1034. gns3server/symbols/affinity/square/gray/wifi.svg +13 -0
  1035. gns3server/symbols/affinity/square/gray/wlc.svg +7 -0
  1036. gns3server/symbols/affinity/square/gray/xml.svg +10 -0
  1037. gns3server/symbols/affinity/square/green/atm.svg +5 -0
  1038. gns3server/symbols/affinity/square/green/bug.svg +5 -0
  1039. gns3server/symbols/affinity/square/green/camera.svg +5 -0
  1040. gns3server/symbols/affinity/square/green/camera_dome.svg +8 -0
  1041. gns3server/symbols/affinity/square/green/client.svg +5 -0
  1042. gns3server/symbols/affinity/square/green/client_vm.svg +6 -0
  1043. gns3server/symbols/affinity/square/green/cloud.svg +12 -0
  1044. gns3server/symbols/affinity/square/green/coffee.svg +5 -0
  1045. gns3server/symbols/affinity/square/green/cog.svg +5 -0
  1046. gns3server/symbols/affinity/square/green/communications.svg +5 -0
  1047. gns3server/symbols/affinity/square/green/conversation.svg +12 -0
  1048. gns3server/symbols/affinity/square/green/dna.svg +7 -0
  1049. gns3server/symbols/affinity/square/green/dna2.svg +7 -0
  1050. gns3server/symbols/affinity/square/green/docker.svg +11 -0
  1051. gns3server/symbols/affinity/square/green/dslam.svg +5 -0
  1052. gns3server/symbols/affinity/square/green/factory.svg +5 -0
  1053. gns3server/symbols/affinity/square/green/fingerprint.svg +5 -0
  1054. gns3server/symbols/affinity/square/green/firewall.svg +5 -0
  1055. gns3server/symbols/affinity/square/green/firewall3.svg +5 -0
  1056. gns3server/symbols/affinity/square/green/globe.svg +5 -0
  1057. gns3server/symbols/affinity/square/green/grid.svg +5 -0
  1058. gns3server/symbols/affinity/square/green/grid2.svg +5 -0
  1059. gns3server/symbols/affinity/square/green/health.svg +5 -0
  1060. gns3server/symbols/affinity/square/green/house.svg +6 -0
  1061. gns3server/symbols/affinity/square/green/hub.svg +5 -0
  1062. gns3server/symbols/affinity/square/green/inspect.svg +5 -0
  1063. gns3server/symbols/affinity/square/green/inspect2.svg +5 -0
  1064. gns3server/symbols/affinity/square/green/interconnect.svg +5 -0
  1065. gns3server/symbols/affinity/square/green/ip_phone.svg +7 -0
  1066. gns3server/symbols/affinity/square/green/isdn.svg +5 -0
  1067. gns3server/symbols/affinity/square/green/laptop.svg +8 -0
  1068. gns3server/symbols/affinity/square/green/ldap.svg +5 -0
  1069. gns3server/symbols/affinity/square/green/light_bulb.svg +5 -0
  1070. gns3server/symbols/affinity/square/green/link.svg +5 -0
  1071. gns3server/symbols/affinity/square/green/loadbalancer.svg +5 -0
  1072. gns3server/symbols/affinity/square/green/nas.svg +5 -0
  1073. gns3server/symbols/affinity/square/green/nat.svg +58 -0
  1074. gns3server/symbols/affinity/square/green/nat2.svg +74 -0
  1075. gns3server/symbols/affinity/square/green/office.svg +5 -0
  1076. gns3server/symbols/affinity/square/green/optical.svg +8 -0
  1077. gns3server/symbols/affinity/square/green/phone_cloud.svg +6 -0
  1078. gns3server/symbols/affinity/square/green/phone_old.svg +5 -0
  1079. gns3server/symbols/affinity/square/green/phone_wireless.svg +5 -0
  1080. gns3server/symbols/affinity/square/green/pinpoint.svg +5 -0
  1081. gns3server/symbols/affinity/square/green/printer.svg +27 -0
  1082. gns3server/symbols/affinity/square/green/rj45.svg +5 -0
  1083. gns3server/symbols/affinity/square/green/router.svg +5 -0
  1084. gns3server/symbols/affinity/square/green/router2.svg +5 -0
  1085. gns3server/symbols/affinity/square/green/router_cloud.svg +6 -0
  1086. gns3server/symbols/affinity/square/green/satellite.svg +5 -0
  1087. gns3server/symbols/affinity/square/green/satellite_dish.svg +5 -0
  1088. gns3server/symbols/affinity/square/green/scull.svg +8 -0
  1089. gns3server/symbols/affinity/square/green/server.svg +5 -0
  1090. gns3server/symbols/affinity/square/green/server_cluster.svg +7 -0
  1091. gns3server/symbols/affinity/square/green/shield.svg +5 -0
  1092. gns3server/symbols/affinity/square/green/statistics.svg +5 -0
  1093. gns3server/symbols/affinity/square/green/storage.svg +5 -0
  1094. gns3server/symbols/affinity/square/green/switch.svg +10 -0
  1095. gns3server/symbols/affinity/square/green/switch_multilayer.svg +5 -0
  1096. gns3server/symbols/affinity/square/green/tablet.svg +9 -0
  1097. gns3server/symbols/affinity/square/green/template.svg +4 -0
  1098. gns3server/symbols/affinity/square/green/tree.svg +5 -0
  1099. gns3server/symbols/affinity/square/green/user.svg +7 -0
  1100. gns3server/symbols/affinity/square/green/virtualbox.svg +7 -0
  1101. gns3server/symbols/affinity/square/green/vm.svg +7 -0
  1102. gns3server/symbols/affinity/square/green/vmware.svg +7 -0
  1103. gns3server/symbols/affinity/square/green/vrf.svg +5 -0
  1104. gns3server/symbols/affinity/square/green/wifi.svg +5 -0
  1105. gns3server/symbols/affinity/square/green/wlc.svg +5 -0
  1106. gns3server/symbols/affinity/square/green/xml.svg +5 -0
  1107. gns3server/symbols/affinity/square/red/atm.svg +5 -0
  1108. gns3server/symbols/affinity/square/red/bug.svg +5 -0
  1109. gns3server/symbols/affinity/square/red/camera.svg +12 -0
  1110. gns3server/symbols/affinity/square/red/camera_dome.svg +8 -0
  1111. gns3server/symbols/affinity/square/red/client.svg +8 -0
  1112. gns3server/symbols/affinity/square/red/client_vm.svg +8 -0
  1113. gns3server/symbols/affinity/square/red/cloud.svg +12 -0
  1114. gns3server/symbols/affinity/square/red/coffee.svg +5 -0
  1115. gns3server/symbols/affinity/square/red/cog.svg +8 -0
  1116. gns3server/symbols/affinity/square/red/communications.svg +8 -0
  1117. gns3server/symbols/affinity/square/red/conversation.svg +12 -0
  1118. gns3server/symbols/affinity/square/red/dna.svg +7 -0
  1119. gns3server/symbols/affinity/square/red/dna2.svg +7 -0
  1120. gns3server/symbols/affinity/square/red/docker.svg +11 -0
  1121. gns3server/symbols/affinity/square/red/dslam.svg +8 -0
  1122. gns3server/symbols/affinity/square/red/factory.svg +5 -0
  1123. gns3server/symbols/affinity/square/red/fingerprint.svg +9 -0
  1124. gns3server/symbols/affinity/square/red/firewall.svg +7 -0
  1125. gns3server/symbols/affinity/square/red/firewall3.svg +5 -0
  1126. gns3server/symbols/affinity/square/red/globe.svg +5 -0
  1127. gns3server/symbols/affinity/square/red/grid.svg +7 -0
  1128. gns3server/symbols/affinity/square/red/grid2.svg +7 -0
  1129. gns3server/symbols/affinity/square/red/health.svg +5 -0
  1130. gns3server/symbols/affinity/square/red/house.svg +6 -0
  1131. gns3server/symbols/affinity/square/red/hub.svg +7 -0
  1132. gns3server/symbols/affinity/square/red/inspect.svg +5 -0
  1133. gns3server/symbols/affinity/square/red/inspect2.svg +9 -0
  1134. gns3server/symbols/affinity/square/red/interconnect.svg +8 -0
  1135. gns3server/symbols/affinity/square/red/ip_phone.svg +7 -0
  1136. gns3server/symbols/affinity/square/red/isdn.svg +7 -0
  1137. gns3server/symbols/affinity/square/red/laptop.svg +8 -0
  1138. gns3server/symbols/affinity/square/red/ldap.svg +5 -0
  1139. gns3server/symbols/affinity/square/red/light_bulb.svg +5 -0
  1140. gns3server/symbols/affinity/square/red/link.svg +5 -0
  1141. gns3server/symbols/affinity/square/red/loadbalancer.svg +5 -0
  1142. gns3server/symbols/affinity/square/red/nas.svg +7 -0
  1143. gns3server/symbols/affinity/square/red/nat.svg +58 -0
  1144. gns3server/symbols/affinity/square/red/nat2.svg +74 -0
  1145. gns3server/symbols/affinity/square/red/office.svg +5 -0
  1146. gns3server/symbols/affinity/square/red/optical.svg +8 -0
  1147. gns3server/symbols/affinity/square/red/phone_cloud.svg +6 -0
  1148. gns3server/symbols/affinity/square/red/phone_old.svg +5 -0
  1149. gns3server/symbols/affinity/square/red/phone_wireless.svg +5 -0
  1150. gns3server/symbols/affinity/square/red/pinpoint.svg +9 -0
  1151. gns3server/symbols/affinity/square/red/printer.svg +27 -0
  1152. gns3server/symbols/affinity/square/red/rj45.svg +14 -0
  1153. gns3server/symbols/affinity/square/red/router.svg +7 -0
  1154. gns3server/symbols/affinity/square/red/router2.svg +5 -0
  1155. gns3server/symbols/affinity/square/red/router_cloud.svg +6 -0
  1156. gns3server/symbols/affinity/square/red/satellite.svg +8 -0
  1157. gns3server/symbols/affinity/square/red/satellite_dish.svg +5 -0
  1158. gns3server/symbols/affinity/square/red/scull.svg +10 -0
  1159. gns3server/symbols/affinity/square/red/server.svg +5 -0
  1160. gns3server/symbols/affinity/square/red/server_cluster.svg +9 -0
  1161. gns3server/symbols/affinity/square/red/shield.svg +5 -0
  1162. gns3server/symbols/affinity/square/red/statistics.svg +5 -0
  1163. gns3server/symbols/affinity/square/red/storage.svg +7 -0
  1164. gns3server/symbols/affinity/square/red/switch.svg +10 -0
  1165. gns3server/symbols/affinity/square/red/switch_multilayer.svg +9 -0
  1166. gns3server/symbols/affinity/square/red/tablet.svg +9 -0
  1167. gns3server/symbols/affinity/square/red/template.svg +4 -0
  1168. gns3server/symbols/affinity/square/red/tree.svg +5 -0
  1169. gns3server/symbols/affinity/square/red/user.svg +7 -0
  1170. gns3server/symbols/affinity/square/red/virtualbox.svg +7 -0
  1171. gns3server/symbols/affinity/square/red/vm.svg +7 -0
  1172. gns3server/symbols/affinity/square/red/vmware.svg +7 -0
  1173. gns3server/symbols/affinity/square/red/vrf.svg +5 -0
  1174. gns3server/symbols/affinity/square/red/wifi.svg +13 -0
  1175. gns3server/symbols/affinity/square/red/wlc.svg +7 -0
  1176. gns3server/symbols/affinity/square/red/xml.svg +10 -0
  1177. gns3server/symbols/classic/PBX.svg +304 -0
  1178. gns3server/symbols/classic/PIX_firewall.svg +187 -0
  1179. gns3server/symbols/classic/access_point.svg +516 -0
  1180. gns3server/symbols/classic/access_server.svg +270 -0
  1181. gns3server/symbols/classic/asa.svg +424 -0
  1182. gns3server/symbols/classic/atm_bridge.svg +219 -0
  1183. gns3server/symbols/classic/atm_switch.svg +243 -0
  1184. gns3server/symbols/classic/call_manager.svg +228 -0
  1185. gns3server/symbols/classic/cloud.svg +163 -0
  1186. gns3server/symbols/classic/computer.svg +560 -0
  1187. gns3server/symbols/classic/docker_guest.svg +657 -0
  1188. gns3server/symbols/classic/dslam.svg +155 -0
  1189. gns3server/symbols/classic/edge_label_switch_router.svg +216 -0
  1190. gns3server/symbols/classic/ethernet_switch.svg +228 -0
  1191. gns3server/symbols/classic/firewall.svg +187 -0
  1192. gns3server/symbols/classic/frame_relay_switch.svg +263 -0
  1193. gns3server/symbols/classic/gateway.svg +309 -0
  1194. gns3server/symbols/classic/hub.svg +204 -0
  1195. gns3server/symbols/classic/ids.svg +310 -0
  1196. gns3server/symbols/classic/iosv_l2_virl.svg +286 -0
  1197. gns3server/symbols/classic/iosv_virl.svg +394 -0
  1198. gns3server/symbols/classic/ip_phone.svg +171 -0
  1199. gns3server/symbols/classic/label_switch_router.svg +223 -0
  1200. gns3server/symbols/classic/lightweight_ap.svg +536 -0
  1201. gns3server/symbols/classic/multilayer_switch.svg +317 -0
  1202. gns3server/symbols/classic/nat.svg +207 -0
  1203. gns3server/symbols/classic/optical_router.svg +207 -0
  1204. gns3server/symbols/classic/printer.svg +178 -0
  1205. gns3server/symbols/classic/qemu_guest.svg +1387 -0
  1206. gns3server/symbols/classic/route_switch_processor.svg +395 -0
  1207. gns3server/symbols/classic/router.awp.svg +362 -0
  1208. gns3server/symbols/classic/router.svg +203 -0
  1209. gns3server/symbols/classic/router_firewall.svg +395 -0
  1210. gns3server/symbols/classic/router_netflow.svg +215 -0
  1211. gns3server/symbols/classic/server.svg +226 -0
  1212. gns3server/symbols/classic/sip_server.svg +305 -0
  1213. gns3server/symbols/classic/traceng.svg +610 -0
  1214. gns3server/symbols/classic/vbox_guest.svg +7691 -0
  1215. gns3server/symbols/classic/vmware_guest.svg +572 -0
  1216. gns3server/symbols/classic/voice_access_server.svg +289 -0
  1217. gns3server/symbols/classic/voice_router.svg +223 -0
  1218. gns3server/symbols/classic/vpcs_guest.svg +574 -0
  1219. gns3server/symbols/classic/wlan_controller.svg +528 -0
  1220. gns3server/templates/compute.html +62 -0
  1221. gns3server/templates/controller.html +55 -0
  1222. gns3server/templates/index.html +12 -0
  1223. gns3server/templates/layout.html +20 -0
  1224. gns3server/templates/project.html +91 -0
  1225. gns3server/templates/upload.html +6 -0
  1226. gns3server/utils/__init__.py +123 -0
  1227. gns3server/utils/application_id.py +49 -0
  1228. gns3server/utils/asyncio/__init__.py +148 -0
  1229. gns3server/utils/asyncio/aiozipstream.py +528 -0
  1230. gns3server/utils/asyncio/embed_shell.py +369 -0
  1231. gns3server/utils/asyncio/input_stream.py +408 -0
  1232. gns3server/utils/asyncio/pool.py +69 -0
  1233. gns3server/utils/asyncio/raw_command_server.py +140 -0
  1234. gns3server/utils/asyncio/serial.py +87 -0
  1235. gns3server/utils/asyncio/telnet_server.py +450 -0
  1236. gns3server/utils/cpu_percent.py +46 -0
  1237. gns3server/utils/file_watcher.py +103 -0
  1238. gns3server/utils/get_resource.py +48 -0
  1239. gns3server/utils/hostname.py +112 -0
  1240. gns3server/utils/http_client.py +71 -0
  1241. gns3server/utils/images.py +378 -0
  1242. gns3server/utils/interfaces.py +254 -0
  1243. gns3server/utils/notification_queue.py +79 -0
  1244. gns3server/utils/path.py +76 -0
  1245. gns3server/utils/picture.py +146 -0
  1246. gns3server/utils/qt.py +44 -0
  1247. gns3server/utils/vmnet.py +277 -0
  1248. gns3server/utils/zipfile_zstd/__init__.py +10 -0
  1249. gns3server/utils/zipfile_zstd/_patcher.py +20 -0
  1250. gns3server/utils/zipfile_zstd/_zipfile.py +64 -0
  1251. gns3server/version.py +36 -0
@@ -0,0 +1,1378 @@
1
+ #
2
+ # Copyright (C) 2015 GNS3 Technologies Inc.
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+ """
18
+ Docker container instance.
19
+ """
20
+
21
+ import sys
22
+ import asyncio
23
+ import shutil
24
+ import psutil
25
+ import shlex
26
+ import aiohttp
27
+ import subprocess
28
+ import os
29
+ import re
30
+
31
+ from gns3server.utils.asyncio.telnet_server import AsyncioTelnetServer
32
+ from gns3server.utils.asyncio.raw_command_server import AsyncioRawCommandServer
33
+ from gns3server.utils.asyncio import wait_for_file_creation
34
+ from gns3server.utils.asyncio import monitor_process
35
+ from gns3server.utils.get_resource import get_resource
36
+ from gns3server.utils.hostname import is_rfc1123_hostname_valid
37
+ from gns3server.utils import macaddress_to_int, int_to_macaddress
38
+
39
+ from gns3server.compute.ubridge.ubridge_error import UbridgeError, UbridgeNamespaceError
40
+ from ..base_node import BaseNode
41
+
42
+ from ..adapters.ethernet_adapter import EthernetAdapter
43
+ from ..nios.nio_udp import NIOUDP
44
+ from .docker_error import DockerError, DockerHttp304Error, DockerHttp404Error
45
+
46
+ import logging
47
+
48
+ log = logging.getLogger(__name__)
49
+
50
+
51
+ class DockerVM(BaseNode):
52
+ """
53
+ Docker container implementation.
54
+
55
+ :param name: Docker container name
56
+ :param node_id: Node identifier
57
+ :param project: Project instance
58
+ :param manager: Manager instance
59
+ :param image: Docker image
60
+ :param console: TCP console port
61
+ :param console_type: console type
62
+ :param aux: TCP aux console port
63
+ :param aux_type: auxiliary console type
64
+ :param console_resolution: Resolution of the VNC display
65
+ :param console_http_port: Port to redirect HTTP queries
66
+ :param console_http_path: Url part with the path of the web interface
67
+ :param extra_hosts: Hosts which will be written into /etc/hosts into docker conainer
68
+ :param extra_volumes: Additional directories to make persistent
69
+ """
70
+
71
+ def __init__(
72
+ self,
73
+ name,
74
+ node_id,
75
+ project,
76
+ manager,
77
+ image,
78
+ console=None,
79
+ aux=None,
80
+ start_command=None,
81
+ adapters=None,
82
+ mac_address="",
83
+ environment=None,
84
+ console_type="telnet",
85
+ aux_type="none",
86
+ console_resolution="1024x768",
87
+ console_http_port=80,
88
+ console_http_path="/",
89
+ extra_hosts=None,
90
+ extra_volumes=[],
91
+ memory=0,
92
+ cpus=0,
93
+ ):
94
+
95
+ if not is_rfc1123_hostname_valid(name):
96
+ raise DockerError(f"'{name}' is an invalid name to create a Docker node")
97
+
98
+ super().__init__(
99
+ name, node_id, project, manager, console=console, console_type=console_type, aux=aux, aux_type=aux_type
100
+ )
101
+
102
+ # force the latest image if no version is specified
103
+ if ":" not in image:
104
+ image = f"{image}:latest"
105
+ self._image = image
106
+ self._start_command = start_command
107
+ self._environment = environment
108
+ self._cid = None
109
+ self._ethernet_adapters = []
110
+ self._temporary_directory = None
111
+ self._telnet_servers = []
112
+ self._vnc_process = None
113
+ self._vncconfig_process = None
114
+ self._console_resolution = console_resolution
115
+ self._console_http_path = console_http_path
116
+ self._console_http_port = console_http_port
117
+ self._console_websocket = None
118
+ self._extra_hosts = extra_hosts
119
+ self._extra_volumes = extra_volumes or []
120
+ self._memory = memory
121
+ self._cpus = cpus
122
+ self._permissions_fixed = True
123
+ self._display = None
124
+ self._closing = False
125
+
126
+ self._volumes = []
127
+ # Keep a list of created bridge
128
+ self._bridges = set()
129
+
130
+ if adapters is None:
131
+ self.adapters = 1
132
+ else:
133
+ self.adapters = adapters
134
+
135
+ self.mac_address = mac_address
136
+
137
+ log.debug(
138
+ "{module}: {name} [{image}] initialized.".format(
139
+ module=self.manager.module_name, name=self.name, image=self._image
140
+ )
141
+ )
142
+
143
+ def asdict(self):
144
+ return {
145
+ "name": self._name,
146
+ "usage": self.usage,
147
+ "node_id": self._id,
148
+ "container_id": self._cid,
149
+ "project_id": self._project.id,
150
+ "image": self._image,
151
+ "adapters": self.adapters,
152
+ "mac_address": self.mac_address,
153
+ "console": self.console,
154
+ "console_type": self.console_type,
155
+ "console_resolution": self.console_resolution,
156
+ "console_http_port": self.console_http_port,
157
+ "console_http_path": self.console_http_path,
158
+ "aux": self.aux,
159
+ "aux_type": self.aux_type,
160
+ "start_command": self.start_command,
161
+ "status": self.status,
162
+ "environment": self.environment,
163
+ "node_directory": self.working_path,
164
+ "extra_hosts": self.extra_hosts,
165
+ "extra_volumes": self.extra_volumes,
166
+ "memory": self.memory,
167
+ "cpus": self.cpus,
168
+ }
169
+
170
+ def _get_free_display_port(self):
171
+ """
172
+ Search a free display port
173
+ """
174
+ display = 100
175
+ if not os.path.exists("/tmp/.X11-unix/"):
176
+ return display
177
+ while True:
178
+ if not os.path.exists(f"/tmp/.X11-unix/X{display}"):
179
+ return display
180
+ display += 1
181
+
182
+ @BaseNode.name.setter
183
+ def name(self, new_name):
184
+ """
185
+ Sets the name of this Qemu VM.
186
+
187
+ :param new_name: name
188
+ """
189
+
190
+ if not is_rfc1123_hostname_valid(new_name):
191
+ raise DockerError(f"'{new_name}' is an invalid name to rename Docker container '{self._name}'")
192
+ super(DockerVM, DockerVM).name.__set__(self, new_name)
193
+
194
+ @property
195
+ def ethernet_adapters(self):
196
+ return self._ethernet_adapters
197
+
198
+ @property
199
+ def mac_address(self):
200
+ """
201
+ Returns the MAC address for this Docker container.
202
+
203
+ :returns: adapter type (string)
204
+ """
205
+
206
+ return self._mac_address
207
+
208
+ @mac_address.setter
209
+ def mac_address(self, mac_address):
210
+ """
211
+ Sets the MAC address for this Docker container.
212
+
213
+ :param mac_address: MAC address
214
+ """
215
+
216
+ if not mac_address:
217
+ # use the node UUID to generate a random MAC address
218
+ self._mac_address = "02:42:%s:%s:%s:00" % (self.id[2:4], self.id[4:6], self.id[6:8])
219
+ else:
220
+ self._mac_address = mac_address
221
+
222
+ log.info('Docker container "{name}" [{id}]: MAC address changed to {mac_addr}'.format(
223
+ name=self._name,
224
+ id=self._id,
225
+ mac_addr=self._mac_address)
226
+ )
227
+
228
+ @property
229
+ def start_command(self):
230
+ return self._start_command
231
+
232
+ @start_command.setter
233
+ def start_command(self, command):
234
+ if command:
235
+ command = command.strip()
236
+ if command is None or len(command) == 0:
237
+ self._start_command = None
238
+ else:
239
+ self._start_command = command
240
+
241
+ @property
242
+ def console_resolution(self):
243
+ return self._console_resolution
244
+
245
+ @console_resolution.setter
246
+ def console_resolution(self, resolution):
247
+ self._console_resolution = resolution
248
+
249
+ @property
250
+ def console_http_path(self):
251
+ return self._console_http_path
252
+
253
+ @console_http_path.setter
254
+ def console_http_path(self, path):
255
+ self._console_http_path = path
256
+
257
+ @property
258
+ def console_http_port(self):
259
+ return self._console_http_port
260
+
261
+ @console_http_port.setter
262
+ def console_http_port(self, port):
263
+ self._console_http_port = port
264
+
265
+ @property
266
+ def environment(self):
267
+ return self._environment
268
+
269
+ @environment.setter
270
+ def environment(self, command):
271
+ self._environment = command
272
+
273
+ @property
274
+ def extra_hosts(self):
275
+ return self._extra_hosts
276
+
277
+ @extra_hosts.setter
278
+ def extra_hosts(self, extra_hosts):
279
+ self._extra_hosts = extra_hosts
280
+
281
+ @property
282
+ def extra_volumes(self):
283
+ return self._extra_volumes
284
+
285
+ @extra_volumes.setter
286
+ def extra_volumes(self, extra_volumes):
287
+ self._extra_volumes = extra_volumes
288
+
289
+ @property
290
+ def memory(self):
291
+ return self._memory
292
+
293
+ @memory.setter
294
+ def memory(self, memory):
295
+ self._memory = memory
296
+
297
+ @property
298
+ def cpus(self):
299
+ return self._cpus
300
+
301
+ @cpus.setter
302
+ def cpus(self, cpus):
303
+ self._cpus = cpus
304
+
305
+ async def _get_container_state(self):
306
+ """
307
+ Returns the container state (e.g. running, paused etc.)
308
+
309
+ :returns: state
310
+ :rtype: str
311
+ """
312
+
313
+ try:
314
+ result = await self.manager.query("GET", f"containers/{self._cid}/json")
315
+ except DockerError:
316
+ return "exited"
317
+
318
+ if result["State"]["Paused"]:
319
+ return "paused"
320
+ if result["State"]["Running"]:
321
+ return "running"
322
+ return "exited"
323
+
324
+ async def _get_image_information(self):
325
+ """
326
+ :returns: Dictionary information about the container image
327
+ """
328
+
329
+ result = await self.manager.query("GET", f"images/{self._image}/json")
330
+ return result
331
+
332
+ def _mount_binds(self, image_info):
333
+ """
334
+ :returns: Return the path that we need to map to local folders
335
+ """
336
+
337
+ try:
338
+ resources_path = self.manager.resources_path()
339
+ except OSError as e:
340
+ raise DockerError(f"Cannot access resources: {e}")
341
+
342
+ log.info(f'Mount resources from "{resources_path}"')
343
+ binds = [{
344
+ "Type": "bind",
345
+ "Source": resources_path,
346
+ "Target": "/gns3",
347
+ "ReadOnly": True
348
+ }]
349
+
350
+ # We mount our own etc/network
351
+ try:
352
+ self._create_network_config()
353
+ except OSError as e:
354
+ raise DockerError(f"Could not create network config in the container: {e}")
355
+ volumes = ["/etc/network"]
356
+
357
+ volumes.extend((image_info.get("Config", {}).get("Volumes") or {}).keys())
358
+ for volume in self._extra_volumes:
359
+ if not volume.strip() or volume[0] != "/" or volume.find("..") >= 0:
360
+ raise DockerError(
361
+ f"Persistent volume '{volume}' has invalid format. It must start with a '/' and not contain '..'."
362
+ )
363
+ volumes.extend(self._extra_volumes)
364
+
365
+ self._volumes = []
366
+ # define lambdas for validation checks
367
+ nf = lambda x: re.sub(r"//+", "/", (x if x.endswith("/") else x + "/"))
368
+ generalises = lambda v1, v2: nf(v2).startswith(nf(v1))
369
+ for volume in volumes:
370
+ # remove any mount that is equal or more specific, then append this one
371
+ self._volumes = list(filter(lambda v: not generalises(volume, v), self._volumes))
372
+ # if there is nothing more general, append this mount
373
+ if not [v for v in self._volumes if generalises(v, volume)]:
374
+ self._volumes.append(volume)
375
+
376
+ for volume in self._volumes:
377
+ source = os.path.join(self.working_dir, os.path.relpath(volume, "/"))
378
+ os.makedirs(source, exist_ok=True)
379
+ binds.append({
380
+ "Type": "bind",
381
+ "Source": source,
382
+ "Target": "/gns3volumes{}".format(volume)
383
+ })
384
+
385
+ return binds
386
+
387
+ def _create_network_config(self):
388
+ """
389
+ If network config is empty we create a sample config
390
+ """
391
+ path = os.path.join(self.working_dir, "etc", "network")
392
+ os.makedirs(path, exist_ok=True)
393
+ open(os.path.join(path, ".gns3_perms"), "a").close()
394
+ os.makedirs(os.path.join(path, "if-up.d"), exist_ok=True)
395
+ os.makedirs(os.path.join(path, "if-down.d"), exist_ok=True)
396
+ os.makedirs(os.path.join(path, "if-pre-up.d"), exist_ok=True)
397
+ os.makedirs(os.path.join(path, "if-post-down.d"), exist_ok=True)
398
+ os.makedirs(os.path.join(path, "interfaces.d"), exist_ok=True)
399
+
400
+ if not os.path.exists(os.path.join(path, "interfaces")):
401
+ with open(os.path.join(path, "interfaces"), "w+") as f:
402
+ f.write("""#
403
+ # This is a sample network config, please uncomment lines to configure the network
404
+ #
405
+
406
+ # Uncomment this line to load custom interface files
407
+ # source /etc/network/interfaces.d/*
408
+ """)
409
+ for adapter in range(0, self.adapters):
410
+ f.write(
411
+ """
412
+ # Static config for eth{adapter}
413
+ #auto eth{adapter}
414
+ #iface eth{adapter} inet static
415
+ #\taddress 192.168.{adapter}.2
416
+ #\tnetmask 255.255.255.0
417
+ #\tgateway 192.168.{adapter}.1
418
+ #\tup echo nameserver 192.168.{adapter}.1 > /etc/resolv.conf
419
+
420
+ # DHCP config for eth{adapter}
421
+ #auto eth{adapter}
422
+ #iface eth{adapter} inet dhcp
423
+ #\thostname {hostname}
424
+ """.format(adapter=adapter, hostname=self._name))
425
+ return path
426
+
427
+ async def create(self):
428
+ """
429
+ Creates the Docker container.
430
+ """
431
+
432
+ if ":" in os.path.splitdrive(self.working_dir)[1]:
433
+ raise DockerError("Cannot create a Docker container with a project directory containing a colon character (':')")
434
+
435
+ #await self.manager.install_resources()
436
+
437
+ try:
438
+ image_infos = await self._get_image_information()
439
+ except DockerHttp404Error:
440
+ log.info(f"Image '{self._image}' is missing, pulling it from Docker hub...")
441
+ await self.pull_image(self._image)
442
+ image_infos = await self._get_image_information()
443
+
444
+ if image_infos is None:
445
+ raise DockerError(f"Cannot get information for image '{self._image}', please try again.")
446
+
447
+ available_cpus = psutil.cpu_count(logical=True)
448
+ if self._cpus > available_cpus:
449
+ raise DockerError(
450
+ f"You have allocated too many CPUs for the Docker container "
451
+ f"(max available is {available_cpus} CPUs)"
452
+ )
453
+
454
+ params = {
455
+ "Hostname": self._name,
456
+ "Image": self._image,
457
+ "NetworkDisabled": True,
458
+ "Tty": True,
459
+ "OpenStdin": True,
460
+ "StdinOnce": False,
461
+ "HostConfig": {
462
+ "CapAdd": ["ALL"],
463
+ "Privileged": True,
464
+ "Mounts": self._mount_binds(image_infos),
465
+ "Memory": self._memory * (1024 * 1024), # convert memory to bytes
466
+ "NanoCpus": int(self._cpus * 1e9), # convert cpus to nano cpus
467
+ "UsernsMode": "host"
468
+ },
469
+ "Volumes": {},
470
+ "Env": ["container=docker"], # Systemd compliant: https://github.com/GNS3/gns3-server/issues/573
471
+ "Cmd": [],
472
+ "Entrypoint": image_infos.get("Config", {"Entrypoint": []}).get("Entrypoint"),
473
+ }
474
+
475
+ if params["Entrypoint"] is None:
476
+ params["Entrypoint"] = []
477
+ if self._start_command:
478
+ try:
479
+ params["Cmd"] = shlex.split(self._start_command)
480
+ except ValueError as e:
481
+ raise DockerError(f"Invalid start command '{self._start_command}': {e}")
482
+ if len(params["Cmd"]) == 0:
483
+ params["Cmd"] = image_infos.get("Config", {"Cmd": []}).get("Cmd")
484
+ if params["Cmd"] is None:
485
+ params["Cmd"] = []
486
+ if len(params["Cmd"]) == 0 and len(params["Entrypoint"]) == 0:
487
+ params["Cmd"] = ["/bin/sh"]
488
+ params["Entrypoint"].insert(0, "/gns3/init.sh") # FIXME /gns3/init.sh is not found?
489
+
490
+ # Give the information to the container on how many interface should be inside
491
+ params["Env"].append(f"GNS3_MAX_ETHERNET=eth{self.adapters - 1}")
492
+ # Give the information to the container the list of volume path mounted
493
+ params["Env"].append("GNS3_VOLUMES={}".format(":".join(self._volumes)))
494
+
495
+ # Pass user configured for image to init script
496
+ if image_infos.get("Config", {"User": ""}).get("User"):
497
+ params["User"] = "root"
498
+ params["Env"].append("GNS3_USER={}".format(image_infos.get("Config", {"User": ""})["User"]))
499
+
500
+ variables = self.project.variables
501
+ if not variables:
502
+ variables = []
503
+
504
+ for var in variables:
505
+ formatted = self._format_env(variables, var.get("value", ""))
506
+ params["Env"].append("{}={}".format(var["name"], formatted))
507
+
508
+ if self._environment:
509
+ for e in self._environment.strip().split("\n"):
510
+ e = e.strip()
511
+ if e.split("=")[0] == "":
512
+ self.project.emit("log.warning", {"message": f"{self.name} has invalid environment variable: {e}"})
513
+ continue
514
+ if not e.startswith("GNS3_"):
515
+ formatted = self._format_env(variables, e)
516
+ vm_name = self._name.replace(",", ",,")
517
+ project_path = self.project.path.replace(",", ",,")
518
+ formatted = formatted.replace("%vm-name%", '"' + vm_name.replace('"', '\\"') + '"')
519
+ formatted = formatted.replace("%vm-id%", self._id)
520
+ formatted = formatted.replace("%project-id%", self.project.id)
521
+ formatted = formatted.replace("%project-path%", '"' + project_path.replace('"', '\\"') + '"')
522
+ params["Env"].append(formatted)
523
+
524
+ if self._console_type == "vnc":
525
+ await self._start_vnc()
526
+ params["Env"].append(
527
+ "QT_GRAPHICSSYSTEM=native"
528
+ ) # To fix a Qt issue: https://github.com/GNS3/gns3-server/issues/556
529
+ params["Env"].append(f"DISPLAY=:{self._display}")
530
+ params["HostConfig"]["Mounts"].append({
531
+ "Type": "bind",
532
+ "Source": f"/tmp/.X11-unix/X{self._display}",
533
+ "Target": f"/tmp/.X11-unix/X{self._display}",
534
+ "ReadOnly": True
535
+ })
536
+
537
+ if self._extra_hosts:
538
+ extra_hosts = self._format_extra_hosts(self._extra_hosts)
539
+ if extra_hosts:
540
+ params["Env"].append(f"GNS3_EXTRA_HOSTS={extra_hosts}")
541
+
542
+ result = await self.manager.query("POST", "containers/create", data=params)
543
+ self._cid = result["Id"]
544
+ log.info(f"Docker container '{self._name}' [{self._id}] created")
545
+ if self._cpus > 0:
546
+ log.info(f"CPU limit set to {self._cpus} CPUs")
547
+ if self._memory > 0:
548
+ log.info(f"Memory limit set to {self._memory} MB")
549
+ return True
550
+
551
+ def _format_env(self, variables, env):
552
+ for variable in variables:
553
+ env = env.replace("${" + variable["name"] + "}", variable.get("value", ""))
554
+ return env
555
+
556
+ def _format_extra_hosts(self, extra_hosts):
557
+ lines = [h.strip() for h in self._extra_hosts.split("\n") if h.strip() != ""]
558
+ hosts = []
559
+ try:
560
+ for host in lines:
561
+ hostname, ip = host.split(":")
562
+ hostname = hostname.strip()
563
+ ip = ip.strip()
564
+ if hostname and ip:
565
+ hosts.append((hostname, ip))
566
+ except ValueError:
567
+ raise DockerError(f"Can't apply `ExtraHosts`, wrong format: {extra_hosts}")
568
+ return "\n".join([f"{h[1]}\t{h[0]}" for h in hosts])
569
+
570
+ async def update(self):
571
+ """
572
+ Destroy and recreate the container with the new settings
573
+ """
574
+
575
+ # We need to save the console and state and restore it
576
+ console = self.console
577
+ aux = self.aux
578
+ state = await self._get_container_state()
579
+
580
+ # reset the docker container, but don't release the NIO UDP ports
581
+ await self.reset(False)
582
+ await self.create()
583
+ self.console = console
584
+ self.aux = aux
585
+ if state == "running":
586
+ await self.start()
587
+
588
+ async def start(self):
589
+ """
590
+ Starts this Docker container.
591
+ """
592
+
593
+ await self.manager.install_resources()
594
+
595
+ try:
596
+ state = await self._get_container_state()
597
+ except DockerHttp404Error:
598
+ raise DockerError(
599
+ "Docker container '{name}' with ID {cid} does not exist or is not ready yet. Please try again in a few seconds.".format(
600
+ name=self.name, cid=self._cid
601
+ )
602
+ )
603
+ if state == "paused":
604
+ await self.unpause()
605
+ elif state == "running":
606
+ return
607
+ else:
608
+
609
+ if self._console_type == "vnc" and not self._vnc_process:
610
+ # restart the vnc process in case it had previously crashed
611
+ await self._start_vnc_process(restart=True)
612
+ monitor_process(self._vnc_process, self._vnc_callback)
613
+
614
+ if self._console_websocket:
615
+ await self._console_websocket.close()
616
+ self._console_websocket = None
617
+ await self._clean_servers()
618
+
619
+ await self.manager.query("POST", f"containers/{self._cid}/start")
620
+ self._namespace = await self._get_namespace()
621
+
622
+ await self._start_ubridge(require_privileged_access=True)
623
+
624
+ for adapter_number in range(0, self.adapters):
625
+ nio = self._ethernet_adapters[adapter_number].get_nio(0)
626
+ async with self.manager.ubridge_lock:
627
+ try:
628
+ await self._add_ubridge_connection(nio, adapter_number)
629
+ except UbridgeNamespaceError:
630
+ log.error("Container %s failed to start", self.name)
631
+ await self.stop()
632
+
633
+ # The container can crash soon after the start, this means we can not move the interface to the container namespace
634
+ logdata = await self._get_log()
635
+ for line in logdata.split("\n"):
636
+ log.error(line)
637
+ raise DockerError(logdata)
638
+
639
+ if self.console_type == "telnet":
640
+ await self._start_console()
641
+ elif self.console_type == "http" or self.console_type == "https":
642
+ await self._start_http()
643
+
644
+ if self.aux_type != "none":
645
+ await self._start_aux()
646
+
647
+ self._permissions_fixed = False
648
+ self.status = "started"
649
+ log.info(
650
+ "Docker container '{name}' [{image}] started listen for {console_type} on {console}".format(
651
+ name=self._name, image=self._image, console=self.console, console_type=self.console_type
652
+ )
653
+ )
654
+
655
+ async def _start_aux(self):
656
+ """
657
+ Start an auxiliary console
658
+ """
659
+
660
+ # We can not use the API because docker doesn't expose a websocket api for exec
661
+ # https://github.com/GNS3/gns3-gui/issues/1039
662
+ try:
663
+ process = await asyncio.subprocess.create_subprocess_exec(
664
+ "script",
665
+ "-qfc",
666
+ f"docker exec -i -t {self._cid} /gns3/bin/busybox sh -c 'while true; do TERM=vt100 /gns3/bin/busybox sh; done'",
667
+ "/dev/null",
668
+ stdout=asyncio.subprocess.PIPE,
669
+ stderr=asyncio.subprocess.STDOUT,
670
+ stdin=asyncio.subprocess.PIPE,
671
+ )
672
+ except OSError as e:
673
+ raise DockerError(f"Could not start auxiliary console process: {e}")
674
+ server = AsyncioTelnetServer(reader=process.stdout, writer=process.stdin, binary=True, echo=True)
675
+ try:
676
+ self._telnet_servers.append(
677
+ await asyncio.start_server(server.run, self._manager.port_manager.console_host, self.aux)
678
+ )
679
+ except OSError as e:
680
+ raise DockerError(
681
+ f"Could not start Telnet server on socket {self._manager.port_manager.console_host}:{self.aux}: {e}"
682
+ )
683
+ log.debug(f"Docker container '{self.name}' started listen for auxiliary telnet on {self.aux}")
684
+
685
+ async def _fix_permissions(self):
686
+ """
687
+ Because docker run as root we need to fix permission and ownership to allow user to interact
688
+ with it from their filesystem and do operation like file delete
689
+ """
690
+
691
+ state = await self._get_container_state()
692
+ log.info(f"Docker container '{self._name}' fix ownership, state = {state}")
693
+ if state == "stopped" or state == "exited":
694
+ # We need to restart it to fix permissions
695
+ await self.manager.query("POST", f"containers/{self._cid}/start")
696
+
697
+ for volume in self._volumes:
698
+ log.debug(
699
+ "Docker container '{name}' [{image}] fix ownership on {path}".format(
700
+ name=self._name, image=self._image, path=volume
701
+ )
702
+ )
703
+
704
+ try:
705
+ process = await asyncio.subprocess.create_subprocess_exec(
706
+ "docker",
707
+ "exec",
708
+ self._cid,
709
+ "/gns3/bin/busybox",
710
+ "sh",
711
+ "-c",
712
+ "("
713
+ '/gns3/bin/busybox find "{path}" -depth -print0'
714
+ " | /gns3/bin/busybox xargs -0 /gns3/bin/busybox stat -c '%a:%u:%g:%n' > \"{path}/.gns3_perms\""
715
+ ")"
716
+ ' && /gns3/bin/busybox chmod -R u+rX "{path}"'
717
+ ' && /gns3/bin/busybox chown {uid}:{gid} -R "{path}"'.format(
718
+ uid=os.getuid(), gid=os.getgid(), path=volume
719
+ ),
720
+ )
721
+ except OSError as e:
722
+ raise DockerError(f"Could not fix permissions for {volume}: {e}")
723
+ await process.wait()
724
+ self._permissions_fixed = True
725
+
726
+ async def _start_vnc_process(self, restart=False):
727
+ """
728
+ Starts the VNC process.
729
+ """
730
+
731
+ self._display = self._get_free_display_port()
732
+ tigervnc_path = shutil.which("Xtigervnc") or shutil.which("Xvnc")
733
+
734
+ if not tigervnc_path:
735
+ raise DockerError("Please install TigerVNC server before using VNC support")
736
+
737
+ if tigervnc_path:
738
+ with open(os.path.join(self.working_dir, "vnc.log"), "w") as fd:
739
+ self._vnc_process = await asyncio.create_subprocess_exec(tigervnc_path,
740
+ "-extension", "MIT-SHM",
741
+ "-geometry", self._console_resolution,
742
+ "-depth", "16",
743
+ "-interface", self._manager.port_manager.console_host,
744
+ "-rfbport", str(self.console),
745
+ "-AlwaysShared",
746
+ "-SecurityTypes", "None",
747
+ ":{}".format(self._display),
748
+ stdout=fd, stderr=subprocess.STDOUT)
749
+
750
+ async def _start_vnc(self):
751
+ """
752
+ Starts a VNC server for this container
753
+ """
754
+
755
+ self._display = self._get_free_display_port()
756
+ tigervnc_path = shutil.which("Xtigervnc") or shutil.which("Xvnc")
757
+ if not tigervnc_path:
758
+ raise DockerError("Please install TigerVNC server before using VNC support")
759
+ await self._start_vnc_process()
760
+ x11_socket = os.path.join("/tmp/.X11-unix/", f"X{self._display}")
761
+ try:
762
+ await wait_for_file_creation(x11_socket)
763
+ except asyncio.TimeoutError:
764
+ raise DockerError(f'x11 socket file "{x11_socket}" does not exist')
765
+
766
+ if not hasattr(sys, "_called_from_test") or not sys._called_from_test:
767
+ # Start vncconfig for tigervnc clipboard support, connection available only after socket creation.
768
+ tigervncconfig_path = shutil.which("vncconfig")
769
+ if tigervnc_path and tigervncconfig_path:
770
+ self._vncconfig_process = await asyncio.create_subprocess_exec(
771
+ tigervncconfig_path, "-display", f":{self._display}", "-nowin"
772
+ )
773
+
774
+ # sometimes the VNC process can crash
775
+ monitor_process(self._vnc_process, self._vnc_callback)
776
+
777
+ def _vnc_callback(self, returncode):
778
+ """
779
+ Called when the process has stopped.
780
+
781
+ :param returncode: Process returncode
782
+ """
783
+
784
+ if returncode != 0 and self._closing is False:
785
+ self.project.emit(
786
+ "log.error",
787
+ {
788
+ "message": f"The vnc process has stopped with return code {returncode} for node '{self.name}'. Please restart this node."
789
+ },
790
+ )
791
+ self._vnc_process = None
792
+
793
+ async def _start_http(self):
794
+ """
795
+ Starts an HTTP tunnel to container localhost. It's not perfect
796
+ but the only way we have to inject network packet is using nc.
797
+ """
798
+
799
+ log.debug("Forward HTTP for %s to %d", self.name, self._console_http_port)
800
+ command = [
801
+ "docker",
802
+ "exec",
803
+ "-i",
804
+ self._cid,
805
+ "/gns3/bin/busybox",
806
+ "nc",
807
+ "127.0.0.1",
808
+ str(self._console_http_port),
809
+ ]
810
+ # We replace host and port in the server answer otherwise some link could be broken
811
+ server = AsyncioRawCommandServer(
812
+ command,
813
+ replaces=[
814
+ (
815
+ b"://127.0.0.1", # {{HOST}} mean client host
816
+ b"://{{HOST}}",
817
+ ),
818
+ (
819
+ f":{self._console_http_port}".encode(),
820
+ f":{self.console}".encode(),
821
+ ),
822
+ ],
823
+ )
824
+ self._telnet_servers.append(
825
+ await asyncio.start_server(server.run, self._manager.port_manager.console_host, self.console)
826
+ )
827
+
828
+ async def _window_size_changed_callback(self, columns, rows):
829
+ """
830
+ Called when the console window size has been changed.
831
+ (when naws is enabled in the Telnet server)
832
+
833
+ :param columns: number of columns
834
+ :param rows: number of rows
835
+ """
836
+
837
+ # resize the container TTY.
838
+ try:
839
+ await self._manager.query("POST", f"containers/{self._cid}/resize?h={rows}&w={columns}")
840
+ except DockerError as e:
841
+ log.warning(f"Could not resize the container TTY: {e}")
842
+
843
+ async def _start_console(self):
844
+ """
845
+ Starts streaming the console via telnet
846
+ """
847
+
848
+ class InputStream:
849
+ def __init__(self):
850
+ self._data = b""
851
+
852
+ def write(self, data):
853
+ self._data += data
854
+
855
+ async def drain(self):
856
+ if not self.ws.closed:
857
+ await self.ws.send_bytes(self._data)
858
+ self._data = b""
859
+
860
+ output_stream = asyncio.StreamReader()
861
+ input_stream = InputStream()
862
+ telnet = AsyncioTelnetServer(
863
+ reader=output_stream,
864
+ writer=input_stream,
865
+ echo=True,
866
+ naws=True,
867
+ window_size_changed_callback=self._window_size_changed_callback,
868
+ )
869
+ try:
870
+ self._telnet_servers.append(
871
+ await asyncio.start_server(telnet.run, self._manager.port_manager.console_host, self.console)
872
+ )
873
+ except OSError as e:
874
+ raise DockerError(
875
+ f"Could not start Telnet server on socket {self._manager.port_manager.console_host}:{self.console}: {e}"
876
+ )
877
+
878
+ self._console_websocket = await self.manager.websocket_query(
879
+ f"containers/{self._cid}/attach/ws?stream=1&stdin=1&stdout=1&stderr=1"
880
+ )
881
+ input_stream.ws = self._console_websocket
882
+ output_stream.feed_data(self.name.encode() + b" console is now available... Press RETURN to get started.\r\n")
883
+ asyncio.ensure_future(self._read_console_output(self._console_websocket, output_stream))
884
+
885
+ async def _read_console_output(self, ws, out):
886
+ """
887
+ Reads Websocket and forward it to the telnet
888
+
889
+ :param ws: Websocket connection
890
+ :param out: Output stream
891
+ """
892
+
893
+ while True:
894
+ msg = await ws.receive()
895
+ if msg.type == aiohttp.WSMsgType.TEXT:
896
+ out.feed_data(msg.data.encode())
897
+ elif msg.type == aiohttp.WSMsgType.BINARY:
898
+ out.feed_data(msg.data)
899
+ elif msg.type == aiohttp.WSMsgType.ERROR:
900
+ log.critical(f"Docker WebSocket Error: {ws.exception()}")
901
+ else:
902
+ out.feed_eof()
903
+ await ws.close()
904
+ break
905
+
906
+ async def reset_console(self):
907
+ """
908
+ Reset the console.
909
+ """
910
+
911
+ if self._console_websocket:
912
+ await self._console_websocket.close()
913
+ await self._clean_servers()
914
+ await self._start_console()
915
+
916
+ async def is_running(self):
917
+ """
918
+ Checks if the container is running.
919
+
920
+ :returns: True or False
921
+ :rtype: bool
922
+ """
923
+
924
+ state = await self._get_container_state()
925
+ if state == "running":
926
+ return True
927
+ if self.status == "started": # The container crashed we need to clean
928
+ await self.stop()
929
+ return False
930
+
931
+ async def restart(self):
932
+ """
933
+ Restart this Docker container.
934
+ """
935
+
936
+ await self.manager.query("POST", f"containers/{self._cid}/restart")
937
+ log.info("Docker container '{name}' [{image}] restarted".format(name=self._name, image=self._image))
938
+
939
+ async def _clean_servers(self):
940
+ """
941
+ Clean the list of running console servers
942
+ """
943
+
944
+ if len(self._telnet_servers) > 0:
945
+ for telnet_server in self._telnet_servers:
946
+ telnet_server.close()
947
+ await telnet_server.wait_closed()
948
+ self._telnet_servers = []
949
+
950
+ async def stop(self):
951
+ """
952
+ Stops this Docker container.
953
+ """
954
+
955
+ try:
956
+ if self._console_websocket:
957
+ await self._console_websocket.close()
958
+ self._console_websocket = None
959
+ await self._clean_servers()
960
+ await self._stop_ubridge()
961
+
962
+ try:
963
+ state = await self._get_container_state()
964
+ except DockerHttp404Error:
965
+ self.status = "stopped"
966
+ return
967
+
968
+ if state == "paused":
969
+ await self.unpause()
970
+
971
+ if not self._permissions_fixed:
972
+ await self._fix_permissions()
973
+
974
+ state = await self._get_container_state()
975
+ if state != "stopped" or state != "exited":
976
+ # t=5 number of seconds to wait before killing the container
977
+ try:
978
+ await self.manager.query("POST", f"containers/{self._cid}/stop", params={"t": 5})
979
+ log.info(f"Docker container '{self._name}' [{self._image}] stopped")
980
+ except DockerHttp304Error:
981
+ # Container is already stopped
982
+ pass
983
+ # Ignore runtime error because when closing the server
984
+ except RuntimeError as e:
985
+ log.debug(f"Docker runtime error when closing: {str(e)}")
986
+ return
987
+ self.status = "stopped"
988
+
989
+ async def pause(self):
990
+ """
991
+ Pauses this Docker container.
992
+ """
993
+
994
+ await self.manager.query("POST", f"containers/{self._cid}/pause")
995
+ self.status = "suspended"
996
+ log.info(f"Docker container '{self._name}' [{self._image}] paused")
997
+
998
+ async def unpause(self):
999
+ """
1000
+ Unpauses this Docker container.
1001
+ """
1002
+
1003
+ await self.manager.query("POST", f"containers/{self._cid}/unpause")
1004
+ self.status = "started"
1005
+ log.info(f"Docker container '{self._name}' [{self._image}] unpaused")
1006
+
1007
+ async def close(self):
1008
+ """
1009
+ Closes this Docker container.
1010
+ """
1011
+
1012
+ self._closing = True
1013
+ if not (await super().close()):
1014
+ return False
1015
+ await self.reset()
1016
+
1017
+ async def reset(self, release_nio_udp_ports=True):
1018
+
1019
+ try:
1020
+ state = await self._get_container_state()
1021
+ if state == "paused" or state == "running":
1022
+ await self.stop()
1023
+
1024
+ if self.console_type == "vnc":
1025
+ if self._vncconfig_process:
1026
+ try:
1027
+ self._vncconfig_process.terminate()
1028
+ await self._vncconfig_process.wait()
1029
+ except ProcessLookupError:
1030
+ pass
1031
+ if self._vnc_process:
1032
+ try:
1033
+ self._vnc_process.terminate()
1034
+ await self._vnc_process.wait()
1035
+ except ProcessLookupError:
1036
+ pass
1037
+
1038
+ if self._display:
1039
+ display = f"/tmp/.X11-unix/X{self._display}"
1040
+ try:
1041
+ if os.path.exists(display):
1042
+ os.remove(display)
1043
+ except OSError as e:
1044
+ log.warning(f"Could not remove display {display}: {e}")
1045
+
1046
+ # v – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false.
1047
+ # force - 1/True/true or 0/False/false, Kill then remove the container. Default false.
1048
+ try:
1049
+ await self.manager.query("DELETE", f"containers/{self._cid}", params={"force": 1, "v": 1})
1050
+ except DockerError:
1051
+ pass
1052
+ log.info("Docker container '{name}' [{image}] removed".format(name=self._name, image=self._image))
1053
+
1054
+ if release_nio_udp_ports:
1055
+ for adapter in self._ethernet_adapters:
1056
+ if adapter is not None:
1057
+ for nio in adapter.ports.values():
1058
+ if nio and isinstance(nio, NIOUDP):
1059
+ self.manager.port_manager.release_udp_port(nio.lport, self._project)
1060
+ # Ignore runtime error because when closing the server
1061
+ except (DockerHttp404Error, RuntimeError) as e:
1062
+ log.debug(f"Docker error when closing: {str(e)}")
1063
+ return
1064
+
1065
+ async def _add_ubridge_connection(self, nio, adapter_number):
1066
+ """
1067
+ Creates a connection in uBridge.
1068
+
1069
+ :param nio: NIO instance or None if it's a dummy interface (if an interface is missing in ubridge you can't see it via ifconfig in the container)
1070
+ :param adapter_number: adapter number
1071
+ """
1072
+
1073
+ try:
1074
+ adapter = self._ethernet_adapters[adapter_number]
1075
+ except IndexError:
1076
+ raise DockerError(
1077
+ "Adapter {adapter_number} doesn't exist on Docker container '{name}'".format(
1078
+ name=self.name, adapter_number=adapter_number
1079
+ )
1080
+ )
1081
+
1082
+ for index in range(4096):
1083
+ if f"tap-gns3-e{index}" not in psutil.net_if_addrs():
1084
+ adapter.host_ifc = f"tap-gns3-e{str(index)}"
1085
+ break
1086
+ if adapter.host_ifc is None:
1087
+ raise DockerError(
1088
+ "Adapter {adapter_number} couldn't allocate interface on Docker container '{name}'. Too many Docker interfaces already exists".format(
1089
+ name=self.name, adapter_number=adapter_number
1090
+ )
1091
+ )
1092
+ bridge_name = f"bridge{adapter_number}"
1093
+ await self._ubridge_send(f"bridge create {bridge_name}")
1094
+ self._bridges.add(bridge_name)
1095
+ await self._ubridge_send(
1096
+ "bridge add_nio_tap bridge{adapter_number} {hostif}".format(
1097
+ adapter_number=adapter_number, hostif=adapter.host_ifc
1098
+ )
1099
+ )
1100
+
1101
+ mac_address = int_to_macaddress(macaddress_to_int(self._mac_address) + adapter_number)
1102
+ custom_adapter = self._get_custom_adapter_settings(adapter_number)
1103
+ custom_mac_address = custom_adapter.get("mac_address")
1104
+ if custom_mac_address:
1105
+ mac_address = custom_mac_address
1106
+
1107
+ try:
1108
+ await self._ubridge_send('docker set_mac_addr {ifc} {mac}'.format(ifc=adapter.host_ifc, mac=mac_address))
1109
+ except UbridgeError:
1110
+ log.warning(f"Could not set MAC address {mac_address} on interface {adapter.host_ifc}")
1111
+
1112
+
1113
+ log.debug(f"Move container {self.name} adapter {adapter.host_ifc} to namespace {self._namespace}")
1114
+ try:
1115
+ await self._ubridge_send(
1116
+ "docker move_to_ns {ifc} {ns} eth{adapter}".format(
1117
+ ifc=adapter.host_ifc, ns=self._namespace, adapter=adapter_number
1118
+ )
1119
+ )
1120
+ except UbridgeError as e:
1121
+ raise UbridgeNamespaceError(e)
1122
+ else:
1123
+ log.info(f"Created adapter {adapter_number} with MAC address {mac_address} in namespace {self._namespace}")
1124
+
1125
+ if nio:
1126
+ await self._connect_nio(adapter_number, nio)
1127
+
1128
+ async def _get_namespace(self):
1129
+
1130
+ result = await self.manager.query("GET", f"containers/{self._cid}/json")
1131
+ return int(result["State"]["Pid"])
1132
+
1133
+ async def _connect_nio(self, adapter_number, nio):
1134
+
1135
+ bridge_name = f"bridge{adapter_number}"
1136
+ await self._ubridge_send(
1137
+ "bridge add_nio_udp {bridge_name} {lport} {rhost} {rport}".format(
1138
+ bridge_name=bridge_name, lport=nio.lport, rhost=nio.rhost, rport=nio.rport
1139
+ )
1140
+ )
1141
+
1142
+ if nio.capturing:
1143
+ await self._ubridge_send(
1144
+ 'bridge start_capture {bridge_name} "{pcap_file}"'.format(
1145
+ bridge_name=bridge_name, pcap_file=nio.pcap_output_file
1146
+ )
1147
+ )
1148
+ await self._ubridge_send(f"bridge start {bridge_name}")
1149
+ await self._ubridge_apply_filters(bridge_name, nio.filters)
1150
+
1151
+ async def adapter_add_nio_binding(self, adapter_number, nio):
1152
+ """
1153
+ Adds an adapter NIO binding.
1154
+
1155
+ :param adapter_number: adapter number
1156
+ :param nio: NIO instance to add to the slot/port
1157
+ """
1158
+
1159
+ try:
1160
+ adapter = self._ethernet_adapters[adapter_number]
1161
+ except IndexError:
1162
+ raise DockerError(
1163
+ "Adapter {adapter_number} doesn't exist on Docker container '{name}'".format(
1164
+ name=self.name, adapter_number=adapter_number
1165
+ )
1166
+ )
1167
+
1168
+ if self.status == "started" and self.ubridge:
1169
+ await self._connect_nio(adapter_number, nio)
1170
+
1171
+ adapter.add_nio(0, nio)
1172
+ log.info(
1173
+ "Docker container '{name}' [{id}]: {nio} added to adapter {adapter_number}".format(
1174
+ name=self.name, id=self._id, nio=nio, adapter_number=adapter_number
1175
+ )
1176
+ )
1177
+
1178
+ async def adapter_update_nio_binding(self, adapter_number, nio):
1179
+ """
1180
+ Update an adapter NIO binding.
1181
+
1182
+ :param adapter_number: adapter number
1183
+ :param nio: NIO instance to update the adapter
1184
+ """
1185
+
1186
+ if self.ubridge:
1187
+ bridge_name = f"bridge{adapter_number}"
1188
+ if bridge_name in self._bridges:
1189
+ await self._ubridge_apply_filters(bridge_name, nio.filters)
1190
+
1191
+ async def adapter_remove_nio_binding(self, adapter_number):
1192
+ """
1193
+ Removes an adapter NIO binding.
1194
+
1195
+ :param adapter_number: adapter number
1196
+
1197
+ :returns: NIO instance
1198
+ """
1199
+
1200
+ try:
1201
+ adapter = self._ethernet_adapters[adapter_number]
1202
+ except IndexError:
1203
+ raise DockerError(
1204
+ "Adapter {adapter_number} doesn't exist on Docker VM '{name}'".format(
1205
+ name=self.name, adapter_number=adapter_number
1206
+ )
1207
+ )
1208
+
1209
+ await self.stop_capture(adapter_number)
1210
+ if self.ubridge:
1211
+ nio = adapter.get_nio(0)
1212
+ bridge_name = f"bridge{adapter_number}"
1213
+ await self._ubridge_send(f"bridge stop {bridge_name}")
1214
+ await self._ubridge_send(
1215
+ "bridge remove_nio_udp bridge{adapter} {lport} {rhost} {rport}".format(
1216
+ adapter=adapter_number, lport=nio.lport, rhost=nio.rhost, rport=nio.rport
1217
+ )
1218
+ )
1219
+
1220
+ adapter.remove_nio(0)
1221
+
1222
+ log.info(
1223
+ "Docker VM '{name}' [{id}]: {nio} removed from adapter {adapter_number}".format(
1224
+ name=self.name, id=self.id, nio=adapter.host_ifc, adapter_number=adapter_number
1225
+ )
1226
+ )
1227
+
1228
+ def get_nio(self, adapter_number):
1229
+ """
1230
+ Gets an adapter NIO binding.
1231
+
1232
+ :param adapter_number: adapter number
1233
+
1234
+ :returns: NIO instance
1235
+ """
1236
+
1237
+ try:
1238
+ adapter = self._ethernet_adapters[adapter_number]
1239
+ except KeyError:
1240
+ raise DockerError(
1241
+ "Adapter {adapter_number} doesn't exist on Docker VM '{name}'".format(
1242
+ name=self.name, adapter_number=adapter_number
1243
+ )
1244
+ )
1245
+
1246
+ nio = adapter.get_nio(0)
1247
+
1248
+ if not nio:
1249
+ raise DockerError(f"Adapter {adapter_number} is not connected")
1250
+
1251
+ return nio
1252
+
1253
+ @property
1254
+ def adapters(self):
1255
+ """
1256
+ Returns the number of Ethernet adapters for this Docker VM.
1257
+
1258
+ :returns: number of adapters
1259
+ :rtype: int
1260
+ """
1261
+
1262
+ return len(self._ethernet_adapters)
1263
+
1264
+ @adapters.setter
1265
+ def adapters(self, adapters):
1266
+ """
1267
+ Sets the number of Ethernet adapters for this Docker container.
1268
+
1269
+ :param adapters: number of adapters
1270
+ """
1271
+
1272
+ if len(self._ethernet_adapters) == adapters:
1273
+ return
1274
+
1275
+ self._ethernet_adapters.clear()
1276
+ for adapter_number in range(0, adapters):
1277
+ self._ethernet_adapters.append(EthernetAdapter())
1278
+
1279
+ log.info(
1280
+ 'Docker container "{name}" [{id}]: number of Ethernet adapters changed to {adapters}'.format(
1281
+ name=self._name, id=self._id, adapters=adapters
1282
+ )
1283
+ )
1284
+
1285
+ async def pull_image(self, image):
1286
+ """
1287
+ Pulls an image from Docker repository
1288
+ """
1289
+
1290
+ def callback(msg):
1291
+ self.project.emit("log.info", {"message": msg})
1292
+
1293
+ await self.manager.pull_image(image, progress_callback=callback)
1294
+
1295
+ async def _start_ubridge_capture(self, adapter_number, output_file):
1296
+ """
1297
+ Starts a packet capture in uBridge.
1298
+
1299
+ :param adapter_number: adapter number
1300
+ :param output_file: PCAP destination file for the capture
1301
+ """
1302
+
1303
+ adapter = f"bridge{adapter_number}"
1304
+ if not self.ubridge:
1305
+ raise DockerError("Cannot start the packet capture: uBridge is not running")
1306
+ await self._ubridge_send(f'bridge start_capture {adapter} "{output_file}"')
1307
+
1308
+ async def _stop_ubridge_capture(self, adapter_number):
1309
+ """
1310
+ Stops a packet capture in uBridge.
1311
+
1312
+ :param adapter_number: adapter number
1313
+ """
1314
+
1315
+ adapter = f"bridge{adapter_number}"
1316
+ if not self.ubridge:
1317
+ raise DockerError("Cannot stop the packet capture: uBridge is not running")
1318
+ await self._ubridge_send(f"bridge stop_capture {adapter}")
1319
+
1320
+ async def start_capture(self, adapter_number, output_file):
1321
+ """
1322
+ Starts a packet capture.
1323
+
1324
+ :param adapter_number: adapter number
1325
+ :param output_file: PCAP destination file for the capture
1326
+ """
1327
+
1328
+ nio = self.get_nio(adapter_number)
1329
+ if nio.capturing:
1330
+ raise DockerError(f"Packet capture is already activated on adapter {adapter_number}")
1331
+
1332
+ nio.start_packet_capture(output_file)
1333
+ if self.status == "started" and self.ubridge:
1334
+ await self._start_ubridge_capture(adapter_number, output_file)
1335
+
1336
+ log.info(
1337
+ "Docker VM '{name}' [{id}]: starting packet capture on adapter {adapter_number}".format(
1338
+ name=self.name, id=self.id, adapter_number=adapter_number
1339
+ )
1340
+ )
1341
+
1342
+ async def stop_capture(self, adapter_number):
1343
+ """
1344
+ Stops a packet capture.
1345
+
1346
+ :param adapter_number: adapter number
1347
+ """
1348
+
1349
+ nio = self.get_nio(adapter_number)
1350
+ if not nio.capturing:
1351
+ return
1352
+ nio.stop_packet_capture()
1353
+ if self.status == "started" and self.ubridge:
1354
+ await self._stop_ubridge_capture(adapter_number)
1355
+
1356
+ log.info(
1357
+ "Docker VM '{name}' [{id}]: stopping packet capture on adapter {adapter_number}".format(
1358
+ name=self.name, id=self.id, adapter_number=adapter_number
1359
+ )
1360
+ )
1361
+
1362
+ async def _get_log(self):
1363
+ """
1364
+ Returns the log from the container
1365
+
1366
+ :returns: string
1367
+ """
1368
+
1369
+ result = await self.manager.query("GET", f"containers/{self._cid}/logs", params={"stderr": 1, "stdout": 1})
1370
+ return result
1371
+
1372
+ async def delete(self):
1373
+ """
1374
+ Deletes the VM (including all its files).
1375
+ """
1376
+
1377
+ await self.close()
1378
+ await super().delete()