ISC DHCPDv6 lease decoder

Did you ever think about what the ISC DHCPDv6 lease file’s server-duid, ia-na and ia-pd strings would decode into?
I have wondered about that so I have made a decoder/converter to do the job as I am currently investigating how to come up with a fix for https://redmine.pfsense.org/issues/4206.
The decoder does not check for invalid input such as e.g. non-ascii or “, but just makes sure that you can convert the lease file strings.
You can download the JavaScript file here.

Below you can try it out.

Please enter the “mostly” octal numeral encoded ISC DHCPDv6 lease string without starting and trailing apostrophes (“)
Example:

\"\021\0003\000\003\000\001\000\021\"3DU


Please select below whether your string includes only DUID or also an IAID (IAID+DUID)
and whether the ISC DHCPDv6 server runs in a system using Little-endian or not (Big-endian).

IAID+DUID:
Little-endian*:

Hex:


Decimal:


IAID*:


DUID**:


Click here for more converters

*) Assuming that IAID is stored differently in the lease file depending on the CPU using Little- or Big-endian. Read: I am not sure.
Wireshark shows that IAID is mirrored if you use an Intel CPU and are not converting for Endianness. See this wiki page about Endianness.
**) Minimum length with respect to DUID-LL (type 3).
Some relevant RFC’s:
RFC 3633
RFC 3315
RFC 2460

“quotify_buf” method in ISC DHCP

Vejen ud er vejen hjem