line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
20
|
|
|
20
|
|
1376
|
use utf8; |
|
20
|
|
|
|
|
51
|
|
|
20
|
|
|
|
|
146
|
|
2
|
20
|
|
|
20
|
|
1022
|
use strict; |
|
20
|
|
|
|
|
48
|
|
|
20
|
|
|
|
|
511
|
|
3
|
20
|
|
|
20
|
|
112
|
use warnings; |
|
20
|
|
|
|
|
55
|
|
|
20
|
|
|
|
|
1035
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package DR::Tnt::Dumper; |
6
|
20
|
|
|
20
|
|
177
|
use base qw(Exporter); |
|
20
|
|
|
|
|
61
|
|
|
20
|
|
|
|
|
3352
|
|
7
|
|
|
|
|
|
|
our @EXPORT = qw(pkt_dump dump); |
8
|
20
|
|
|
20
|
|
156
|
use constant DUMP_LINE_LEN => 16; |
|
20
|
|
|
|
|
51
|
|
|
20
|
|
|
|
|
1642
|
|
9
|
20
|
|
|
20
|
|
9101
|
use Data::Dumper; |
|
20
|
|
|
|
|
103304
|
|
|
20
|
|
|
|
|
9362
|
|
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
|
|
|
|
|
|
|
|