line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: v1.pm 49 2009-05-31 13:15:34Z VinsWorldcom $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::RIPng::v1; |
5
|
6
|
|
|
6
|
|
9892
|
use strict; use warnings; |
|
6
|
|
|
6
|
|
13
|
|
|
6
|
|
|
|
|
204
|
|
|
6
|
|
|
|
|
35
|
|
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
191
|
|
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
1191
|
use Net::Frame::Layer qw(:consts :subs); |
|
6
|
|
|
|
|
116901
|
|
|
6
|
|
|
|
|
1471
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer Exporter); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
11
|
|
|
|
|
|
|
consts => [qw( |
12
|
|
|
|
|
|
|
NF_RIPNG_METRIC_INFINITY |
13
|
|
|
|
|
|
|
)], |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
our @EXPORT_OK = ( |
16
|
|
|
|
|
|
|
@{$EXPORT_TAGS{consts}}, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
6
|
|
|
6
|
|
35
|
use constant NF_RIPNG_METRIC_INFINITY => 16; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
2915
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our @AS = qw( |
22
|
|
|
|
|
|
|
prefix |
23
|
|
|
|
|
|
|
routeTag |
24
|
|
|
|
|
|
|
prefixLength |
25
|
|
|
|
|
|
|
metric |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
28
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new { |
31
|
|
|
|
|
|
|
shift->SUPER::new( |
32
|
2
|
|
|
2
|
1
|
66
|
prefix => '::', |
33
|
|
|
|
|
|
|
routeTag => 0, |
34
|
|
|
|
|
|
|
prefixLength => 64, |
35
|
|
|
|
|
|
|
metric => 1, |
36
|
|
|
|
|
|
|
@_, |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub full { |
41
|
|
|
|
|
|
|
shift->SUPER::new( |
42
|
1
|
|
|
1
|
1
|
225
|
prefix => '::', |
43
|
|
|
|
|
|
|
routeTag => 0, |
44
|
|
|
|
|
|
|
prefixLength => 0, |
45
|
|
|
|
|
|
|
metric => NF_RIPNG_METRIC_INFINITY, |
46
|
|
|
|
|
|
|
@_, |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 20 } |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub pack { |
53
|
5
|
|
|
5
|
1
|
662
|
my $self = shift; |
54
|
|
|
|
|
|
|
|
55
|
5
|
50
|
|
|
|
19
|
$self->raw($self->SUPER::pack('a16nCC', |
56
|
|
|
|
|
|
|
inet6Aton($self->prefix), |
57
|
|
|
|
|
|
|
$self->routeTag, |
58
|
|
|
|
|
|
|
$self->prefixLength, |
59
|
|
|
|
|
|
|
$self->metric |
60
|
|
|
|
|
|
|
)) or return; |
61
|
|
|
|
|
|
|
|
62
|
5
|
|
|
|
|
412
|
return $self->raw; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub unpack { |
66
|
1
|
|
|
1
|
1
|
16
|
my $self = shift; |
67
|
|
|
|
|
|
|
|
68
|
1
|
50
|
|
|
|
5
|
my ($prefix, $routeTag, $prefixLength, $metric, $payload) = |
69
|
|
|
|
|
|
|
$self->SUPER::unpack('a16nCC a*', $self->raw) |
70
|
|
|
|
|
|
|
or return; |
71
|
|
|
|
|
|
|
|
72
|
1
|
|
|
|
|
62
|
$self->prefix(inet6Ntoa($prefix)); |
73
|
1
|
|
|
|
|
31
|
$self->routeTag($routeTag); |
74
|
1
|
|
|
|
|
12
|
$self->prefixLength($prefixLength); |
75
|
1
|
|
|
|
|
11
|
$self->metric($metric); |
76
|
|
|
|
|
|
|
|
77
|
1
|
|
|
|
|
14
|
$self->payload($payload); |
78
|
|
|
|
|
|
|
|
79
|
1
|
|
|
|
|
12
|
return $self; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub encapsulate { |
83
|
1
|
|
|
1
|
1
|
7
|
my $self = shift; |
84
|
|
|
|
|
|
|
|
85
|
1
|
50
|
|
|
|
8
|
return $self->nextLayer if $self->nextLayer; |
86
|
|
|
|
|
|
|
|
87
|
1
|
50
|
|
|
|
21
|
if ($self->payload) { |
88
|
0
|
|
|
|
|
0
|
return "RIPng::v1"; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
1
|
|
|
|
|
13
|
NF_LAYER_NONE; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub print { |
95
|
5
|
|
|
5
|
1
|
533
|
my $self = shift; |
96
|
|
|
|
|
|
|
|
97
|
5
|
|
|
|
|
25
|
my $l = $self->layer; |
98
|
5
|
|
|
|
|
72
|
my $buf = sprintf |
99
|
|
|
|
|
|
|
"$l: prefix:%s\n". |
100
|
|
|
|
|
|
|
"$l: routeTag:%d prefixLength:%d metric:%d", |
101
|
|
|
|
|
|
|
$self->prefix, |
102
|
|
|
|
|
|
|
$self->routeTag, $self->prefixLength, $self->metric; |
103
|
|
|
|
|
|
|
|
104
|
5
|
|
|
|
|
1264
|
return $buf; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
1; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
__END__ |