OSPF/Lls.pm

filter: Statementstmt 61.2% 19 / 31 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 100% 4 / 4 totaltotal 60.0% 27 / 45 CC 2 SCAR 8.9
CC
2
Cov
58%
unpack
6.0
new
2.0
pack
2.0
CRAP 2.4
« OSPF/Lsa/SummaryIp.pm ↑ Summary
1 #
2 # $Id: Lls.pm,v 1.1 2007/02/04 14:16:30 gomor Exp $
3 #
4 package Net::Frame::Layer::OSPF::Lls;
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 ▶use Net::Frame::Layer qw(:consts :subs);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 our @ISA = qw(Net::Frame::Layer);
10  
11 3 our @AS = qw(
12 checksum
13 dataLength
14 );
15 3 our @AA = qw(
16 tlvList
17 );
18 3 __PACKAGE__->cgBuildIndices;
19 3 __PACKAGE__->cgBuildAccessorsScalar(\@AS);
20 3 __PACKAGE__->cgBuildAccessorsScalar(\@AA);
21  
22 3 ▶use Net::Frame::Layer::OSPF qw(:consts);
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 sub new {
25 shift->SUPER::new(
26 0 ▶ checksum => 0,
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
27 dataLength => 0,
28 tlvList => [],
29 @_,
30 );
31 }
32  
33 sub pack {
34 0 ▶ my $self = shift;
Subroutine pack: not called CC=1 SCAR=6.9
Pod documented
35  
36 # $self->raw($self->SUPER::pack('nCCNNNnn a*',
37 # $self->lsAge, $self->options, $self->lsType, $self->linkStateId,
38 # inetAton($self->advertisingRouter), $self->lsSequenceNumber,
39 # $self->lsChecksum, $self->length,
40 # )) or return undef;
41  
42 0 $self->raw;
43 }
44  
45 sub unpack {
46 0 ▶ my $self = shift;
Subroutine unpack: not called CC=2 SCAR=17.9
Pod documented
47  
48 0 ▶ my ($checksum, $dataLength, $payload) =
Branch: 1 branch
BranchTrueFalseTotal
() = $self->SUPER::unpack("nn a*", $self->raw) or return undef 0 0 0
49 $self->SUPER::unpack('nn a*', $self->raw)
50 or return undef;
51  
52 0 $self->checksum($checksum);
53 0 $self->dataLength($dataLength);
54  
55 # XXX: handle TLV
56  
57 0 $self->payload($payload);
58  
59 0 $self;
60 }
61  
62 sub print {
63 0 ▶ my $self = shift;
Subroutine print: not called CC=1 SCAR=6.9
Pod documented
64  
65 0 my $l = $self->layer;
66 0 sprintf
67 "$l: checksum:0x%04x dataLength:%d",
68 $self->checksum,
69 $self->dataLength,
70 ;
71 }
72  
73 3 1;
74  
75 __END__
« OSPF/Lsa/SummaryIp.pm ↑ Summary