Improve overview and experiment naming
[khatus.git] / x2 / src / awk / exe / parse_ip_addr.awk
CommitLineData
0819928a
SK
1/^[0-9]+:/ {
2 sub(":$", "", $1)
3 sub(":$", "", $2)
4 sequence = $1
5 interface = $2
75b23ff8 6 Interfaces[sequence] = interface
0819928a
SK
7}
8
9/^ +inet [0-9]/ {
10 sub("/[0-9]+", "", $2)
11 addr = $2
75b23ff8 12 Addrs[interface] = addr
0819928a
SK
13}
14
15/^ +RX: / {transfer_direction = "r"}
16/^ +TX: / {transfer_direction = "w"}
17
18/^ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+ +[0-9]+ *$/ {
19 io[interface, transfer_direction] = $1;
20}
21
22END {
23 for (seq=1; seq<=sequence; seq++) {
75b23ff8 24 interface = Interfaces[seq]
0819928a 25 label = substr(interface, 1, 1)
75b23ff8 26 addr = Addrs[interface]
0819928a 27 if (addr) {
75b23ff8
SK
28 bytes_read = io[interface, "r"]
29 bytes_written = io[interface, "w"]
0819928a 30 } else {
75b23ff8
SK
31 bytes_read = ""
32 bytes_written = ""
0819928a 33 }
75b23ff8
SK
34 output["addr" Kfs interface] = addr
35 output["bytes_read" Kfs interface] = bytes_read
36 output["bytes_written" Kfs interface] = bytes_written
37 }
38 for (key in output) {
39 print(key, output[key])
0819928a
SK
40 }
41}
This page took 0.023098 seconds and 4 git commands to generate.