#!/bin/sh

# get-bad-sessions - extract TCP sessions to files named <isn>-<location>

# usage: get-bad-isns file... | get-bad-sessions location

location=$1
shift

while read file port1 port2 isn
do
    echo $file $port1  $port2 $isn
    tcpdump -xnr $file port $port1 and port $port2 | tcpdumpx >$isn-$location
done
