| 1 | # | ||||||||||
| 2 | # $Id: LinkStateRequest.pm 73 2015-01-14 06:42:49Z gomor $ | ||||||||||
| 3 | # | ||||||||||
| 4 | package Net::Frame::Layer::OSPF::LinkStateRequest; | ||||||||||
| 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 | lsType | ||||||||||
| 12 | linkStateId | ||||||||||
| 13 | advertisingRouter | ||||||||||
| 14 | ); | ||||||||||
| 15 | 15 | __PACKAGE__->cgBuildIndices; | |||||||||
| 16 | 15 | __PACKAGE__->cgBuildAccessorsScalar(\@AS); | |||||||||
| 17 | |||||||||||
| 18 | 15 | ▶ | use Net::Frame::Layer::OSPF qw(:consts); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | |||||||||||
| 20 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 21 | shift->SUPER::new( | ||||||||||
| 22 | 1 | lsType => 0, | |||||||||
| 23 | linkStateId => '0.0.0.0', | ||||||||||
| 24 | advertisingRouter => '0.0.0.0', | ||||||||||
| 25 | @_, | ||||||||||
| 26 | ); | ||||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub getLength { 12 } | ||||||||
|
Subroutine
getLength: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 30 | |||||||||||
| 31 | 1 | ▶ | sub pack { | ||||||||
|
Subroutine
pack: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 32 | 1 | my $self = shift; | |||||||||
| 33 | |||||||||||
| 34 | 1 | ▶ | $self->raw($self->SUPER::pack('Na4a4', | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | $self->lsType, inetAton($self->linkStateId), | ||||||||||
| 36 | inetAton($self->advertisingRouter), | ||||||||||
| 37 | )) or return undef; | ||||||||||
| 38 | |||||||||||
| 39 | 1 | $self->raw; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 1 | ▶ | sub unpack { | ||||||||
|
Subroutine
unpack: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 43 | 1 | my $self = shift; | |||||||||
| 44 | |||||||||||
| 45 | 1 | ▶ | my ($lsType, $linkStateId, $advertisingRouter, $payload) = | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | $self->SUPER::unpack('Na4a4 a*', $self->raw) | ||||||||||
| 47 | or return undef; | ||||||||||
| 48 | |||||||||||
| 49 | 1 | $self->lsType($lsType); | |||||||||
| 50 | 1 | $self->linkStateId(inetNtoa($linkStateId)); | |||||||||
| 51 | 1 | $self->advertisingRouter(inetNtoa($advertisingRouter)); | |||||||||
| 52 | |||||||||||
| 53 | 1 | $self->payload($payload); | |||||||||
| 54 | |||||||||||
| 55 | 1 | $self; | |||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | 0 | ▶ | sub print { | ||||||||
|
Subroutine
print: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 59 | 0 | my $self = shift; | |||||||||
| 60 | |||||||||||
| 61 | 0 | my $l = $self->layer; | |||||||||
| 62 | 0 | sprintf "$l: lsType:0x%08x linkStateId:%s\n". | |||||||||
| 63 | "$l: advertisingRouter:%s", | ||||||||||
| 64 | $self->lsType, $self->linkStateId, $self->advertisingRouter, | ||||||||||
| 65 | ; | ||||||||||
| 66 | } | ||||||||||
| 67 | |||||||||||
| 68 | 15 | 1; | |||||||||
| 69 | |||||||||||
| 70 | __END__ | ||||||||||