I was considering calling the module: Net::DHCPv6::DUID::Parser;
I'd like some feedback on this please.
The DUID is described here:
http://tools.ietf.org/html/rfc3315#section-9
Here's the SYNOPSIS section from my POD:
use Net::DHCPv6::DUID::Parser;
my $p = new Net::DHCPv6::DUID::Parser;
# Decode an example DUID
$p->decode('000300010004ED9F7622');
# Print the type
print "TYPE: ".$p->type(format => 'text')."\n";
### prints 'TYPE: DUID-LL'
if ($p->type == 1 || $p->type == 3) {
# Format this like a MAC address if the link type was Ethernet
if ($p->iana_hw_type == 1) {
print "MAC ADDRESS: ".$p->local_link_address(format =>
'ethernet_mac')."\n";
} else {
print "LOCAL LINK ADDRESS: ".$p->local_link_address."\n";
}
}
### prints 'MAC ADDRESS: 00-04-ed-9f-76-22'