line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Echo.pm 45 2014-04-09 06:32:08Z gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::ICMPv6::Echo; |
5
|
2
|
|
|
2
|
|
2046
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
4
|
|
|
2
|
|
|
|
|
69
|
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
64
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
9
|
use Net::Frame::Layer qw(:consts :subs); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1410
|
|
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
|
17
|
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
|
267
|
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
|
|
|
|
|
69
|
return $self->raw; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub unpack { |
38
|
1
|
|
|
1
|
1
|
14
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
1
|
50
|
|
|
|
5
|
my ($identifier, $sequenceNumber, $payload) = |
41
|
|
|
|
|
|
|
$self->SUPER::unpack('nn a*', $self->raw) |
42
|
|
|
|
|
|
|
or return; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
1224
|
$self->identifier($identifier); |
45
|
1
|
|
|
|
|
18
|
$self->sequenceNumber($sequenceNumber); |
46
|
1
|
|
|
|
|
16
|
$self->payload($payload); |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
24
|
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__ |