line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Echo.pm,v bc01789674fd 2019/05/23 05:51:45 gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::ICMPv6::Echo; |
5
|
2
|
|
|
2
|
|
1094
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
4
|
|
|
2
|
|
|
|
|
48
|
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
56
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
9
|
use Net::Frame::Layer qw(:consts :subs); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
744
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @AS = qw( |
11
|
|
|
|
|
|
|
identifier |
12
|
|
|
|
|
|
|
sequenceNumber |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
15
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
|
|
|
|
|
|
shift->SUPER::new( |
19
|
1
|
|
|
1
|
1
|
11
|
identifier => getRandom16bitsInt(), |
20
|
|
|
|
|
|
|
sequenceNumber => getRandom16bitsInt(), |
21
|
|
|
|
|
|
|
@_, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 4 } |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub pack { |
28
|
1
|
|
|
1
|
1
|
200
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
1
|
50
|
|
|
|
5
|
$self->raw($self->SUPER::pack('nn', |
31
|
|
|
|
|
|
|
$self->identifier, $self->sequenceNumber, |
32
|
|
|
|
|
|
|
)) or return; |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
44
|
return $self->raw; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub unpack { |
38
|
1
|
|
|
1
|
1
|
10
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
1
|
50
|
|
|
|
4
|
my ($identifier, $sequenceNumber, $payload) = |
41
|
|
|
|
|
|
|
$self->SUPER::unpack('nn a*', $self->raw) |
42
|
|
|
|
|
|
|
or return; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
23
|
$self->identifier($identifier); |
45
|
1
|
|
|
|
|
9
|
$self->sequenceNumber($sequenceNumber); |
46
|
1
|
|
|
|
|
10
|
$self->payload($payload); |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
12
|
return $self; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub print { |
52
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
my $l = $self->layer; |
55
|
0
|
|
|
|
|
|
sprintf "$l: identifier:%d sequenceNumber:%d", |
56
|
|
|
|
|
|
|
$self->identifier, $self->sequenceNumber; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |