Debian Codegraph @

bin/tcpf2xgr

raw symbols SCIP
1 #!/bin/sh
2 #
3 # tcpf2xgr -- convert full-tcp trace file to xgraph or gnuplot
4 # Usage: tcpf2xgr [-r] [-m wrap] [-s scale] TclShPath tracefile <xgraph | gnuplot> [testname]
5 #
6 PATH=$PATH:../../bin:.
7 PROGNAME=$0
8
9 while [ $# -ne 0 ] # loop over arguments
10 do
11 case $1 in
12 -[mM]) opts="$opts $1 $2"
13 shift;;
14 -[sS]) opts="$opts $1 $2"
15 shift;;
16 -[nN]) opts="$opts $1 $2"
17 shift;;
18 -[rR]) opts="$opts $1"
19 shift;;
20
21 *) break;;
22 esac
23 shift
24 done
25
26 if [ $# -lt 3 ]; then
27 echo "Usage: $PROGNAME [-m wrap] [-r] [-s scale] TclShPath tracefile <xgraph | gnuplot> testname"
28 exit 1;
29 fi
30 TCLSH=$1; shift
31 GNAME=$1
32 if [ $# -eq 3 ]; then
33 GNAME=$3;
34 fi
35 PROGDIR=`dirname $PROGNAME`
36 $TCLSH $PROGDIR/tcpfull-summarize.tcl $opts $1 $1
37 $TCLSH $PROGDIR/tcpfull-summarize.tcl $opts $1 $1.r reverse
38 $TCLSH $PROGDIR/cplot.tcl $2 $GNAME.forw \
39 $1.p "segments sent" \
40 $1.acks "acks w/data rcvd" \
41 $1.packs "pure acks rcvd" \
42 $1.d "drops" \
43 $1.es "zero-len segments sent" \
44 $1.ctrl "SYN or FIN" \
45 $1.ecn "EcnEcho ACKs" \
46 $1.cact "Cong Action" \
47 $1.sack "Acks w/SACK info" | $2 &
48
49 $TCLSH $PROGDIR/cplot.tcl $2 $GNAME.REV $1.r.p "segments sent" \
50 $1.r.acks "acks w/data rcvd" \
51 $1.r.packs "pure acks rcvd" \
52 $1.r.d "drops" \
53 $1.r.es "zero-len segments sent" \
54 $1.r.ctrl "SYN or FIN" \
55 $1.r.ecn "EcnEcho ACKs" \
56 $1.r.cact "Cong Action" \
57 $1.r.sack "Acks w/SACK info" | $2 &
58
59 sleep 2
60 rm -f $1.p $1.acks $1.packs $1.d $1.ctrl $1.es $1.ecn $1.cact $1.sack
61 rm -f $1.r.p $1.r.acks $1.r.packs $1.r.d $1.r.ctrl $1.r.es $1.r.ecn $1.r.cact $1.r.sack