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