Tom Wright > Net-DHCPv6-DUID-Parser-1.01 > Net::DHCPv6::DUID::Parser

Download:
Net-DHCPv6-DUID-Parser-1.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.01   Source  

NAME ^

Net::DHCPv6::DUID::Parser - Parse DHCPv6 Unique Identifiers

SYNOPSIS ^

  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'

DESCRIPTION ^

Object oriented interface to parse RFC3315 compliant DHCPv6 Unique Identifiers (DUIDs)

This module was written for the purpose of splitting the DUID into its constituent parts, and shared here for convenience. It does some textual conversions that may save you some time.

USAGE ^

Methods

Constructor

Object Methods

Each method returns undef if it encounters a failure, or if a requested DUID component wasn't relevant to the decoded DUID type.

Warnings are emitted by default, unless turned off in the object constructor.

CREDITS ^

Mark Smith

SEE ALSO ^

http://tools.ietf.org/html/rfc3315#section-9

AUTHOR ^

Tom Wright, 2010

syntax highlighting: