line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Echo.pm,v b9194b248a66 2017/10/06 16:26:50 gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::ICMPv6::Echo; |
5
|
2
|
|
|
2
|
|
1214
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
6
|
|
|
2
|
|
|
|
|
75
|
|
|
2
|
|
|
|
|
17
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
93
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
17
|
use Net::Frame::Layer qw(:consts :subs); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
1127
|
|
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
|
13
|
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
|
277
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
1
|
50
|
|
|
|
4
|
$self->raw($self->SUPER::pack('nn', |
31
|
|
|
|
|
|
|
$self->identifier, $self->sequenceNumber, |
32
|
|
|
|
|
|
|
)) or return; |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
65
|
return $self->raw; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub unpack { |
38
|
1
|
|
|
1
|
1
|
15
|
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
|
|
|
|
|
34
|
$self->identifier($identifier); |
45
|
1
|
|
|
|
|
16
|
$self->sequenceNumber($sequenceNumber); |
46
|
1
|
|
|
|
|
16
|
$self->payload($payload); |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
19
|
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__ |