fluffy/dumbdecode

16 lines
546 B
Plaintext
Raw Normal View History

2013-01-29 22:25:15 -07:00
#! /bin/sh
# Emulate dumbdecode.py from python netarch
# The advantage here is, after the pcat step, you're dealing with text files.
# * cache the output of pcat to speed things up a little.
# * tail -n +5000 to ignore the first 5000 lines of your cache.
# * grep the cache, use sed, awk, whatever
./pmerge "$@" | ./pcat | while read ts proto src dst payload; do
#when=$(TZ=Z date --rfc-3339=ns -d @$ts)
printf "Packet %s None: None\n" $proto
printf " %s -> %s (%s)\n" ${src%,*} ${dst%,*} "$ts"
echo $payload | ./unhex | ./hd
echo
done