line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Lls.pm,v 1.2 2007/03/13 18:19:39 gomor Exp $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::OSPF::Lls; |
5
|
14
|
|
|
14
|
|
44296
|
use strict; |
|
14
|
|
|
|
|
27
|
|
|
14
|
|
|
|
|
532
|
|
6
|
14
|
|
|
14
|
|
133
|
use warnings; |
|
14
|
|
|
|
|
31
|
|
|
14
|
|
|
|
|
473
|
|
7
|
|
|
|
|
|
|
|
8
|
14
|
|
|
14
|
|
1013
|
use Net::Frame::Layer qw(:consts :subs); |
|
14
|
|
|
|
|
242591
|
|
|
14
|
|
|
|
|
8687
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @AS = qw( |
12
|
|
|
|
|
|
|
checksum |
13
|
|
|
|
|
|
|
dataLength |
14
|
|
|
|
|
|
|
rawTlv |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
our @AA = qw( |
17
|
|
|
|
|
|
|
tlvList |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
20
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
21
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AA); |
22
|
|
|
|
|
|
|
|
23
|
14
|
|
|
14
|
|
2369
|
use Net::Frame::Layer::OSPF qw(:consts); |
|
14
|
|
|
|
|
32
|
|
|
14
|
|
|
|
|
9795
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new { |
26
|
|
|
|
|
|
|
shift->SUPER::new( |
27
|
1
|
|
|
1
|
1
|
30
|
checksum => 0, |
28
|
|
|
|
|
|
|
dataLength => 0, |
29
|
|
|
|
|
|
|
tlvList => [], |
30
|
|
|
|
|
|
|
@_, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub getLength { |
35
|
|
|
|
|
|
|
#my $self = shift; |
36
|
|
|
|
|
|
|
#my $len = 4; |
37
|
|
|
|
|
|
|
#if ($self->rawTlv) { |
38
|
|
|
|
|
|
|
#$len += length($self->rawTlv); |
39
|
|
|
|
|
|
|
#} |
40
|
|
|
|
|
|
|
#print "TLV LEN: $len\n"; |
41
|
|
|
|
|
|
|
#$len; |
42
|
0
|
|
|
0
|
1
|
0
|
0; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub pack { |
46
|
1
|
|
|
1
|
1
|
257
|
my $self = shift; |
47
|
|
|
|
|
|
|
|
48
|
1
|
50
|
|
|
|
7
|
my $raw = $self->SUPER::pack('nn', $self->checksum, $self->dataLength) |
49
|
|
|
|
|
|
|
or return undef; |
50
|
|
|
|
|
|
|
|
51
|
1
|
50
|
|
|
|
55
|
if ($self->rawTlv) { |
52
|
0
|
0
|
|
|
|
0
|
$raw .= $self->SUPER::pack('a*', $self->rawTlv) |
53
|
|
|
|
|
|
|
or return undef; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
1
|
|
|
|
|
17
|
$self->raw($raw); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub unpack { |
60
|
1
|
|
|
1
|
1
|
15
|
my $self = shift; |
61
|
|
|
|
|
|
|
|
62
|
1
|
50
|
|
|
|
5
|
my ($checksum, $dataLength, $payload) = |
63
|
|
|
|
|
|
|
$self->SUPER::unpack('nn a*', $self->raw) |
64
|
|
|
|
|
|
|
or return undef; |
65
|
|
|
|
|
|
|
|
66
|
1
|
|
|
|
|
32
|
$self->checksum($checksum); |
67
|
1
|
|
|
|
|
12
|
$self->dataLength($dataLength); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# XXX: handle TLV |
70
|
1
|
|
|
|
|
10
|
$self->rawTlv($payload); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
#$self->payload($payload); |
73
|
|
|
|
|
|
|
|
74
|
1
|
|
|
|
|
9
|
$self; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub print { |
78
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
my $l = $self->layer; |
81
|
0
|
|
|
|
|
|
sprintf |
82
|
|
|
|
|
|
|
"$l: checksum:0x%04x dataLength:%d\n". |
83
|
|
|
|
|
|
|
"$l: rawTlv:%s", |
84
|
|
|
|
|
|
|
$self->checksum, |
85
|
|
|
|
|
|
|
$self->dataLength, |
86
|
|
|
|
|
|
|
CORE::unpack('H*', $self->rawTlv), |
87
|
|
|
|
|
|
|
; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__END__ |