LLTD/RecveeDesc.pm

filter: Statementstmt 87.8% 29 / 33 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 100% 5 / 5 totaltotal 84.0% 42 / 50 CC 3 SCAR 4.7
CC
3
Cov
84%
pack
2.0
unpack
2.0
getLength
2.0
CRAP 1.6
« LLTD/EmiteeDesc.pm ↑ Summary
1 #
2 # $Id: RecveeDesc.pm 12 2015-01-14 06:29:59Z gomor $
3 #
4 package Net::Frame::Layer::LLTD::RecveeDesc;
5 10 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 10 ▶use Net::Frame::Layer qw(:consts :subs);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 10 our @ISA = qw(Net::Frame::Layer);
9  
10 10 our @AS = qw(
11 type
12 realSourceAddress
13 sourceAddress
14 destinationAddress
15 );
16 10 __PACKAGE__->cgBuildIndices;
17 10 __PACKAGE__->cgBuildAccessorsScalar(\@AS);
18  
19 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
20 shift->SUPER::new(
21 1 type => 0,
22 realSourceAddress => 'ff:ff:ff:ff:ff:ff',
23 sourceAddress => 'ff:ff:ff:ff:ff:ff',
24 destinationAddress => 'ff:ff:ff:ff:ff:ff',
25 @_,
26 );
27 }
28  
29 0 ▶sub getLength { 20 }
Subroutine getLength: not called CC=1 SCAR=6.9
Pod documented
30  
31 1 ▶sub pack {
Subroutine pack: called CC=2 SCAR=7.0
Pod documented
32 1 my $self = shift;
33  
34 1 (my $realSourceAddress = $self->realSourceAddress) =~ s/://g;
35 1 (my $sourceAddress = $self->sourceAddress) =~ s/://g;
36 1 (my $destinationAddress = $self->destinationAddress) =~ s/://g;
37  
38 1 ▶ $self->raw($self->SUPER::pack('nH12H12H12',
Branch: 1 branch
BranchTrueFalseTotal
$self->raw($self->SUPER::pack("nH12H12H12", $self->type, $realSourceAddress, $sourceAddress, $destinationAddress)) or return undef 1 0 1
39 $self->type,
40 $realSourceAddress,
41 $sourceAddress,
42 $destinationAddress,
43 )) or return undef;
44  
45 1 $self->raw;
46 }
47  
48 1 ▶sub unpack {
Subroutine unpack: called CC=2 SCAR=7.0
Pod documented
49 1 my $self = shift;
50  
51 1 ▶ my ($type, $realMac, $srcMac, $dstMac, $payload) =
Branch: 1 branch
BranchTrueFalseTotal
() = $self->SUPER::unpack("nH12H12H12 a*", $self->raw) or return undef 1 0 1
52 $self->SUPER::unpack('nH12H12H12 a*', $self->raw)
53 or return undef;
54  
55 1 $self->type($type);
56 1 $self->realSourceAddress(convertMac($realMac));
57 1 $self->sourceAddress(convertMac($srcMac));
58 1 $self->destinationAddress(convertMac($dstMac));
59  
60 1 $self->payload($payload);
61  
62 1 $self;
63 }
64  
65 0 ▶sub print {
Subroutine print: not called CC=1 SCAR=6.9
Pod documented
66 0 my $self = shift;
67  
68 0 my $l = $self->layer;
69 0 sprintf
70 "$l: type:%02x realSourceAddress: %s\n".
71 "$l: sourceAddress: %s\n".
72 "$l: destinationAddress: %s",
73 $self->type,
74 $self->realSourceAddress,
75 $self->sourceAddress,
76 $self->destinationAddress;
77 }
78  
79 10 1;
80  
81 __END__
« LLTD/EmiteeDesc.pm ↑ Summary