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