mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-19 12:57:56 +00:00
Enable UDP tunnel option and use ICMP probing by default.
This commit is contained in:
parent
05ec14e888
commit
c053a2f350
@ -168,6 +168,7 @@ class TraceNGVM(BaseNode):
|
|||||||
if not self.is_running():
|
if not self.is_running():
|
||||||
nio = self._ethernet_adapter.get_nio(0)
|
nio = self._ethernet_adapter.get_nio(0)
|
||||||
command = self._build_command(destination)
|
command = self._build_command(destination)
|
||||||
|
yield from self._stop_ubridge() # make use we start with a fresh uBridge instance
|
||||||
try:
|
try:
|
||||||
log.info("Starting TraceNG: {}".format(command))
|
log.info("Starting TraceNG: {}".format(command))
|
||||||
flags = subprocess.CREATE_NEW_CONSOLE
|
flags = subprocess.CREATE_NEW_CONSOLE
|
||||||
@ -176,6 +177,7 @@ class TraceNGVM(BaseNode):
|
|||||||
cwd=self.working_dir,
|
cwd=self.working_dir,
|
||||||
creationflags=flags)
|
creationflags=flags)
|
||||||
monitor_process(self._process, self._termination_callback)
|
monitor_process(self._process, self._termination_callback)
|
||||||
|
|
||||||
yield from self._start_ubridge()
|
yield from self._start_ubridge()
|
||||||
if nio:
|
if nio:
|
||||||
yield from self.add_ubridge_udp_connection("TraceNG-{}".format(self._id), self._local_udp_tunnel[1], nio)
|
yield from self.add_ubridge_udp_connection("TraceNG-{}".format(self._id), self._local_udp_tunnel[1], nio)
|
||||||
@ -242,6 +244,9 @@ class TraceNGVM(BaseNode):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
log.info("Stopping TraceNG instance {} PID={}".format(self.name, self._process.pid))
|
log.info("Stopping TraceNG instance {} PID={}".format(self.name, self._process.pid))
|
||||||
|
#if sys.platform.startswith("win32"):
|
||||||
|
# self._process.send_signal(signal.CTRL_BREAK_EVENT)
|
||||||
|
#else:
|
||||||
try:
|
try:
|
||||||
self._process.terminate()
|
self._process.terminate()
|
||||||
# Sometime the process may already be dead when we garbage collect
|
# Sometime the process may already be dead when we garbage collect
|
||||||
@ -395,6 +400,7 @@ class TraceNGVM(BaseNode):
|
|||||||
nio = self._local_udp_tunnel[0]
|
nio = self._local_udp_tunnel[0]
|
||||||
if nio and isinstance(nio, NIOUDP):
|
if nio and isinstance(nio, NIOUDP):
|
||||||
# UDP tunnel
|
# UDP tunnel
|
||||||
|
command.extend(["-u"]) # enable UDP tunnel
|
||||||
command.extend(["-c", str(nio.lport)]) # source UDP port
|
command.extend(["-c", str(nio.lport)]) # source UDP port
|
||||||
command.extend(["-v", str(nio.rport)]) # destination UDP port
|
command.extend(["-v", str(nio.rport)]) # destination UDP port
|
||||||
try:
|
try:
|
||||||
@ -402,6 +408,7 @@ class TraceNGVM(BaseNode):
|
|||||||
except socket.gaierror as e:
|
except socket.gaierror as e:
|
||||||
raise TraceNGError("Can't resolve hostname {}: {}".format(nio.rhost, e))
|
raise TraceNGError("Can't resolve hostname {}: {}".format(nio.rhost, e))
|
||||||
|
|
||||||
|
command.extend(["-s", "ICMP"]) # Use ICMP probe type by default
|
||||||
command.extend(["-f", self._ip_address]) # source IP address to trace from
|
command.extend(["-f", self._ip_address]) # source IP address to trace from
|
||||||
command.extend([destination]) # host or IP to trace
|
command.extend([destination]) # host or IP to trace
|
||||||
return command
|
return command
|
||||||
|
Loading…
Reference in New Issue
Block a user