Skip to content

Commit 6f6bbc1

Browse files
committed
add some notes
1 parent 40b57fc commit 6f6bbc1

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

nat-lab/tests/utils/tcpdump.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,23 @@ def __init__(
5353
command += ["-w", PCAP_FILE_PATH[self.connection.target_os]]
5454

5555
if self.interfaces:
56-
command += ["-i", ",".join(self.interfaces)]
56+
if self.connection.target_os != TargetOS.Windows:
57+
command += ["-i", ",".join(self.interfaces)]
58+
else:
59+
# TODO(gytsto). Windump itself only supports one interface at the time,
60+
# but it supports multiple instances of Windump without any issues,
61+
# so there is a workaround we can do for multiple interfaces:
62+
# - create multiple process of windump for each interface
63+
# - when finished with dump, just combine the pcap's with `mergecap` or smth
64+
print(
65+
"[Warning] Currently tcpdump for windows support only 1 interface"
66+
)
67+
command += ["-i", self.interfaces[0]]
5768
else:
5869
if self.connection.target_os != TargetOS.Windows:
5970
command += ["-i", "any"]
6071
else:
61-
command += ["-i", "1", "-i", "2"]
72+
command += ["-i", "1"]
6273

6374
if self.count:
6475
command += ["-c", str(self.count)]
@@ -77,6 +88,9 @@ def __init__(
7788

7889
self.process = self.connection.create_process(
7990
command,
91+
# xterm type is needed here, because Mac on default term type doesn't
92+
# handle signals properly while `tcpdump -w file` is running, without writing
93+
# to file, everything works fine
8094
term_type="xterm" if self.connection.target_os == TargetOS.Mac else None,
8195
)
8296

0 commit comments

Comments
 (0)