From e74859243042f87c4e3e6fa8e90902641d67b081 Mon Sep 17 00:00:00 2001 From: Andrew Topp Date: Sun, 9 Jun 2024 11:48:21 +1000 Subject: T6456: Convert "monitor traffic" to modern op-mode wrapper The old "monitor traffic" definition had misaligned arguments under the verbose node and manually offered the same parameter keyword in multiple positions to emulate flexible parameters. I've wrapped tcpdump for op-mode and replicated the "varargs" style from mtr.py/mtr.xml.in to present a few more parameters in a more flexible manner. Changes to the Makefile were required for recursive varargs lookup. --- op-mode-definitions/traffic-dump.xml.in | 55 +++++---------------------------- 1 file changed, 8 insertions(+), 47 deletions(-) (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/traffic-dump.xml.in b/op-mode-definitions/traffic-dump.xml.in index 76e3ddce5..e86e69736 100644 --- a/op-mode-definitions/traffic-dump.xml.in +++ b/op-mode-definitions/traffic-dump.xml.in @@ -8,7 +8,7 @@ - sudo tcpdump -i $4 + ${vyos_op_scripts_dir}/tcpdump.py $4 Monitor traffic dump from an interface @@ -16,54 +16,15 @@ - - sudo tcpdump -vvv -ne -i $4 + - Provide more detailed packets for each monitored traffic + Traffic capture options + + + - - - sudo tcpdump -vvv -ne -i $4 "${@:6}" - - Monitor traffic matching filter conditions - - - - sudo tcpdump -vvv -ne -i $4 -w $6 - - Save traffic dump from an interface to a file - - - - sudo tcpdump -vvv -ne -i $4 -w $6 "${@:8}" - - Save a dump of traffic matching filter conditions to a file - - - - - - - - sudo tcpdump -n -i $4 "${@:6}" - - Monitor traffic matching filter conditions - - - - sudo tcpdump -n -i $4 -w $6 - - Save traffic dump from an interface to a file - - - - sudo tcpdump -n -i $4 -w $6 "${@:8}" - - Save a dump of traffic matching filter conditions to a file - - - - + ${vyos_op_scripts_dir}/tcpdump.py "${@:4}" + -- cgit v1.2.3