From f95b7f2dfa04f259def8493ad6278b156451f279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gytis=20Sto=C5=A1kevi=C4=8Dius?= Date: Fri, 6 Dec 2024 12:14:53 +0200 Subject: [PATCH] add some notes --- nat-lab/tests/utils/tcpdump.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/nat-lab/tests/utils/tcpdump.py b/nat-lab/tests/utils/tcpdump.py index 744d3391e..1209c8044 100644 --- a/nat-lab/tests/utils/tcpdump.py +++ b/nat-lab/tests/utils/tcpdump.py @@ -53,12 +53,23 @@ def __init__( command += ["-w", PCAP_FILE_PATH[self.connection.target_os]] if self.interfaces: - command += ["-i", ",".join(self.interfaces)] + if self.connection.target_os != TargetOS.Windows: + command += ["-i", ",".join(self.interfaces)] + else: + # TODO(gytsto). Windump itself only supports one interface at the time, + # but it supports multiple instances of Windump without any issues, + # so there is a workaround we can do for multiple interfaces: + # - create multiple process of windump for each interface + # - when finished with dump, just combine the pcap's with `mergecap` or smth + print( + "[Warning] Currently tcpdump for windows support only 1 interface" + ) + command += ["-i", self.interfaces[0]] else: if self.connection.target_os != TargetOS.Windows: command += ["-i", "any"] else: - command += ["-i", "1", "-i", "2"] + command += ["-i", "1"] if self.count: command += ["-c", str(self.count)] @@ -77,6 +88,9 @@ def __init__( self.process = self.connection.create_process( command, + # xterm type is needed here, because Mac on default term type doesn't + # handle signals properly while `tcpdump -w file` is running, without writing + # to file, everything works fine term_type="xterm" if self.connection.target_os == TargetOS.Mac else None, )