line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::TXT; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
57
|
use strict; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
261
|
|
4
|
8
|
|
|
8
|
|
40
|
use warnings; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
469
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: TXT.pm 1911 2023-04-17 12:30:59Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
8
|
|
|
8
|
|
50
|
use base qw(Net::DNS::RR); |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
1018
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=encoding utf8 |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Net::DNS::RR::TXT - DNS TXT resource record |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
8
|
|
|
8
|
|
54
|
use integer; |
|
8
|
|
|
|
|
23
|
|
|
8
|
|
|
|
|
68
|
|
19
|
|
|
|
|
|
|
|
20
|
8
|
|
|
8
|
|
280
|
use Carp; |
|
8
|
|
|
|
|
20
|
|
|
8
|
|
|
|
|
553
|
|
21
|
8
|
|
|
8
|
|
3071
|
use Net::DNS::Text; |
|
8
|
|
|
|
|
38
|
|
|
8
|
|
|
|
|
3568
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
25
|
7608
|
|
|
7608
|
|
11668
|
my ( $self, $data, $offset ) = @_; |
26
|
|
|
|
|
|
|
|
27
|
7608
|
|
|
|
|
11197
|
my $limit = $offset + $self->{rdlength}; |
28
|
7608
|
|
|
|
|
8728
|
my $text; |
29
|
7608
|
|
|
|
|
14164
|
my $txtdata = $self->{txtdata} = []; |
30
|
7608
|
|
|
|
|
14660
|
while ( $offset < $limit ) { |
31
|
14949
|
|
|
|
|
30204
|
( $text, $offset ) = Net::DNS::Text->decode( $data, $offset ); |
32
|
14949
|
|
|
|
|
33855
|
push @$txtdata, $text; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
7608
|
100
|
|
|
|
12644
|
croak('corrupt TXT data') unless $offset == $limit; # more or less FUBAR |
36
|
7607
|
|
|
|
|
14124
|
return; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
41
|
278
|
|
|
278
|
|
453
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
278
|
|
|
|
|
427
|
my $txtdata = $self->{txtdata}; |
44
|
278
|
|
|
|
|
457
|
return join '', map { $_->encode } @$txtdata; |
|
278
|
|
|
|
|
513
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
49
|
900
|
|
|
900
|
|
1306
|
my $self = shift; |
50
|
|
|
|
|
|
|
|
51
|
900
|
|
|
|
|
1496
|
my $txtdata = $self->{txtdata}; |
52
|
900
|
|
|
|
|
1760
|
return ( map { $_->unicode } @$txtdata ); |
|
913
|
|
|
|
|
2140
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
57
|
391
|
|
|
391
|
|
816
|
my ( $self, @argument ) = @_; |
58
|
|
|
|
|
|
|
|
59
|
391
|
|
|
|
|
660
|
$self->{txtdata} = [map { Net::DNS::Text->new($_) } @argument]; |
|
404
|
|
|
|
|
908
|
|
60
|
391
|
|
|
|
|
918
|
return; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub txtdata { |
65
|
11
|
|
|
11
|
1
|
46
|
my ( $self, @value ) = @_; |
66
|
|
|
|
|
|
|
|
67
|
11
|
100
|
|
|
|
27
|
$self->{txtdata} = [map { Net::DNS::Text->new($_) } @value] if scalar @value; |
|
2
|
|
|
|
|
5
|
|
68
|
|
|
|
|
|
|
|
69
|
11
|
|
100
|
|
|
28
|
my $txtdata = $self->{txtdata} || []; |
70
|
|
|
|
|
|
|
|
71
|
11
|
100
|
|
|
|
26
|
return ( map { $_->value } @$txtdata ) if wantarray; |
|
6
|
|
|
|
|
17
|
|
72
|
|
|
|
|
|
|
|
73
|
5
|
100
|
|
|
|
20
|
return defined(wantarray) ? join( ' ', map { $_->value } @$txtdata ) : ''; |
|
3
|
|
|
|
|
11
|
|
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
5
|
|
|
5
|
0
|
485
|
sub char_str_list { return my @txt = &txtdata } # uncoverable pod |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
__END__ |