line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Lls.pm,v 1.1 2007/02/04 14:16:30 gomor Exp $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::OSPF::Lls; |
5
|
2
|
|
|
2
|
|
6
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
42
|
|
6
|
2
|
|
|
2
|
|
5
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
41
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
5
|
use Net::Frame::Layer qw(:consts :subs); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
344
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @AS = qw( |
12
|
|
|
|
|
|
|
checksum |
13
|
|
|
|
|
|
|
dataLength |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
our @AA = qw( |
16
|
|
|
|
|
|
|
tlvList |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
19
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
20
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AA); |
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
8
|
use Net::Frame::Layer::OSPF qw(:consts); |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
612
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new { |
25
|
|
|
|
|
|
|
shift->SUPER::new( |
26
|
0
|
|
|
0
|
1
|
|
checksum => 0, |
27
|
|
|
|
|
|
|
dataLength => 0, |
28
|
|
|
|
|
|
|
tlvList => [], |
29
|
|
|
|
|
|
|
@_, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub pack { |
34
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# $self->raw($self->SUPER::pack('nCCNNNnn a*', |
37
|
|
|
|
|
|
|
# $self->lsAge, $self->options, $self->lsType, $self->linkStateId, |
38
|
|
|
|
|
|
|
# inetAton($self->advertisingRouter), $self->lsSequenceNumber, |
39
|
|
|
|
|
|
|
# $self->lsChecksum, $self->length, |
40
|
|
|
|
|
|
|
# )) or return undef; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
$self->raw; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub unpack { |
46
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
my ($checksum, $dataLength, $payload) = |
49
|
|
|
|
|
|
|
$self->SUPER::unpack('nn a*', $self->raw) |
50
|
|
|
|
|
|
|
or return undef; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
$self->checksum($checksum); |
53
|
0
|
|
|
|
|
|
$self->dataLength($dataLength); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# XXX: handle TLV |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
$self->payload($payload); |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
$self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub print { |
63
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
my $l = $self->layer; |
66
|
0
|
|
|
|
|
|
sprintf |
67
|
|
|
|
|
|
|
"$l: checksum:0x%04x dataLength:%d", |
68
|
|
|
|
|
|
|
$self->checksum, |
69
|
|
|
|
|
|
|
$self->dataLength, |
70
|
|
|
|
|
|
|
; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
__END__ |