line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Contributed by Vince http://www.vinsworld.com/ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# $Id: TooBig.pm,v bc01789674fd 2019/05/23 05:51:45 gomor $ |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package Net::Frame::Layer::ICMPv6::TooBig; |
7
|
2
|
|
|
2
|
|
806
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
5
|
|
|
2
|
|
|
|
|
54
|
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
47
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
8
|
use Net::Frame::Layer qw(:consts); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
799
|
|
10
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @AS = qw( |
13
|
|
|
|
|
|
|
mtu |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
16
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
1
|
|
|
1
|
1
|
20
|
my $self = shift->SUPER::new( |
20
|
|
|
|
|
|
|
mtu => 0, |
21
|
|
|
|
|
|
|
@_, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
179
|
return $self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 4 } |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub pack { |
30
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
1
|
50
|
|
|
|
4
|
$self->raw($self->SUPER::pack('N', $self->mtu)) |
33
|
|
|
|
|
|
|
or return; |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
47
|
return $self->raw; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub unpack { |
39
|
1
|
|
|
1
|
1
|
10
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
1
|
50
|
|
|
|
3
|
my ($mtu, $payload) = $self->SUPER::unpack('N a*', $self->raw) |
42
|
|
|
|
|
|
|
or return undef; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
31
|
$self->mtu($mtu); |
45
|
1
|
|
|
|
|
14
|
$self->payload($payload); |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
12
|
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: mtu:%d", $self->mtu; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
__END__ |