OSPF/Lsa/Opaque.pm

filter: Statementstmt 82.7% 24 / 29 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 77.7% 7 / 9 Podpod 100% 5 / 5 totaltotal 80.8% 38 / 47 SCAR 11.3
CC
3
Cov
79%
pack
2.3
unpack
2.0
getLength
2.0
CRAP 3.1
« OSPF/Lls.pm ↑ Summary OSPF/LinkStateRequest.pm »
1 #
2 # $Id: Opaque.pm,v 1.2 2007/03/13 18:20:24 gomor Exp $
3 #
4 package Net::Frame::Layer::OSPF::Lsa::Opaque;
5 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 15 ▶use Net::Frame::Layer qw(:consts :subs);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 15 our @ISA = qw(Net::Frame::Layer);
10  
11 15 our @AS = qw(
12 data
13 );
14 15 __PACKAGE__->cgBuildIndices;
15 15 __PACKAGE__->cgBuildAccessorsScalar(\@AS);
16  
17 15 ▶use Net::Frame::Layer::OSPF qw(:consts);
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 sub new {
20 shift->SUPER::new(
21 1 ▶ data => '',
Subroutine new: called CC=1 SCAR=0.0
Pod documented
22 @_,
23 );
24 }
25  
26 0 ▶sub getLength { length(shift()->data) }
Subroutine getLength: not called CC=1 SCAR=6.9
Pod documented
27  
28 sub pack {
29 1 ▶ my $self = shift;
Subroutine pack: called CC=2 SCAR=8.1
Pod documented
30  
31 1 ▶ $self->raw($self->SUPER::pack('a*',
Branch: 1 branch
BranchTrueFalseTotal
$self->raw($self->SUPER::pack("a*", $self->data)) or return undef 1 0 1
32 $self->data,
33 )) or return undef;
34  
35 0 $self->raw;
36 }
37  
38 sub unpack {
39 1 ▶ my $self = shift;
Subroutine unpack: called CC=2 SCAR=7.0
Pod documented
40  
41 1 ▶ my ($data) = $self->SUPER::unpack('a*', $self->raw)
Branch: 1 branch
BranchTrueFalseTotal
my($data) = $self->SUPER::unpack("a*", $self->raw) or return undef 0 1 1
42 or return undef;
43  
44 1 $self->data($data);
45  
46 1 $self;
47 }
48  
49 sub print {
50 0 ▶ my $self = shift;
Subroutine print: not called CC=1 SCAR=6.9
Pod documented
51  
52 0 my $l = $self->layer;
53 0 sprintf
54 "$l: data:%s",
55 CORE::unpack('H*', $self->data),
56 ;
57 }
58  
59 15 1;
60  
61 __END__
« OSPF/Lls.pm ↑ Summary OSPF/LinkStateRequest.pm »