| 1 | 20 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 20 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 20 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | package DR::Tnt::Dumper; | ||||||||||||||||||||||||||||
| 6 | 20 | ▶ | use base qw(Exporter); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 20 | our @EXPORT = qw(pkt_dump dump); | |||||||||||||||||||||||||||
| 8 | 20 | ▶ | use constant DUMP_LINE_LEN => 16; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 20 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | sub pkt_dump($$) { | ||||||||||||||||||||||||||||
| 12 | 0 | ▶ | my ($name, $pkt) = @_; | ||||||||||||||||||||||||||
|
Subroutine
pkt_dump: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 0 | $name .= sprintf ' (%s octets)', length $pkt; | |||||||||||||||||||||||||||
| 15 | 0 | my @lines; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | while (DUMP_LINE_LEN < length $pkt) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | 0 | push @lines, substr $pkt, 0, DUMP_LINE_LEN, ''; | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | 0 | ▶ | push @lines => $pkt if length $pkt; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | for (@lines) { | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | $_ = [ $_, $_ ]; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | $_->[0] =~ s/(.)/sprintf '%02X ', ord $1/ges; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | while (length($_->[0]) < (3 * DUMP_LINE_LEN)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 0 | $_->[0] .= ' '; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | 0 | ▶ | $_->[1] =~ s/(.)/((ord($1) >= 0x20) and (ord($1) <= 0x7F)) ? $1 : '.'/ges; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ord $1 >= 32 and ord $1 <= 127
MC/DC0%0/2
ord $1 >= 32 and ord $1 <= 127
ord $1 >= 32
ord $1 <= 127
Truth table0%0/3
A and B
A= ord $1 >= 32B= ord $1 <= 127
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | $_ = "$_->[0] $_->[1]"; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | 0 | return join "\n", "request $name", @lines, ""; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | sub dump($) { | ||||||||||||||||||||||||||||
| 39 | 0 | ▶ | my ($o) = @_; | ||||||||||||||||||||||||||
|
Subroutine
dump: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 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 | 20 | 1; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||