Skip to content

Commit d04c6a9

Browse files
burmeciadarora
authored andcommitted
chore: add ipv6 support for pg egress collection
1 parent b9e8113 commit d04c6a9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ansible/files/admin_api_scripts/pg_egress_collect.pl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,24 @@
2626

2727
# extract tcp packet length captured by tcpdump
2828
#
29-
# Sample input lines:
29+
# Sample IPv4 input lines:
3030
#
3131
# 1674013833.940253 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)
3232
# 10.112.101.122.5432 > 220.235.16.223.62599: Flags [S.], cksum 0x5de3 (incorrect -> 0x63da), seq 2314200657, ack 2071735457, win 62643, options [mss 8961,sackOK,TS val 3358598837 ecr 1277499190,nop,wscale 7], length 0
3333
# 1674013833.989257 IP (tos 0x0, ttl 64, id 24975, offset 0, flags [DF], proto TCP (6), length 52)
3434
# 10.112.101.122.5432 > 220.235.16.223.62599: Flags [.], cksum 0x5ddb (incorrect -> 0xa25b), seq 1, ack 9, win 490, options [nop,nop,TS val 3358598885 ecr 1277499232], length 0
35+
#
36+
# Sample IPv6 input lines:
37+
#
38+
# 1706483718.836526 IP6 (flowlabel 0x0bf27, hlim 64, next-header TCP (6) payload length: 125) 2406:da18:4fd:9b00:959:c52:ce68:10c8.5432 > 2406:da12:d78:f501:1273:296c:2482:c7a7.50530: Flags [P.], seq 25:118, ack 125, win 488, options [nop,nop,TS val 1026340732 ecr 1935666426], length 93
39+
# 1706483718.912083 IP6 (flowlabel 0x0bf27, hlim 64, next-header TCP (6) payload length: 501) 2406:da18:4fd:9b00:959:c52:ce68:10c8.5432 > 2406:da12:d78:f501:1273:296c:2482:c7a7.50530: Flags [P.], seq 118:587, ack 234, win 488, options [nop,nop,TS val 1026340807 ecr 1935666497], length 469
40+
# 1706483718.984001 IP6 (flowlabel 0x0bf27, hlim 64, next-header TCP (6) payload length: 151) 2406:da18:4fd:9b00:959:c52:ce68:10c8.5432 > 2406:da12:d78:f501:1273:296c:2482:c7a7.50530: Flags [P.], seq 587:706, ack 448, win 487, options [nop,nop,TS val 1026340879 ecr 1935666569], length 119
3541
sub extract_packet_length {
3642
my ($line) = @_;
3743

3844
#print("debug: >> " . $line);
3945

40-
if ($line =~ /^\s+\d+\.\d+\.\d+\.\d+\..*, length (\d+)$/) {
46+
if ($line =~ /^.*, length (\d+)$/) {
4147
# extract tcp packet length and add it up
4248
my $len = $1;
4349
$captured_len += $len;

0 commit comments

Comments
 (0)