line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: SummaryIp.pm,v 1.2 2007/03/13 18:21:08 gomor Exp $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::OSPF::Lsa::SummaryIp; |
5
|
14
|
|
|
14
|
|
30273
|
use strict; |
|
14
|
|
|
|
|
29
|
|
|
14
|
|
|
|
|
630
|
|
6
|
14
|
|
|
14
|
|
76
|
use warnings; |
|
14
|
|
|
|
|
27
|
|
|
14
|
|
|
|
|
457
|
|
7
|
|
|
|
|
|
|
|
8
|
14
|
|
|
14
|
|
975
|
use Net::Frame::Layer qw(:consts :subs); |
|
14
|
|
|
|
|
120528
|
|
|
14
|
|
|
|
|
4363
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @AS = qw( |
12
|
|
|
|
|
|
|
networkMask |
13
|
|
|
|
|
|
|
metric |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
16
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
17
|
|
|
|
|
|
|
|
18
|
14
|
|
|
14
|
|
1145
|
use Net::Frame::Layer::OSPF qw(:consts); |
|
14
|
|
|
|
|
26
|
|
|
14
|
|
|
|
|
8024
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
|
|
|
|
|
|
shift->SUPER::new( |
22
|
1
|
|
|
1
|
1
|
32
|
networkMask => '255.255.255.0', |
23
|
|
|
|
|
|
|
metric => 10, |
24
|
|
|
|
|
|
|
@_, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub pack { |
29
|
1
|
|
|
1
|
1
|
264
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
1
|
50
|
|
|
|
7
|
$self->raw($self->SUPER::pack('a4N', |
32
|
|
|
|
|
|
|
inetAton($self->networkMask), $self->metric, |
33
|
|
|
|
|
|
|
)) or return undef; |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
105
|
$self->raw; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub unpack { |
39
|
1
|
|
|
1
|
1
|
15
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
1
|
50
|
|
|
|
4
|
my ($networkMask, $metric, $payload) = |
42
|
|
|
|
|
|
|
$self->SUPER::unpack('a4N a*', $self->raw) |
43
|
|
|
|
|
|
|
or return undef; |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
38
|
$self->networkMask(inetNtoa($networkMask)); |
46
|
1
|
|
|
|
|
24
|
$self->metric($metric); |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
16
|
$self->payload($payload); |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
13
|
$self; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub print { |
54
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
my $l = $self->layer; |
57
|
0
|
|
|
|
|
|
sprintf |
58
|
|
|
|
|
|
|
"$l: networkMask:%s metric:%d", |
59
|
|
|
|
|
|
|
$self->networkMask, |
60
|
|
|
|
|
|
|
$self->metric, |
61
|
|
|
|
|
|
|
; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__END__ |