line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Link.pm 73 2015-01-14 06:42:49Z gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::OSPF::Lsa::Router::Link; |
5
|
14
|
|
|
14
|
|
7017
|
use strict; use warnings; |
|
14
|
|
|
14
|
|
22
|
|
|
14
|
|
|
|
|
498
|
|
|
14
|
|
|
|
|
67
|
|
|
14
|
|
|
|
|
16
|
|
|
14
|
|
|
|
|
448
|
|
6
|
|
|
|
|
|
|
|
7
|
14
|
|
|
14
|
|
531
|
use Net::Frame::Layer qw(:consts :subs); |
|
14
|
|
|
|
|
54597
|
|
|
14
|
|
|
|
|
3451
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @AS = qw( |
11
|
|
|
|
|
|
|
linkId |
12
|
|
|
|
|
|
|
linkData |
13
|
|
|
|
|
|
|
type |
14
|
|
|
|
|
|
|
nTos |
15
|
|
|
|
|
|
|
metric |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
18
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
19
|
|
|
|
|
|
|
|
20
|
14
|
|
|
14
|
|
604
|
use Net::Frame::Layer::OSPF qw(:consts); |
|
14
|
|
|
|
|
22
|
|
|
14
|
|
|
|
|
7212
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
|
|
|
|
|
|
shift->SUPER::new( |
24
|
1
|
|
|
1
|
1
|
30
|
linkId => '0.0.0.0', |
25
|
|
|
|
|
|
|
linkData => '0.0.0.0', |
26
|
|
|
|
|
|
|
type => 0, |
27
|
|
|
|
|
|
|
nTos => 0, |
28
|
|
|
|
|
|
|
metric => 0, |
29
|
|
|
|
|
|
|
@_, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 12 } |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub pack { |
36
|
1
|
|
|
1
|
1
|
331
|
my $self = shift; |
37
|
|
|
|
|
|
|
|
38
|
1
|
50
|
|
|
|
7
|
$self->raw($self->SUPER::pack('a4a4CCn', |
39
|
|
|
|
|
|
|
inetAton($self->linkId), inetAton($self->linkData), $self->type, |
40
|
|
|
|
|
|
|
$self->nTos, $self->metric, |
41
|
|
|
|
|
|
|
)) or return undef; |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
|
|
143
|
$self->raw; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub unpack { |
47
|
1
|
|
|
1
|
1
|
15
|
my $self = shift; |
48
|
|
|
|
|
|
|
|
49
|
1
|
50
|
|
|
|
5
|
my ($linkId, $linkData, $type, $nTos, $metric, $payload) |
50
|
|
|
|
|
|
|
= $self->SUPER::unpack('a4a4CCn a*', $self->raw) |
51
|
|
|
|
|
|
|
or return undef; |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
|
|
46
|
$self->linkId(inetNtoa($linkId)); |
54
|
1
|
|
|
|
|
27
|
$self->linkData(inetNtoa($linkData)); |
55
|
1
|
|
|
|
|
17
|
$self->type($type); |
56
|
1
|
|
|
|
|
12
|
$self->nTos($nTos); |
57
|
1
|
|
|
|
|
11
|
$self->metric($metric); |
58
|
|
|
|
|
|
|
|
59
|
1
|
|
|
|
|
18
|
$self->payload($payload); |
60
|
|
|
|
|
|
|
|
61
|
1
|
|
|
|
|
11
|
$self; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub print { |
65
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
my $l = $self->layer; |
68
|
0
|
|
|
|
|
|
sprintf |
69
|
|
|
|
|
|
|
"$l: linkId:%s linkData:%s type:0x%02x nTos:%d metric:%d", |
70
|
|
|
|
|
|
|
$self->linkId, |
71
|
|
|
|
|
|
|
$self->linkData, |
72
|
|
|
|
|
|
|
$self->type, |
73
|
|
|
|
|
|
|
$self->nTos, |
74
|
|
|
|
|
|
|
$self->metric, |
75
|
|
|
|
|
|
|
; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__END__ |