Skip to content
Snippets Groups Projects
Commit 7e4a56db authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

update capture and filter link

parent 82a118ee
Branches
No related tags found
No related merge requests found
......@@ -86,11 +86,12 @@ def generate_topohub_GNS3_topology():
if user_input != '':
sys.exit()
if len(sys.argv) > 4:
if len(sys.argv) > 5:
topology_name = sys.argv[1]
gns3manager.malware_instance = 0 if sys.argv[2].strip() == "wannacry" else 1
f = float(sys.argv[3])
p_NAT = int(sys.argv[4])
packet_lost = int(sys.argv[5])
topo = topohub.get(topology_name)
g = nx.node_link_graph(topo)
......@@ -310,9 +311,14 @@ def generate_topohub_GNS3_topology():
if input("Capture link (y/N)?") == "y":
array_links = GNS3Manager.get_links()
for link in array_links:
if ubuntu_server.id not in link and ubuntu_vc_server.id not in link and array_window_hosts[0].id not in link:
for window_host in array_window_hosts:
if window_host.id in link:
GNS3Manager.start_capture_link(link[0])
for ubuntu_base in array_ubuntu_base:
if ubuntu_base.id in link:
GNS3Manager.set_link_filter(link[0], packet_lost)
# Press y to start Windows PCs
if input("Start Windows PCs (y/N)?") != "y":
sys.exit()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment