diff --git a/test_monitor_tshark.sh b/test_monitor_tshark.sh index 7eef7ea..6bd7f54 100755 --- a/test_monitor_tshark.sh +++ b/test_monitor_tshark.sh @@ -211,6 +211,31 @@ if [ -n "$PACKET_LINES" ] && [ "$FINAL_COUNT" -gt 0 ]; then $1, ra, ta, type, subtype, radiotap }' echo "" + + # Count unique RA/TA pairs + echo "Unique RA/TA pairs (with counts):" + UNIQUE_PAIRS=$(echo "$PACKET_LINES" | awk -F'\t' '{ + ra = ($3 != "" && $3 != "-") ? $3 : "N/A" + ta = ($4 != "" && $4 != "-") ? $4 : "N/A" + if (ra != "N/A" || ta != "N/A") { + pair = ra " -> " ta + count[pair]++ + } + } + END { + for (pair in count) { + printf "%d\t%s\n", count[pair], pair + } + }' | sort -rn) + + if [ -n "$UNIQUE_PAIRS" ]; then + echo "$UNIQUE_PAIRS" | awk -F'\t' '{ + printf " %s: %d frame(s)\n", $2, $1 + }' + else + echo " (no valid RA/TA pairs found)" + fi + echo "" else echo "(No packets captured)" echo ""