line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Contributed by Vince http://www.vinsworld.com/ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# $Id: DestUnreach.pm 45 2014-04-09 06:32:08Z gomor $ |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package Net::Frame::Layer::ICMPv6::DestUnreach; |
7
|
2
|
|
|
2
|
|
2092
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
4
|
|
|
2
|
|
|
|
|
79
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
63
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
10
|
use Net::Frame::Layer qw(:consts); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1142
|
|
10
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @AS = qw( |
13
|
|
|
|
|
|
|
unused |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
16
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
1
|
|
|
1
|
1
|
22
|
my $self = shift->SUPER::new( |
20
|
|
|
|
|
|
|
unused => 0, |
21
|
|
|
|
|
|
|
@_, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
194
|
return $self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 4 } |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub pack { |
30
|
1
|
|
|
1
|
1
|
7
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
1
|
50
|
|
|
|
5
|
$self->raw($self->SUPER::pack('N', $self->unused)) |
33
|
|
|
|
|
|
|
or return; |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
74
|
return $self->raw; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub unpack { |
39
|
1
|
|
|
1
|
1
|
17
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
1
|
50
|
|
|
|
7
|
my ($unused, $payload) = $self->SUPER::unpack('N a*', $self->raw) |
42
|
|
|
|
|
|
|
or return undef; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
36
|
$self->unused($unused); |
45
|
1
|
|
|
|
|
21
|
$self->payload($payload); |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
24
|
return $self; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub encapsulate { |
51
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
52
|
|
|
|
|
|
|
|
53
|
0
|
0
|
|
|
|
|
return $self->nextLayer if $self->nextLayer; |
54
|
|
|
|
|
|
|
|
55
|
0
|
0
|
|
|
|
|
if ($self->payload) { |
56
|
0
|
|
|
|
|
|
my $pLen = length($self->payload); |
57
|
0
|
0
|
|
|
|
|
if ($pLen < 40) { |
|
|
0
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
$self->payload($self->payload.("\x00" x (40 - $pLen))); |
59
|
|
|
|
|
|
|
} elsif ($pLen > 1240) { |
60
|
0
|
|
|
|
|
|
$self->payload(substr $self->payload, 0, 1240); |
61
|
|
|
|
|
|
|
} |
62
|
0
|
|
|
|
|
|
return 'IPv6'; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
return NF_LAYER_NONE; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub print { |
69
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
my $l = $self->layer; |
72
|
0
|
|
|
|
|
|
return sprintf "$l: unused:%d", $self->unused; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
__END__ |