line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::CAA; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
45
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: CAA.pm 1910 2023-03-30 19:16:30Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base qw(Net::DNS::RR); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
114
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Net::DNS::RR::CAA - DNS CAA resource record |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
7
|
use integer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
534
|
use Net::DNS::Text; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
595
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
22
|
1
|
|
|
1
|
|
2
|
my ( $self, $data, $offset ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
2
|
my $limit = $offset + $self->{rdlength}; |
25
|
1
|
|
|
|
|
39
|
$self->{flags} = unpack "\@$offset C", $$data; |
26
|
1
|
|
|
|
|
5
|
( $self->{tag}, $offset ) = Net::DNS::Text->decode( $data, $offset + 1 ); |
27
|
1
|
|
|
|
|
4
|
$self->{value} = Net::DNS::Text->decode( $data, $offset, $limit - $offset ); |
28
|
1
|
|
|
|
|
3
|
return; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
33
|
5
|
|
|
5
|
|
12
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
5
|
|
|
|
|
10
|
return pack 'C a* a*', $self->flags, $self->{tag}->encode, $self->{value}->raw; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
40
|
3
|
|
|
3
|
|
4
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
7
|
my @rdata = ( $self->flags, $self->{tag}->string, $self->{value}->string ); |
43
|
3
|
|
|
|
|
14
|
return @rdata; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
48
|
2
|
|
|
2
|
|
13
|
my ( $self, @argument ) = @_; |
49
|
|
|
|
|
|
|
|
50
|
2
|
|
|
|
|
6
|
$self->flags( shift @argument ); |
51
|
2
|
|
|
|
|
9
|
$self->tag( lc shift @argument ); |
52
|
2
|
|
|
|
|
6
|
$self->value( shift @argument ); |
53
|
2
|
|
|
|
|
4
|
return; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _defaults { ## specify RR attribute default values |
58
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
59
|
|
|
|
|
|
|
|
60
|
1
|
|
|
|
|
3
|
$self->flags(0); |
61
|
1
|
|
|
|
|
3
|
return; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub flags { |
66
|
14
|
|
|
14
|
1
|
36
|
my ( $self, @value ) = @_; |
67
|
14
|
|
|
|
|
23
|
for (@value) { $self->{flags} = 0 + $_ } |
|
4
|
|
|
|
|
19
|
|
68
|
14
|
|
100
|
|
|
65
|
return $self->{flags} || 0; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub critical { |
73
|
4
|
|
|
4
|
1
|
825
|
my ( $self, @value ) = @_; |
74
|
4
|
|
|
|
|
8
|
for ( $self->{flags} |= 0 ) { |
75
|
4
|
100
|
|
|
|
13
|
if ( scalar @value ) { |
76
|
2
|
|
|
|
|
4
|
$_ |= 0x0080; |
77
|
2
|
100
|
|
|
|
7
|
$_ ^= 0x0080 unless shift @value; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
4
|
|
|
|
|
19
|
return $self->{flags} & 0x0080; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub tag { |
85
|
5
|
|
|
5
|
1
|
863
|
my ( $self, @value ) = @_; |
86
|
5
|
|
|
|
|
9
|
for (@value) { $self->{tag} = Net::DNS::Text->new($_) } |
|
3
|
|
|
|
|
10
|
|
87
|
5
|
100
|
|
|
|
18
|
return $self->{tag} ? $self->{tag}->value : undef; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub value { |
92
|
5
|
|
|
5
|
1
|
828
|
my ( $self, @value ) = @_; |
93
|
5
|
|
|
|
|
9
|
for (@value) { $self->{value} = Net::DNS::Text->new($_) } |
|
3
|
|
|
|
|
7
|
|
94
|
5
|
100
|
|
|
|
17
|
return $self->{value} ? $self->{value}->value : undef; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
1; |
99
|
|
|
|
|
|
|
__END__ |