line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: LinkStateRequest.pm 73 2015-01-14 06:42:49Z gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::OSPF::LinkStateRequest; |
5
|
14
|
|
|
14
|
|
6196
|
use strict; use warnings; |
|
14
|
|
|
14
|
|
23
|
|
|
14
|
|
|
|
|
511
|
|
|
14
|
|
|
|
|
72
|
|
|
14
|
|
|
|
|
20
|
|
|
14
|
|
|
|
|
456
|
|
6
|
|
|
|
|
|
|
|
7
|
14
|
|
|
14
|
|
537
|
use Net::Frame::Layer qw(:consts :subs); |
|
14
|
|
|
|
|
80311
|
|
|
14
|
|
|
|
|
3908
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @AS = qw( |
11
|
|
|
|
|
|
|
lsType |
12
|
|
|
|
|
|
|
linkStateId |
13
|
|
|
|
|
|
|
advertisingRouter |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
16
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
17
|
|
|
|
|
|
|
|
18
|
14
|
|
|
14
|
|
668
|
use Net::Frame::Layer::OSPF qw(:consts); |
|
14
|
|
|
|
|
24
|
|
|
14
|
|
|
|
|
7159
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
|
|
|
|
|
|
shift->SUPER::new( |
22
|
1
|
|
|
1
|
1
|
25
|
lsType => 0, |
23
|
|
|
|
|
|
|
linkStateId => '0.0.0.0', |
24
|
|
|
|
|
|
|
advertisingRouter => '0.0.0.0', |
25
|
|
|
|
|
|
|
@_, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 12 } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub pack { |
32
|
1
|
|
|
1
|
1
|
297
|
my $self = shift; |
33
|
|
|
|
|
|
|
|
34
|
1
|
50
|
|
|
|
6
|
$self->raw($self->SUPER::pack('Na4a4', |
35
|
|
|
|
|
|
|
$self->lsType, inetAton($self->linkStateId), |
36
|
|
|
|
|
|
|
inetAton($self->advertisingRouter), |
37
|
|
|
|
|
|
|
)) or return undef; |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
86
|
$self->raw; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub unpack { |
43
|
1
|
|
|
1
|
1
|
14
|
my $self = shift; |
44
|
|
|
|
|
|
|
|
45
|
1
|
50
|
|
|
|
5
|
my ($lsType, $linkStateId, $advertisingRouter, $payload) = |
46
|
|
|
|
|
|
|
$self->SUPER::unpack('Na4a4 a*', $self->raw) |
47
|
|
|
|
|
|
|
or return undef; |
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
|
|
42
|
$self->lsType($lsType); |
50
|
1
|
|
|
|
|
14
|
$self->linkStateId(inetNtoa($linkStateId)); |
51
|
1
|
|
|
|
|
15
|
$self->advertisingRouter(inetNtoa($advertisingRouter)); |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
|
|
14
|
$self->payload($payload); |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
|
|
7
|
$self; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub print { |
59
|
0
|
|
|
0
|
1
|
|
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
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |