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