summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/stime.awk
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1995-10-18 08:37:01 +0000
committerderaadt <deraadt@openbsd.org>1995-10-18 08:37:01 +0000
commitdf930be708d50e9715f173caa26ffe1b7599b157 (patch)
treeaa317e49e28cb999c9cf3db7f00c20903fe6010a /usr.sbin/tcpdump/stime.awk
downloadwireguard-openbsd-df930be708d50e9715f173caa26ffe1b7599b157.tar.xz
wireguard-openbsd-df930be708d50e9715f173caa26ffe1b7599b157.zip
initial import of NetBSD tree
Diffstat (limited to 'usr.sbin/tcpdump/stime.awk')
-rw-r--r--usr.sbin/tcpdump/stime.awk21
1 files changed, 21 insertions, 0 deletions
diff --git a/usr.sbin/tcpdump/stime.awk b/usr.sbin/tcpdump/stime.awk
new file mode 100644
index 00000000000..d57968ed932
--- /dev/null
+++ b/usr.sbin/tcpdump/stime.awk
@@ -0,0 +1,21 @@
+# $NetBSD: stime.awk,v 1.2 1995/03/06 19:11:43 mycroft Exp $
+
+$6 !~ /^ack/ && $5 !~ /[SFR]/ {
+ # given a tcpdump ftp trace, output one line for each send
+ # in the form
+ # <send time> <seq no>
+ # where <send time> is the time packet was sent (in seconds with
+ # zero at time of first packet) and <seq no> is the tcp sequence
+ # number of the packet divided by 1024 (i.e., Kbytes sent).
+ #
+ # convert time to seconds
+ n = split ($1,t,":")
+ tim = t[1]*3600 + t[2]*60 + t[3]
+ if (! tzero) {
+ tzero = tim
+ OFS = "\t"
+ }
+ # get packet sequence number
+ i = index($6,":")
+ printf "%7.2f\t%g\n", tim-tzero, substr($6,1,i-1)/1024
+ }