line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::A; |
2
|
|
|
|
|
|
|
|
3
|
25
|
|
|
25
|
|
183
|
use strict; |
|
25
|
|
|
|
|
52
|
|
|
25
|
|
|
|
|
772
|
|
4
|
25
|
|
|
25
|
|
136
|
use warnings; |
|
25
|
|
|
|
|
44
|
|
|
25
|
|
|
|
|
1306
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: A.pm 1896 2023-01-30 12:59:25Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
25
|
|
|
25
|
|
168
|
use base qw(Net::DNS::RR); |
|
25
|
|
|
|
|
56
|
|
|
25
|
|
|
|
|
1897
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Net::DNS::RR::A - DNS A resource record |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
25
|
|
|
25
|
|
169
|
use integer; |
|
25
|
|
|
|
|
54
|
|
|
25
|
|
|
|
|
145
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
20
|
449
|
|
|
449
|
|
963
|
my ( $self, $data, $offset ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
449
|
|
|
|
|
1979
|
$self->{address} = unpack "\@$offset a4", $$data; |
23
|
449
|
|
|
|
|
1091
|
return; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
28
|
489
|
|
|
489
|
|
694
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
489
|
|
|
|
|
1297
|
return pack 'a4', $self->{address}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
35
|
74
|
|
|
74
|
|
103
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
74
|
|
|
|
|
152
|
return $self->address; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
42
|
125
|
|
|
125
|
|
264
|
my ( $self, @argument ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
125
|
|
|
|
|
288
|
$self->address(@argument); |
45
|
125
|
|
|
|
|
272
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
my $pad = pack 'x4'; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub address { |
52
|
428
|
|
|
428
|
1
|
754
|
my ( $self, $addr ) = @_; |
53
|
|
|
|
|
|
|
|
54
|
428
|
100
|
|
|
|
2229
|
return join '.', unpack 'C4', $self->{address} . $pad unless defined $addr; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# Note: pack masks overlarge values, mostly without warning |
57
|
152
|
|
|
|
|
455
|
my @part = split /\./, $addr; |
58
|
152
|
|
|
|
|
301
|
my $last = pop(@part); |
59
|
152
|
|
|
|
|
897
|
return $self->{address} = pack 'C4', @part, (0) x ( 3 - @part ), $last; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
__END__ |