summaryrefslogtreecommitdiff
path: root/src/atime.awk
diff options
context:
space:
mode:
author杨威 <[email protected]>2020-09-28 14:31:40 +0800
committer杨威 <[email protected]>2020-09-28 14:31:40 +0800
commit1b3ff3f1f7111dfa2d774b2206ca80973c9332d6 (patch)
tree488fb2ff4ac37ab3df1de0247ef2f816c480e436 /src/atime.awk
parent5427b568de89bcca1bc5a6dcd2a5cf724704a1c3 (diff)
parent453f442a037a03b038ad67383b18e259649e94b6 (diff)
Merge branch 'dev' into 'master'v1.0.1
支持CI Closes #1 See merge request common_tools/tcpdump_mesa!1
Diffstat (limited to 'src/atime.awk')
-rw-r--r--src/atime.awk18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/atime.awk b/src/atime.awk
new file mode 100644
index 0000000..b42dec2
--- /dev/null
+++ b/src/atime.awk
@@ -0,0 +1,18 @@
+$6 ~ /^ack/ && $5 !~ /[SFR]/ {
+ # given a tcpdump ftp trace, output one line for each ack
+ # in the form
+ # <ack time> <seq no>
+ # where <ack time> is the time packet was acked (in seconds with
+ # zero at time of first packet) and <seq no> is the tcp sequence
+ # number of the ack divided by 1024 (i.e., Kbytes acked).
+ #
+ # 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
+ printf "%7.2f\t%g\n", tim-tzero, $7/1024
+ }