summaryrefslogtreecommitdiff
path: root/src/completion/list_dumpable_interfaces.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/completion/list_dumpable_interfaces.py')
-rwxr-xr-xsrc/completion/list_dumpable_interfaces.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/completion/list_dumpable_interfaces.py b/src/completion/list_dumpable_interfaces.py
new file mode 100755
index 000000000..101c92fbe
--- /dev/null
+++ b/src/completion/list_dumpable_interfaces.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python3
+
+# Extract the list of interfaces available for traffic dumps from tcpdump -D
+
+import re
+
+from vyos.util import cmd
+
+if __name__ == '__main__':
+ out = cmd('/usr/sbin/tcpdump -D').split('\n')
+ intfs = " ".join(map(lambda s: re.search(r'\d+\.(\S+)\s', s).group(1), out))
+ print(intfs)