line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
20
|
|
|
20
|
|
1313
|
use utf8; |
|
20
|
|
|
|
|
34
|
|
|
20
|
|
|
|
|
124
|
|
2
|
20
|
|
|
20
|
|
535
|
use strict; |
|
20
|
|
|
|
|
28
|
|
|
20
|
|
|
|
|
309
|
|
3
|
20
|
|
|
20
|
|
83
|
use warnings; |
|
20
|
|
|
|
|
29
|
|
|
20
|
|
|
|
|
896
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package DR::Tnt::Dumper; |
6
|
20
|
|
|
20
|
|
108
|
use base qw(Exporter); |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
2737
|
|
7
|
|
|
|
|
|
|
our @EXPORT = qw(pkt_dump dump); |
8
|
20
|
|
|
20
|
|
118
|
use constant DUMP_LINE_LEN => 16; |
|
20
|
|
|
|
|
23
|
|
|
20
|
|
|
|
|
1430
|
|
9
|
20
|
|
|
20
|
|
9074
|
use Data::Dumper; |
|
20
|
|
|
|
|
83192
|
|
|
20
|
|
|
|
|
7362
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub pkt_dump($$) { |
12
|
0
|
|
|
0
|
0
|
|
my ($name, $pkt) = @_; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
$name .= sprintf ' (%s octets)', length $pkt; |
15
|
0
|
|
|
|
|
|
my @lines; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
while (DUMP_LINE_LEN < length $pkt) { |
18
|
0
|
|
|
|
|
|
push @lines, substr $pkt, 0, DUMP_LINE_LEN, ''; |
19
|
|
|
|
|
|
|
} |
20
|
0
|
0
|
|
|
|
|
push @lines => $pkt if length $pkt; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
for (@lines) { |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
$_ = [ $_, $_ ]; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$_->[0] =~ s/(.)/sprintf '%02X ', ord $1/ges; |
|
0
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
while (length($_->[0]) < (3 * DUMP_LINE_LEN)) { |
29
|
0
|
|
|
|
|
|
$_->[0] .= ' '; |
30
|
|
|
|
|
|
|
} |
31
|
0
|
0
|
0
|
|
|
|
$_->[1] =~ s/(.)/((ord($1) >= 0x20) and (ord($1) <= 0x7F)) ? $1 : '.'/ges; |
|
0
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
$_ = "$_->[0] $_->[1]"; |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
|
return join "\n", "request $name", @lines, ""; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub dump($) { |
39
|
0
|
|
|
0
|
0
|
|
my ($o) = @_; |
40
|
0
|
|
|
|
|
|
local $Data::Dumper::Indent = 1; |
41
|
0
|
|
|
|
|
|
local $Data::Dumper::Terse = 1; |
42
|
0
|
|
|
|
|
|
local $Data::Dumper::Useqq = 1; |
43
|
0
|
|
|
|
|
|
local $Data::Dumper::Deepcopy = 1; |
44
|
0
|
|
|
|
|
|
local $Data::Dumper::Maxdepth = 0; |
45
|
0
|
|
|
|
|
|
return Data::Dumper->Dump([$o]); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|