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