| 1 | # | ||||||||||
| 2 | # $Id: Opaque.pm 73 2015-01-14 06:42:49Z gomor $ | ||||||||||
| 3 | # | ||||||||||
| 4 | package Net::Frame::Layer::OSPF::Lsa::Opaque; | ||||||||||
| 5 | 15 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 15 | ▶ | use Net::Frame::Layer qw(:consts :subs); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 15 | our @ISA = qw(Net::Frame::Layer); | |||||||||
| 9 | |||||||||||
| 10 | 15 | our @AS = qw( | |||||||||
| 11 | data | ||||||||||
| 12 | ); | ||||||||||
| 13 | 15 | __PACKAGE__->cgBuildIndices; | |||||||||
| 14 | 15 | __PACKAGE__->cgBuildAccessorsScalar(\@AS); | |||||||||
| 15 | |||||||||||
| 16 | 15 | ▶ | use Net::Frame::Layer::OSPF qw(:consts); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 19 | shift->SUPER::new( | ||||||||||
| 20 | 1 | data => '', | |||||||||
| 21 | @_, | ||||||||||
| 22 | ); | ||||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub getLength { length(shift()->data) } | ||||||||
|
Subroutine
getLength: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 26 | |||||||||||
| 27 | 1 | ▶ | sub pack { | ||||||||
|
Subroutine
pack: called CC=2 SCAR=8.1
Pod
documented
| |||||||||||
| 28 | 1 | my $self = shift; | |||||||||
| 29 | |||||||||||
| 30 | 1 | ▶ | $self->raw($self->SUPER::pack('a*', | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | $self->data, | ||||||||||
| 32 | )) or return undef; | ||||||||||
| 33 | |||||||||||
| 34 | 0 | $self->raw; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 1 | ▶ | sub unpack { | ||||||||
|
Subroutine
unpack: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 38 | 1 | my $self = shift; | |||||||||
| 39 | |||||||||||
| 40 | 1 | ▶ | my ($data) = $self->SUPER::unpack('a*', $self->raw) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | or return undef; | ||||||||||
| 42 | |||||||||||
| 43 | 1 | $self->data($data); | |||||||||
| 44 | |||||||||||
| 45 | 1 | $self; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 0 | ▶ | sub print { | ||||||||
|
Subroutine
print: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 49 | 0 | my $self = shift; | |||||||||
| 50 | |||||||||||
| 51 | 0 | my $l = $self->layer; | |||||||||
| 52 | 0 | sprintf | |||||||||
| 53 | "$l: data:%s", | ||||||||||
| 54 | CORE::unpack('H*', $self->data), | ||||||||||
| 55 | ; | ||||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | 15 | 1; | |||||||||
| 59 | |||||||||||
| 60 | __END__ | ||||||||||