| 1 | package Net::DNS::RR::DHCID; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | our $VERSION = (qw$Id: DHCID.pm 2003 2025-01-21 12:06:06Z willem $)[2]; | |||||||||||
| 6 | |||||||||||||
| 7 | 1 | ▶ | use base qw(Net::DNS::RR); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | |||||||||||||
| 10 | =head1 NAME | ||||||||||||
| 11 | |||||||||||||
| 12 | Net::DNS::RR::DHCID - DNS DHCID resource record | ||||||||||||
| 13 | |||||||||||||
| 14 | =cut | ||||||||||||
| 15 | |||||||||||||
| 16 | 1 | ▶ | use integer; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 17 | |||||||||||||
| 18 | 1 | ▶ | use MIME::Base64; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 19 | |||||||||||||
| 20 | |||||||||||||
| 21 | 3 | ▶ | sub _format_rdata { ## format rdata portion of RR string. | ||||||||||
|
Subroutine
_format_rdata: called CC=1 SCAR=0.0
| |||||||||||||
| 22 | 3 | my $self = shift; | |||||||||||
| 23 | |||||||||||||
| 24 | 3 | my @rdata = split /\s+/, encode_base64( $self->_encode_rdata ); | |||||||||||
| 25 | 3 | return @rdata; | |||||||||||
| 26 | } | ||||||||||||
| 27 | |||||||||||||
| 28 | |||||||||||||
| 29 | 3 | ▶ | sub _parse_rdata { ## populate RR from rdata in argument list | ||||||||||
|
Subroutine
_parse_rdata: called CC=1 SCAR=0.0
| |||||||||||||
| 30 | 3 | my ( $self, @argument ) = @_; | |||||||||||
| 31 | |||||||||||||
| 32 | 3 | $self->rdata( MIME::Base64::decode( join "", @argument ) ); | |||||||||||
| 33 | 3 | return; | |||||||||||
| 34 | } | ||||||||||||
| 35 | |||||||||||||
| 36 | |||||||||||||
| 37 | # +------------------+------------------------------------------------+ | ||||||||||||
| 38 | # | Identifier Type | Identifier | | ||||||||||||
| 39 | # | Code | | | ||||||||||||
| 40 | # +------------------+------------------------------------------------+ | ||||||||||||
| 41 | # | 0x0000 | The 1-octet 'htype' followed by 'hlen' octets | | ||||||||||||
| 42 | # | | of 'chaddr' from a DHCPv4 client's DHCPREQUEST | | ||||||||||||
| 43 | # | | [7]. | | ||||||||||||
| 44 | # | 0x0001 | The data octets (i.e., the Type and | | ||||||||||||
| 45 | # | | Client-Identifier fields) from a DHCPv4 | | ||||||||||||
| 46 | # | | client's Client Identifier option [10]. | | ||||||||||||
| 47 | # | 0x0002 | The client's DUID (i.e., the data octets of a | | ||||||||||||
| 48 | # | | DHCPv6 client's Client Identifier option [11] | | ||||||||||||
| 49 | # | | or the DUID field from a DHCPv4 client's | | ||||||||||||
| 50 | # | | Client Identifier option [6]). | | ||||||||||||
| 51 | # | 0x0003 - 0xfffe | Undefined; available to be assigned by IANA. | | ||||||||||||
| 52 | # | 0xffff | Undefined; RESERVED. | | ||||||||||||
| 53 | # +------------------+------------------------------------------------+ | ||||||||||||
| 54 | |||||||||||||
| 55 | 2 | ▶ | sub identifiertype { return unpack 'n', shift->{rdata} || return } | ||||||||||
|
Subroutine
identifiertype: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
+(shift())->{'rdata'} || (return)
MC/DC100%1/1
+(shift())->{'rdata'} || (return)
+(shift())->{'rdata'}
Truth table100%2/2
A
A= +(shift())->{'rdata'}
| |||||||||||||
| 56 | |||||||||||||
| 57 | 2 | ▶ | sub digesttype { return unpack 'x2C', shift->{rdata} || return } | ||||||||||
|
Subroutine
digesttype: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
+(shift())->{'rdata'} || (return)
MC/DC100%1/1
+(shift())->{'rdata'} || (return)
+(shift())->{'rdata'}
Truth table100%2/2
A
A= +(shift())->{'rdata'}
| |||||||||||||
| 58 | |||||||||||||
| 59 | 2 | ▶ | sub digest { return unpack 'x3a*', shift->{rdata} || return } | ||||||||||
|
Subroutine
digest: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
+(shift())->{'rdata'} || (return)
MC/DC100%1/1
+(shift())->{'rdata'} || (return)
+(shift())->{'rdata'}
Truth table100%2/2
A
A= +(shift())->{'rdata'}
| |||||||||||||
| 60 | |||||||||||||
| 61 | |||||||||||||
| 62 | 1 | 1; | |||||||||||
| 63 | __END__ | ||||||||||||