Improve packet display formatting in test_monitor_tshark.sh
- Replace raw tab-separated values with readable format - Show 'Frame X: PLCP header (radiotap) = yes/no' instead of '1 1' - Add field labels for main capture sample packets - Show SA, DA, type, subtype, and PLCP status in readable format Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
8576960251
commit
8d607a5f66
|
|
@ -97,10 +97,13 @@ PACKET_COUNT=$(echo "$PACKET_LINES" | wc -l || echo "0")
|
|||
# Count lines with both frame.number and radiotap.present (non-empty second field)
|
||||
PLCP_COUNT=$(echo "$PACKET_LINES" | awk -F'\t' 'NF >= 2 && $1 != "" && $2 != "" && $2 != "0" && $2 != "-" {count++} END {print count+0}' || echo "0")
|
||||
|
||||
# Show sample output
|
||||
# Show sample output with better formatting
|
||||
if [ "$PACKET_COUNT" -gt 0 ]; then
|
||||
echo "Sample packets:"
|
||||
echo "$PACKET_LINES" | head -3
|
||||
echo "$PACKET_LINES" | head -5 | awk -F'\t' '{
|
||||
radiotap = ($2 == "1" || $2 == "1.0") ? "yes" : "no"
|
||||
printf " Frame %s: PLCP header (radiotap) = %s\n", $1, radiotap
|
||||
}'
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
|
@ -165,10 +168,18 @@ if [ "$FINAL_COUNT" -gt 0 ]; then
|
|||
fi
|
||||
echo ""
|
||||
|
||||
# Display sample packets
|
||||
# Display sample packets with readable format
|
||||
if [ -n "$PACKET_LINES" ] && [ "$FINAL_COUNT" -gt 0 ]; then
|
||||
echo "Sample packets (first 20):"
|
||||
echo "$PACKET_LINES" | head -20
|
||||
echo "Sample packets (first 10):"
|
||||
echo "$PACKET_LINES" | head -10 | awk -F'\t' '{
|
||||
sa = ($3 != "" && $3 != "-") ? $3 : "N/A"
|
||||
da = ($4 != "" && $4 != "-") ? $4 : "N/A"
|
||||
type = ($5 != "" && $5 != "-") ? $5 : "N/A"
|
||||
subtype = ($6 != "" && $6 != "-") ? $6 : "N/A"
|
||||
radiotap = ($8 == "1" || $8 == "1.0") ? "yes" : (($8 != "" && $8 != "-") ? "no" : "N/A")
|
||||
printf " Frame %s: SA=%s, DA=%s, type=%s/%s, PLCP=%s\n",
|
||||
$1, sa, da, type, subtype, radiotap
|
||||
}'
|
||||
echo ""
|
||||
else
|
||||
echo "(No packets captured)"
|
||||
|
|
|
|||
Loading…
Reference in New Issue