line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: TimeExceed.pm 53 2012-01-31 20:27:06Z gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::ICMPv4::TimeExceed; |
5
|
3
|
|
|
3
|
|
8442
|
use strict; use warnings; |
|
3
|
|
|
3
|
|
6
|
|
|
3
|
|
|
|
|
113
|
|
|
3
|
|
|
|
|
17
|
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
106
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
991
|
use Net::Frame::Layer qw(:consts); |
|
3
|
|
|
|
|
108740
|
|
|
3
|
|
|
|
|
1557
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @AS = qw( |
11
|
|
|
|
|
|
|
unused |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
14
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
1
|
|
|
1
|
1
|
28
|
my $self = shift->SUPER::new( |
18
|
|
|
|
|
|
|
unused => 0, |
19
|
|
|
|
|
|
|
@_, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
264
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 4 } |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub pack { |
28
|
1
|
|
|
1
|
1
|
8
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
1
|
50
|
|
|
|
5
|
$self->raw($self->SUPER::pack('N', $self->unused)) |
31
|
|
|
|
|
|
|
or return; |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
68
|
return $self->raw; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub unpack { |
37
|
1
|
|
|
1
|
1
|
18
|
my $self = shift; |
38
|
|
|
|
|
|
|
|
39
|
1
|
50
|
|
|
|
5
|
my ($unused, $payload) = $self->SUPER::unpack('N a*', $self->raw) |
40
|
|
|
|
|
|
|
or return; |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
39
|
$self->unused($unused); |
43
|
1
|
|
|
|
|
19
|
$self->payload($payload); |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
11
|
return $self; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub encapsulate { |
49
|
1
|
|
|
1
|
1
|
362
|
my $self = shift; |
50
|
|
|
|
|
|
|
|
51
|
1
|
50
|
|
|
|
10
|
return $self->nextLayer if $self->nextLayer; |
52
|
|
|
|
|
|
|
|
53
|
1
|
50
|
|
|
|
20
|
if ($self->payload) { |
54
|
0
|
|
|
|
|
0
|
my $pLen = length($self->payload); |
55
|
0
|
0
|
|
|
|
0
|
if ($pLen < 40) { |
56
|
0
|
|
|
|
|
0
|
$self->payload($self->payload.("\x00" x (40 - $pLen))); |
57
|
|
|
|
|
|
|
} |
58
|
0
|
|
|
|
|
0
|
return 'IPv4'; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
1
|
|
|
|
|
14
|
return NF_LAYER_NONE; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub print { |
65
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
66
|
|
|
|
|
|
|
|
67
|
1
|
|
|
|
|
8
|
my $l = $self->layer; |
68
|
1
|
|
|
|
|
16
|
return sprintf "$l: unused:%d", $self->unused; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |