line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: A.pm 49 2009-05-31 13:15:34Z VinsWorldcom $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::DNS::RR::A; |
5
|
6
|
|
|
6
|
|
35
|
use strict; use warnings; |
|
6
|
|
|
6
|
|
9
|
|
|
6
|
|
|
|
|
132
|
|
|
6
|
|
|
|
|
25
|
|
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
149
|
|
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
29
|
use Net::Frame::Layer qw(:consts :subs); |
|
6
|
|
|
|
|
17
|
|
|
6
|
|
|
|
|
969
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer Exporter); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @AS = qw( |
11
|
|
|
|
|
|
|
address |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
14
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
6
|
|
36
|
use Net::Frame::Layer::DNS; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
1347
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
|
|
|
|
|
|
shift->SUPER::new( |
20
|
1
|
|
|
1
|
1
|
24
|
address => '127.0.0.1', |
21
|
|
|
|
|
|
|
@_, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 4 } |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub pack { |
28
|
2
|
|
|
2
|
1
|
117
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
2
|
50
|
|
|
|
9
|
$self->raw($self->SUPER::pack('a4', |
31
|
|
|
|
|
|
|
inetAton($self->address) |
32
|
|
|
|
|
|
|
)) or return; |
33
|
|
|
|
|
|
|
|
34
|
2
|
|
|
|
|
95
|
return $self->raw; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub unpack { |
38
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
0
|
$self->address(inetNtoa(substr $self->raw, 0, 4)); |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
0
|
$self->payload(substr $self->raw, 4); |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
0
|
return $self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub encapsulate { |
48
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
49
|
|
|
|
|
|
|
|
50
|
0
|
0
|
|
|
|
0
|
return $self->nextLayer if $self->nextLayer; |
51
|
|
|
|
|
|
|
|
52
|
0
|
0
|
|
|
|
0
|
if ($self->payload) { |
53
|
0
|
|
|
|
|
0
|
return 'DNS::RR'; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
0
|
NF_LAYER_NONE; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub print { |
60
|
2
|
|
|
2
|
1
|
242
|
my $self = shift; |
61
|
|
|
|
|
|
|
|
62
|
2
|
|
|
|
|
10
|
my $l = $self->layer; |
63
|
2
|
|
|
|
|
26
|
my $buf = sprintf |
64
|
|
|
|
|
|
|
"$l: address:%s", |
65
|
|
|
|
|
|
|
$self->address; |
66
|
|
|
|
|
|
|
|
67
|
2
|
|
|
|
|
301
|
return $buf; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |