line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::A; |
2
|
|
|
|
|
|
|
|
3
|
25
|
|
|
25
|
|
187
|
use strict; |
|
25
|
|
|
|
|
67
|
|
|
25
|
|
|
|
|
836
|
|
4
|
25
|
|
|
25
|
|
150
|
use warnings; |
|
25
|
|
|
|
|
70
|
|
|
25
|
|
|
|
|
1388
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: A.pm 1896 2023-01-30 12:59:25Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
25
|
|
|
25
|
|
171
|
use base qw(Net::DNS::RR); |
|
25
|
|
|
|
|
79
|
|
|
25
|
|
|
|
|
2045
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Net::DNS::RR::A - DNS A resource record |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
25
|
|
|
25
|
|
185
|
use integer; |
|
25
|
|
|
|
|
57
|
|
|
25
|
|
|
|
|
162
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
20
|
430
|
|
|
430
|
|
930
|
my ( $self, $data, $offset ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
430
|
|
|
|
|
1817
|
$self->{address} = unpack "\@$offset a4", $$data; |
23
|
430
|
|
|
|
|
1104
|
return; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
28
|
489
|
|
|
489
|
|
716
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
489
|
|
|
|
|
1262
|
return pack 'a4', $self->{address}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
35
|
74
|
|
|
74
|
|
108
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
74
|
|
|
|
|
138
|
return $self->address; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
42
|
125
|
|
|
125
|
|
292
|
my ( $self, @argument ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
125
|
|
|
|
|
294
|
$self->address(@argument); |
45
|
125
|
|
|
|
|
277
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
my $pad = pack 'x4'; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub address { |
52
|
422
|
|
|
422
|
1
|
778
|
my ( $self, $addr ) = @_; |
53
|
|
|
|
|
|
|
|
54
|
422
|
100
|
|
|
|
2363
|
return join '.', unpack 'C4', $self->{address} . $pad unless defined $addr; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# Note: pack masks overlarge values, mostly without warning |
57
|
152
|
|
|
|
|
425
|
my @part = split /\./, $addr; |
58
|
152
|
|
|
|
|
273
|
my $last = pop(@part); |
59
|
152
|
|
|
|
|
948
|
return $self->{address} = pack 'C4', @part, (0) x ( 3 - @part ), $last; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
__END__ |