line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DNS::RR::DHCID; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
88
|
|
5
|
|
|
|
|
|
|
our $VERSION = (qw$Id: DHCID.pm 1896 2023-01-30 12:59:25Z willem $)[2]; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use base qw(Net::DNS::RR); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
98
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Net::DNS::RR::DHCID - DNS DHCID resource record |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
7
|
use integer; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
42
|
use MIME::Base64; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
540
|
|
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 $size = $self->{rdlength} - 3; |
25
|
1
|
|
|
|
|
4
|
@{$self}{qw(identifiertype digesttype digest)} = unpack "\@$offset nC a$size", $$data; |
|
1
|
|
|
|
|
4
|
|
26
|
1
|
|
|
|
|
2
|
return; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _encode_rdata { ## encode rdata as wire-format octet string |
31
|
10
|
|
|
10
|
|
13
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
10
|
|
|
|
|
19
|
return pack 'nC a*', map { $self->$_ } qw(identifiertype digesttype digest); |
|
30
|
|
|
|
|
54
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _format_rdata { ## format rdata portion of RR string. |
38
|
3
|
|
|
3
|
|
5
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
|
|
7
|
my @rdata = split /\s+/, encode_base64( $self->_encode_rdata ); |
41
|
3
|
|
|
|
|
12
|
return @rdata; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _parse_rdata { ## populate RR from rdata in argument list |
46
|
1
|
|
|
1
|
|
4
|
my ( $self, @argument ) = @_; |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
8
|
my $data = MIME::Base64::decode( join "", @argument ); |
49
|
1
|
|
|
|
|
2
|
my $size = length($data) - 3; |
50
|
1
|
|
|
|
|
7
|
@{$self}{qw(identifiertype digesttype digest)} = unpack "n C a$size", $data; |
|
1
|
|
|
|
|
11
|
|
51
|
1
|
|
|
|
|
5
|
return; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# +------------------+------------------------------------------------+ |
56
|
|
|
|
|
|
|
# | Identifier Type | Identifier | |
57
|
|
|
|
|
|
|
# | Code | | |
58
|
|
|
|
|
|
|
# +------------------+------------------------------------------------+ |
59
|
|
|
|
|
|
|
# | 0x0000 | The 1-octet 'htype' followed by 'hlen' octets | |
60
|
|
|
|
|
|
|
# | | of 'chaddr' from a DHCPv4 client's DHCPREQUEST | |
61
|
|
|
|
|
|
|
# | | [7]. | |
62
|
|
|
|
|
|
|
# | 0x0001 | The data octets (i.e., the Type and | |
63
|
|
|
|
|
|
|
# | | Client-Identifier fields) from a DHCPv4 | |
64
|
|
|
|
|
|
|
# | | client's Client Identifier option [10]. | |
65
|
|
|
|
|
|
|
# | 0x0002 | The client's DUID (i.e., the data octets of a | |
66
|
|
|
|
|
|
|
# | | DHCPv6 client's Client Identifier option [11] | |
67
|
|
|
|
|
|
|
# | | or the DUID field from a DHCPv4 client's | |
68
|
|
|
|
|
|
|
# | | Client Identifier option [6]). | |
69
|
|
|
|
|
|
|
# | 0x0003 - 0xfffe | Undefined; available to be assigned by IANA. | |
70
|
|
|
|
|
|
|
# | 0xffff | Undefined; RESERVED. | |
71
|
|
|
|
|
|
|
# +------------------+------------------------------------------------+ |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub identifiertype { |
75
|
14
|
|
|
14
|
1
|
31
|
my ( $self, @value ) = @_; |
76
|
14
|
|
|
|
|
23
|
for (@value) { $self->{identifiertype} = 0 + $_ } |
|
2
|
|
|
|
|
6
|
|
77
|
14
|
|
100
|
|
|
57
|
return $self->{identifiertype} || 0; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub digesttype { |
82
|
14
|
|
|
14
|
1
|
863
|
my ( $self, @value ) = @_; |
83
|
14
|
|
|
|
|
22
|
for (@value) { $self->{digesttype} = 0 + $_ } |
|
2
|
|
|
|
|
4
|
|
84
|
14
|
|
100
|
|
|
45
|
return $self->{digesttype} || 0; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub digest { |
89
|
14
|
|
|
14
|
1
|
846
|
my ( $self, @value ) = @_; |
90
|
14
|
|
|
|
|
24
|
for (@value) { $self->{digest} = $_ } |
|
2
|
|
|
|
|
3
|
|
91
|
14
|
|
100
|
|
|
113
|
return $self->{digest} || ""; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1; |
96
|
|
|
|
|
|
|
__END__ |