line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::A; |
2
|
|
|
|
|
|
|
|
3
|
25
|
|
|
25
|
|
186
|
use strict; |
|
25
|
|
|
|
|
51
|
|
|
25
|
|
|
|
|
811
|
|
4
|
25
|
|
|
25
|
|
145
|
use warnings; |
|
25
|
|
|
|
|
98
|
|
|
25
|
|
|
|
|
1323
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: A.pm 1896 2023-01-30 12:59:25Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
25
|
|
|
25
|
|
218
|
use base qw(Net::DNS::RR); |
|
25
|
|
|
|
|
54
|
|
|
25
|
|
|
|
|
1912
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Net::DNS::RR::A - DNS A resource record |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
25
|
|
|
25
|
|
163
|
use integer; |
|
25
|
|
|
|
|
85
|
|
|
25
|
|
|
|
|
138
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
20
|
448
|
|
|
448
|
|
954
|
my ( $self, $data, $offset ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
448
|
|
|
|
|
1512
|
$self->{address} = unpack "\@$offset a4", $$data; |
23
|
448
|
|
|
|
|
1011
|
return; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
28
|
489
|
|
|
489
|
|
726
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
489
|
|
|
|
|
1336
|
return pack 'a4', $self->{address}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
35
|
74
|
|
|
74
|
|
104
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
74
|
|
|
|
|
131
|
return $self->address; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
42
|
125
|
|
|
125
|
|
253
|
my ( $self, @argument ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
125
|
|
|
|
|
273
|
$self->address(@argument); |
45
|
125
|
|
|
|
|
265
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
my $pad = pack 'x4'; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub address { |
52
|
427
|
|
|
427
|
1
|
782
|
my ( $self, $addr ) = @_; |
53
|
|
|
|
|
|
|
|
54
|
427
|
100
|
|
|
|
2333
|
return join '.', unpack 'C4', $self->{address} . $pad unless defined $addr; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# Note: pack masks overlarge values, mostly without warning |
57
|
152
|
|
|
|
|
432
|
my @part = split /\./, $addr; |
58
|
152
|
|
|
|
|
249
|
my $last = pop(@part); |
59
|
152
|
|
|
|
|
975
|
return $self->{address} = pack 'C4', @part, (0) x ( 3 - @part ), $last; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
__END__ |