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