fluffy/dumbdecode

18 lines
558 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
2020-09-21 14:50:56 -06:00
pmerge "$@" | pcat | while read ts proto src dst opts payload; do
2018-06-11 17:57:35 -06:00
when=$(TZ=Z date -d @${ts%.*} "+%Y-%m-%d %H:%M:%S")
2013-01-29 22:25:15 -07:00
printf "Packet %s None: None\n" $proto
2018-06-11 17:57:35 -06:00
printf " %s -> %s (%s)\n" ${src%,*} ${dst%,*} "$when"
2020-09-21 14:50:56 -06:00
echo $payload | unhex | hd
2013-01-29 22:25:15 -07:00
echo
2018-06-11 17:57:35 -06:00
done