line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::NSEC3PARAM; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
533
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
119
|
|
4
|
3
|
|
|
3
|
|
19
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
220
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: NSEC3PARAM.pm 1896 2023-01-30 12:59:25Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
22
|
use base qw(Net::DNS::RR); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
340
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Net::DNS::RR::NSEC3PARAM - DNS NSEC3PARAM resource record |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
3
|
|
|
3
|
|
24
|
use integer; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
18
|
|
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
3
|
|
118
|
use Carp; |
|
3
|
|
|
|
|
16
|
|
|
3
|
|
|
|
|
2771
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _decode_rdata { ## decode rdata from wire-format octet string |
22
|
4
|
|
|
4
|
|
17
|
my ( $self, $data, $offset ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
4
|
|
|
|
|
23
|
my $size = unpack "\@$offset x4 C", $$data; |
25
|
4
|
|
|
|
|
25
|
@{$self}{qw(algorithm flags iterations saltbin)} = unpack "\@$offset CCnx a$size", $$data; |
|
4
|
|
|
|
|
25
|
|
26
|
4
|
|
|
|
|
15
|
return; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
31
|
5
|
|
|
5
|
|
8
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
5
|
|
|
|
|
9
|
my $salt = $self->saltbin; |
34
|
5
|
|
|
|
|
8
|
return pack 'CCnCa*', @{$self}{qw(algorithm flags iterations)}, length($salt), $salt; |
|
5
|
|
|
|
|
20
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
39
|
3
|
|
|
3
|
|
5
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
3
|
|
100
|
|
|
5
|
return join ' ', $self->algorithm, $self->flags, $self->iterations, $self->salt || '-'; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
46
|
4
|
|
|
4
|
|
13
|
my ( $self, @argument ) = @_; |
47
|
|
|
|
|
|
|
|
48
|
4
|
|
|
|
|
20
|
for (qw(algorithm flags iterations)) { $self->$_( shift @argument ) } |
|
12
|
|
|
|
|
90
|
|
49
|
4
|
|
|
|
|
9
|
my $salt = shift @argument; |
50
|
4
|
100
|
|
|
|
17
|
$self->salt($salt) unless $salt eq '-'; |
51
|
3
|
|
|
|
|
11
|
return; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub algorithm { |
56
|
13
|
|
|
13
|
1
|
36
|
my ( $self, @value ) = @_; |
57
|
13
|
|
|
|
|
33
|
for (@value) { $self->{algorithm} = 0 + $_ } |
|
5
|
|
|
|
|
15
|
|
58
|
13
|
|
100
|
|
|
58
|
return $self->{algorithm} || 0; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub flags { |
63
|
10
|
|
|
10
|
1
|
838
|
my ( $self, @value ) = @_; |
64
|
10
|
|
|
|
|
17
|
for (@value) { $self->{flags} = 0 + $_ } |
|
5
|
|
|
|
|
11
|
|
65
|
10
|
|
100
|
|
|
36
|
return $self->{flags} || 0; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub iterations { |
70
|
11
|
|
|
11
|
1
|
943
|
my ( $self, @value ) = @_; |
71
|
11
|
|
|
|
|
21
|
for (@value) { $self->{iterations} = 0 + $_ } |
|
5
|
|
|
|
|
14
|
|
72
|
11
|
|
100
|
|
|
40
|
return $self->{iterations} || 0; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub salt { |
77
|
10
|
|
|
10
|
1
|
808
|
my ( $self, @value ) = @_; |
78
|
10
|
100
|
|
|
|
26
|
return unpack "H*", $self->saltbin() unless scalar @value; |
79
|
4
|
100
|
|
|
|
9
|
my @hex = map { /^"*([\dA-Fa-f]*)"*$/ || croak("corrupt hex"); $1 } @value; |
|
4
|
|
|
|
|
247
|
|
|
3
|
|
|
|
|
14
|
|
80
|
3
|
|
|
|
|
21
|
return $self->saltbin( pack "H*", join "", @hex ); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub saltbin { |
85
|
15
|
|
|
15
|
1
|
37
|
my ( $self, @value ) = @_; |
86
|
15
|
|
|
|
|
28
|
for (@value) { $self->{saltbin} = $_ } |
|
3
|
|
|
|
|
12
|
|
87
|
15
|
|
100
|
|
|
105
|
return $self->{saltbin} || ""; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
######################################## |
92
|
|
|
|
|
|
|
|
93
|
2
|
|
|
2
|
0
|
524
|
sub hashalgo { return &algorithm; } # uncoverable pod |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
######################################## |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
1; |
99
|
|
|
|
|
|
|
__END__ |