line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: SummaryIp.pm,v 1.1 2007/02/04 14:16:30 gomor Exp $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::OSPF::Lsa::SummaryIp; |
5
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
44
|
|
6
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
0
|
|
|
2
|
|
|
|
|
41
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
6
|
use Net::Frame::Layer qw(:consts :subs); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
310
|
|
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
|
2
|
|
|
2
|
|
8
|
use Net::Frame::Layer::OSPF qw(:consts); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
583
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
|
|
|
|
|
|
shift->SUPER::new( |
22
|
0
|
|
|
0
|
1
|
|
networkMask => '255.255.255.0', |
23
|
|
|
|
|
|
|
metric => 10, |
24
|
|
|
|
|
|
|
@_, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub pack { |
29
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# $self->raw($self->SUPER::pack('CCnNNCCn', |
32
|
|
|
|
|
|
|
# $self->flags, $self->zero, $self->nLink, $self->linkId, $self->linkData, |
33
|
|
|
|
|
|
|
# $self->type, $self->nTos, $self->metric, |
34
|
|
|
|
|
|
|
# )) or return undef; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
$self->raw; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub unpack { |
40
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
0
|
0
|
|
|
|
|
my ($networkMask, $metric, $payload) = |
43
|
|
|
|
|
|
|
$self->SUPER::unpack('a4N a*', $self->raw) |
44
|
|
|
|
|
|
|
or return undef; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
$self->networkMask(inetNtoa($networkMask)); |
47
|
0
|
|
|
|
|
|
$self->metric($metric); |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
$self->payload($payload); |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
$self; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub print { |
55
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my $l = $self->layer; |
58
|
0
|
|
|
|
|
|
sprintf |
59
|
|
|
|
|
|
|
"$l: networkMask:%s metric:%d", |
60
|
|
|
|
|
|
|
$self->networkMask, |
61
|
|
|
|
|
|
|
$self->metric, |
62
|
|
|
|
|
|
|
; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |