line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Contributed by Vince http://www.vinsworld.com/ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# $Id: TimeExceed.pm,v bc01789674fd 2019/05/23 05:51:45 gomor $ |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package Net::Frame::Layer::ICMPv6::TimeExceed; |
7
|
2
|
|
|
2
|
|
792
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
4
|
|
|
2
|
|
|
|
|
43
|
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
88
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
11
|
use Net::Frame::Layer qw(:consts); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
797
|
|
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
|
14
|
my $self = shift->SUPER::new( |
20
|
|
|
|
|
|
|
unused => 0, |
21
|
|
|
|
|
|
|
@_, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
137
|
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->unused)) |
33
|
|
|
|
|
|
|
or return; |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
46
|
return $self->raw; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub unpack { |
39
|
1
|
|
|
1
|
1
|
11
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
1
|
50
|
|
|
|
4
|
my ($unused, $payload) = $self->SUPER::unpack('N a*', $self->raw) |
42
|
|
|
|
|
|
|
or return; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
23
|
$self->unused($unused); |
45
|
1
|
|
|
|
|
12
|
$self->payload($payload); |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
11
|
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__ |