OSPF/LinkStateRequest.pm

filter: Statementstmt 53.1% 17 / 32 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 44.4% 4 / 9 Podpod 100% 5 / 5 totaltotal 52.0% 26 / 50 CC 3 SCAR 11.3
CC
3
Cov
47%
pack
6.0
unpack
6.0
new
2.0
CRAP 3.1
« OSPF/Lsa/Router/Link.pm ↑ Summary OSPF/Lsa/Opaque.pm »
1 #
2 # $Id: LinkStateRequest.pm,v 1.2 2007/02/28 21:02:48 gomor Exp $
3 #
4 package Net::Frame::Layer::OSPF::LinkStateRequest;
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 lsType
13 linkStateId
14 advertisingRouter
15 );
16 3 __PACKAGE__->cgBuildIndices;
17 3 __PACKAGE__->cgBuildAccessorsScalar(\@AS);
18  
19 3 ▶use Net::Frame::Layer::OSPF qw(:consts);
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 sub new {
22 shift->SUPER::new(
23 0 ▶ lsType => 0,
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
24 linkStateId => '0.0.0.0',
25 advertisingRouter => '0.0.0.0',
26 @_,
27 );
28 }
29  
30 0 ▶sub getLength { 12 }
Subroutine getLength: not called CC=1 SCAR=6.9
Pod documented
31  
32 sub pack {
33 0 ▶ my $self = shift;
Subroutine pack: not called CC=2 SCAR=17.9
Pod documented
34  
35 0 ▶ $self->raw($self->SUPER::pack('Na4a4',
Branch: 1 branch
BranchTrueFalseTotal
$self->raw($self->SUPER::pack("Na4a4", $self->lsType, inetAton($self->linkStateId), inetAton($self->advertisingRouter))) or return undef 0 0 0
36 $self->lsType, inetAton($self->linkStateId),
37 inetAton($self->advertisingRouter),
38 )) or return undef;
39  
40 0 $self->raw;
41 }
42  
43 sub unpack {
44 0 ▶ my $self = shift;
Subroutine unpack: not called CC=2 SCAR=17.9
Pod documented
45  
46 0 ▶ my ($lsType, $linkStateId, $advertisingRouter, $payload) =
Branch: 1 branch
BranchTrueFalseTotal
() = $self->SUPER::unpack("Na4a4 a*", $self->raw) or return undef 0 0 0
47 $self->SUPER::unpack('Na4a4 a*', $self->raw)
48 or return undef;
49  
50 0 $self->lsType($lsType);
51 0 $self->linkStateId(inetNtoa($linkStateId));
52 0 $self->advertisingRouter(inetNtoa($advertisingRouter));
53  
54 0 $self->payload($payload);
55  
56 0 $self;
57 }
58  
59 sub print {
60 0 ▶ my $self = shift;
Subroutine print: not called CC=1 SCAR=6.9
Pod documented
61  
62 0 my $l = $self->layer;
63 0 sprintf "$l: lsType:0x%08x linkStateId:%s\n".
64 "$l: advertisingRouter:%s",
65 $self->lsType, $self->linkStateId, $self->advertisingRouter,
66 ;
67 }
68  
69 3 1;
70  
71 __END__
« OSPF/Lsa/Router/Link.pm ↑ Summary OSPF/Lsa/Opaque.pm »