xref: /netbsd-src/external/bsd/tcpdump/dist/stime.awk (revision d881c4745d72e49290b2df21fa0730ed970a047e)
1*0f74e101Schristos$6 !~ /^ack/ && $5 !~ /[SFR]/	{
2*0f74e101Schristos	# given a tcpdump ftp trace, output one line for each send
3*0f74e101Schristos	# in the form
4*0f74e101Schristos	#   <send time> <seq no>
5*0f74e101Schristos	# where <send time> is the time packet was sent (in seconds with
6*0f74e101Schristos	# zero at time of first packet) and <seq no> is the tcp sequence
7*0f74e101Schristos	# number of the packet divided by 1024 (i.e., Kbytes sent).
8*0f74e101Schristos	#
9*0f74e101Schristos	# convert time to seconds
10*0f74e101Schristos	n = split ($1,t,":")
11*0f74e101Schristos	tim = t[1]*3600 + t[2]*60 + t[3]
12*0f74e101Schristos	if (! tzero) {
13*0f74e101Schristos		tzero = tim
14*0f74e101Schristos		OFS = "\t"
15*0f74e101Schristos	}
16*0f74e101Schristos	# get packet sequence number
17*0f74e101Schristos	i = index($6,":")
18*0f74e101Schristos	printf "%7.2f\t%g\n", tim-tzero, substr($6,1,i-1)/1024
19*0f74e101Schristos	}
20