line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: LinkStateAck.pm,v 1.2 2007/02/27 23:58:56 gomor Exp $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::OSPF::LinkStateAck; |
5
|
2
|
|
|
2
|
|
6
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
42
|
|
6
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
40
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
7
|
use Net::Frame::Layer qw(:consts :subs); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
318
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @AA = qw( |
12
|
|
|
|
|
|
|
lsaList |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
15
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsArray(\@AA); |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
8
|
use Net::Frame::Layer::OSPF qw(:consts); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
726
|
|
18
|
|
|
|
|
|
|
require Net::Frame::Layer::OSPF::Lsa; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
|
|
|
|
|
|
shift->SUPER::new( |
22
|
0
|
|
|
0
|
1
|
|
lsaList => [], |
23
|
|
|
|
|
|
|
@_, |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub pack { |
28
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
my $raw = ''; |
31
|
0
|
|
|
|
|
|
for ($self->lsaList) { |
32
|
0
|
0
|
|
|
|
|
$raw .= $_->pack or return undef; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
$self->raw($raw); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub unpack { |
39
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $payload = $self->raw; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
my @lsaList = (); |
44
|
0
|
|
|
|
|
|
while ($payload) { |
45
|
0
|
|
|
|
|
|
my $lsa = Net::Frame::Layer::OSPF::Lsa->new(raw => $payload, full => 0); |
46
|
0
|
|
|
|
|
|
$lsa->unpack; |
47
|
0
|
|
|
|
|
|
push @lsaList, $lsa; |
48
|
0
|
|
|
|
|
|
$payload = $lsa->payload; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
$self->lsaList(\@lsaList); |
52
|
0
|
|
|
|
|
|
$self->payload($payload); |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
$self; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub print { |
58
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
my $buf = ''; |
61
|
0
|
|
|
|
|
|
my $first = 1; |
62
|
0
|
|
|
|
|
|
for ($self->lsaList) { |
63
|
0
|
0
|
|
|
|
|
$buf .= "\n" unless $first; |
64
|
0
|
|
|
|
|
|
$first = 0; |
65
|
0
|
|
|
|
|
|
$buf .= $_->print; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
$buf; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |