line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::TXT; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
62
|
use strict; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
291
|
|
4
|
8
|
|
|
8
|
|
49
|
use warnings; |
|
8
|
|
|
|
|
24
|
|
|
8
|
|
|
|
|
513
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: TXT.pm 1911 2023-04-17 12:30:59Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
8
|
|
|
8
|
|
57
|
use base qw(Net::DNS::RR); |
|
8
|
|
|
|
|
19
|
|
|
8
|
|
|
|
|
792
|
|
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
|
|
59
|
use integer; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
64
|
|
19
|
|
|
|
|
|
|
|
20
|
8
|
|
|
8
|
|
294
|
use Carp; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
582
|
|
21
|
8
|
|
|
8
|
|
3192
|
use Net::DNS::Text; |
|
8
|
|
|
|
|
31
|
|
|
8
|
|
|
|
|
4033
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
25
|
7608
|
|
|
7608
|
|
11436
|
my ( $self, $data, $offset ) = @_; |
26
|
|
|
|
|
|
|
|
27
|
7608
|
|
|
|
|
11164
|
my $limit = $offset + $self->{rdlength}; |
28
|
7608
|
|
|
|
|
8596
|
my $text; |
29
|
7608
|
|
|
|
|
12743
|
my $txtdata = $self->{txtdata} = []; |
30
|
7608
|
|
|
|
|
13389
|
while ( $offset < $limit ) { |
31
|
14949
|
|
|
|
|
29878
|
( $text, $offset ) = Net::DNS::Text->decode( $data, $offset ); |
32
|
14949
|
|
|
|
|
33887
|
push @$txtdata, $text; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
7608
|
100
|
|
|
|
13147
|
croak('corrupt TXT data') unless $offset == $limit; # more or less FUBAR |
36
|
7607
|
|
|
|
|
13600
|
return; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
41
|
278
|
|
|
278
|
|
454
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
278
|
|
|
|
|
512
|
my $txtdata = $self->{txtdata}; |
44
|
278
|
|
|
|
|
542
|
return join '', map { $_->encode } @$txtdata; |
|
278
|
|
|
|
|
556
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
49
|
900
|
|
|
900
|
|
1330
|
my $self = shift; |
50
|
|
|
|
|
|
|
|
51
|
900
|
|
|
|
|
1417
|
my $txtdata = $self->{txtdata}; |
52
|
900
|
|
|
|
|
1726
|
return ( map { $_->unicode } @$txtdata ); |
|
913
|
|
|
|
|
2265
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
57
|
391
|
|
|
391
|
|
794
|
my ( $self, @argument ) = @_; |
58
|
|
|
|
|
|
|
|
59
|
391
|
|
|
|
|
645
|
$self->{txtdata} = [map { Net::DNS::Text->new($_) } @argument]; |
|
404
|
|
|
|
|
1050
|
|
60
|
391
|
|
|
|
|
904
|
return; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub txtdata { |
65
|
11
|
|
|
11
|
1
|
57
|
my ( $self, @value ) = @_; |
66
|
|
|
|
|
|
|
|
67
|
11
|
100
|
|
|
|
32
|
$self->{txtdata} = [map { Net::DNS::Text->new($_) } @value] if scalar @value; |
|
2
|
|
|
|
|
7
|
|
68
|
|
|
|
|
|
|
|
69
|
11
|
|
100
|
|
|
30
|
my $txtdata = $self->{txtdata} || []; |
70
|
|
|
|
|
|
|
|
71
|
11
|
100
|
|
|
|
29
|
return ( map { $_->value } @$txtdata ) if wantarray; |
|
6
|
|
|
|
|
23
|
|
72
|
|
|
|
|
|
|
|
73
|
5
|
100
|
|
|
|
21
|
return defined(wantarray) ? join( ' ', map { $_->value } @$txtdata ) : ''; |
|
3
|
|
|
|
|
12
|
|
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
5
|
|
|
5
|
0
|
691
|
sub char_str_list { return my @txt = &txtdata } # uncoverable pod |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
__END__ |