line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: LinkStateRequest.pm,v 1.3 2007/03/13 18:18:21 gomor Exp $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::OSPF::LinkStateRequest; |
5
|
14
|
|
|
14
|
|
6646
|
use strict; |
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
543
|
|
6
|
14
|
|
|
14
|
|
84
|
use warnings; |
|
14
|
|
|
|
|
5019
|
|
|
14
|
|
|
|
|
544
|
|
7
|
|
|
|
|
|
|
|
8
|
14
|
|
|
14
|
|
918
|
use Net::Frame::Layer qw(:consts :subs); |
|
14
|
|
|
|
|
87832
|
|
|
14
|
|
|
|
|
4463
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @AS = qw( |
12
|
|
|
|
|
|
|
lsType |
13
|
|
|
|
|
|
|
linkStateId |
14
|
|
|
|
|
|
|
advertisingRouter |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
17
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
18
|
|
|
|
|
|
|
|
19
|
14
|
|
|
14
|
|
883
|
use Net::Frame::Layer::OSPF qw(:consts); |
|
14
|
|
|
|
|
30
|
|
|
14
|
|
|
|
|
9151
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
|
|
|
|
|
|
shift->SUPER::new( |
23
|
1
|
|
|
1
|
1
|
27
|
lsType => 0, |
24
|
|
|
|
|
|
|
linkStateId => '0.0.0.0', |
25
|
|
|
|
|
|
|
advertisingRouter => '0.0.0.0', |
26
|
|
|
|
|
|
|
@_, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 12 } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub pack { |
33
|
1
|
|
|
1
|
1
|
266
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
1
|
50
|
|
|
|
6
|
$self->raw($self->SUPER::pack('Na4a4', |
36
|
|
|
|
|
|
|
$self->lsType, inetAton($self->linkStateId), |
37
|
|
|
|
|
|
|
inetAton($self->advertisingRouter), |
38
|
|
|
|
|
|
|
)) or return undef; |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
105
|
$self->raw; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub unpack { |
44
|
1
|
|
|
1
|
1
|
13
|
my $self = shift; |
45
|
|
|
|
|
|
|
|
46
|
1
|
50
|
|
|
|
4
|
my ($lsType, $linkStateId, $advertisingRouter, $payload) = |
47
|
|
|
|
|
|
|
$self->SUPER::unpack('Na4a4 a*', $self->raw) |
48
|
|
|
|
|
|
|
or return undef; |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
32
|
$self->lsType($lsType); |
51
|
1
|
|
|
|
|
15
|
$self->linkStateId(inetNtoa($linkStateId)); |
52
|
1
|
|
|
|
|
22
|
$self->advertisingRouter(inetNtoa($advertisingRouter)); |
53
|
|
|
|
|
|
|
|
54
|
1
|
|
|
|
|
20
|
$self->payload($payload); |
55
|
|
|
|
|
|
|
|
56
|
1
|
|
|
|
|
11
|
$self; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub print { |
60
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
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
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |