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