line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
43
|
|
6
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
39
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
6
|
use Net::Frame::Layer qw(:consts :subs); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
316
|
|
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
|
2
|
|
|
2
|
|
7
|
use Net::Frame::Layer::OSPF qw(:consts); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
665
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
|
|
|
|
|
|
shift->SUPER::new( |
23
|
0
|
|
|
0
|
1
|
|
lsType => 0, |
24
|
|
|
|
|
|
|
linkStateId => '0.0.0.0', |
25
|
|
|
|
|
|
|
advertisingRouter => '0.0.0.0', |
26
|
|
|
|
|
|
|
@_, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
0
|
1
|
|
sub getLength { 12 } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub pack { |
33
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
$self->raw($self->SUPER::pack('Na4a4', |
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
|
|
|
0
|
1
|
|
my $self = shift; |
45
|
|
|
|
|
|
|
|
46
|
0
|
0
|
|
|
|
|
my ($lsType, $linkStateId, $advertisingRouter, $payload) = |
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
|
|
|
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__ |