line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Contributed by Vince http://www.vinsworld.com/ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# $Id: TimeExceed.pm,v b9194b248a66 2017/10/06 16:26:50 gomor $ |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package Net::Frame::Layer::ICMPv6::TimeExceed; |
7
|
2
|
|
|
2
|
|
746
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
6
|
|
|
2
|
|
|
|
|
55
|
|
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
62
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
13
|
use Net::Frame::Layer qw(:consts); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
899
|
|
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
|
|
|
|
|
215
|
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
|
|
|
|
5
|
$self->raw($self->SUPER::pack('N', $self->unused)) |
33
|
|
|
|
|
|
|
or return; |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
54
|
return $self->raw; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub unpack { |
39
|
1
|
|
|
1
|
1
|
16
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
1
|
50
|
|
|
|
5
|
my ($unused, $payload) = $self->SUPER::unpack('N a*', $self->raw) |
42
|
|
|
|
|
|
|
or return; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
34
|
$self->unused($unused); |
45
|
1
|
|
|
|
|
17
|
$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: unused:%d", $self->unused; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
__END__ |