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