line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::CAA; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
44
|
|
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
|
|
|
|
|
101
|
|
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
|
|
|
|
|
6
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
492
|
use Net::DNS::Text; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
588
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
22
|
1
|
|
|
1
|
|
2
|
my ( $self, $data, $offset ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
1
|
my $limit = $offset + $self->{rdlength}; |
25
|
1
|
|
|
|
|
4
|
$self->{flags} = unpack "\@$offset C", $$data; |
26
|
1
|
|
|
|
|
3
|
( $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
|
|
8
|
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
|
|
13
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
8
|
my @rdata = ( $self->flags, $self->{tag}->string, $self->{value}->string ); |
43
|
3
|
|
|
|
|
9
|
return @rdata; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
48
|
2
|
|
|
2
|
|
5
|
my ( $self, @argument ) = @_; |
49
|
|
|
|
|
|
|
|
50
|
2
|
|
|
|
|
12
|
$self->flags( shift @argument ); |
51
|
2
|
|
|
|
|
8
|
$self->tag( lc shift @argument ); |
52
|
2
|
|
|
|
|
6
|
$self->value( shift @argument ); |
53
|
2
|
|
|
|
|
5
|
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
|
|
|
|
|
25
|
for (@value) { $self->{flags} = 0 + $_ } |
|
4
|
|
|
|
|
17
|
|
68
|
14
|
|
100
|
|
|
60
|
return $self->{flags} || 0; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub critical { |
73
|
4
|
|
|
4
|
1
|
803
|
my ( $self, @value ) = @_; |
74
|
4
|
|
|
|
|
8
|
for ( $self->{flags} |= 0 ) { |
75
|
4
|
100
|
|
|
|
11
|
if ( scalar @value ) { |
76
|
2
|
|
|
|
|
4
|
$_ |= 0x0080; |
77
|
2
|
100
|
|
|
|
7
|
$_ ^= 0x0080 unless shift @value; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
4
|
|
|
|
|
17
|
return $self->{flags} & 0x0080; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub tag { |
85
|
5
|
|
|
5
|
1
|
868
|
my ( $self, @value ) = @_; |
86
|
5
|
|
|
|
|
9
|
for (@value) { $self->{tag} = Net::DNS::Text->new($_) } |
|
3
|
|
|
|
|
8
|
|
87
|
5
|
100
|
|
|
|
20
|
return $self->{tag} ? $self->{tag}->value : undef; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub value { |
92
|
5
|
|
|
5
|
1
|
812
|
my ( $self, @value ) = @_; |
93
|
5
|
|
|
|
|
9
|
for (@value) { $self->{value} = Net::DNS::Text->new($_) } |
|
3
|
|
|
|
|
7
|
|
94
|
5
|
100
|
|
|
|
18
|
return $self->{value} ? $self->{value}->value : undef; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
1; |
99
|
|
|
|
|
|
|
__END__ |