658,8 → 658,20 |
echo sprintf("%-32s %s\n", "Custom data block4 (14 bit):", "[0x$custom_block4]"); |
echo sprintf("%-32s %s\n", "Custom data block5 (48 bit):", "[0x$custom_block5]"); |
|
// Check if Custom UUIDv8 is likely an OIDplus 2.0 System UUID |
// Details here: https://github.com/danielmarschall/oidplus/blob/master/doc/oidplus_custom_guid.md |
if (($custom_block4 == '0000') && (strtolower($custom_block5) == '1890afd80709')) { |
echo "\n<u>Interpretation of <a href=\"https://github.com/danielmarschall/oidplus/blob/master/doc/oidplus_custom_guid.md\">OIDplus 2.0 System UUID</a></u>\n\n"; |
|
echo sprintf("%-32s %s\n", "System ID:", "[0x$custom_block1] ".hexdec($custom_block1)); |
echo sprintf("%-32s %s\n", "Creation time:", "[0x$custom_block2] ".($custom_block2 == '0000' ? 'Unknown' : date('Y-m-d', hexdec($custom_block2)*24*60*60))); |
echo sprintf("%-32s %s\n", "Reserved:", "[0x$custom_block3]"); |
echo sprintf("%-32s %s\n", "Namespace:", "[0x$custom_block4] 0=System"); |
echo sprintf("%-32s %s\n", "Object ID hash:", "[0x$custom_block5] SHA1('') = ????????????????????????????$custom_block5"); |
} else { |
// Check if Custom UUIDv8 is likely an OIDplus 2.0 Information Object UUID |
// Details here: https://github.com/danielmarschall/oidplus/blob/master/doc/oidplus_custom_guid.md |
// NOTE: Actually, the date 0x0000 is OK for objects which have an unknown creation date. However, we disallow it, otherwise there is a risk that Non-OIDplus UUID gets confused with OIDplus UUIDs |
$min_day = 14610; // 1 Jan 2010 |
$max_day = floor(time()/24/60/60); // Today |
if (($custom_block3 == '000') && (hexdec($custom_block2) >= $min_day) && (hexdec($custom_block2) <= $max_day)) { |
688,16 → 700,17 |
); |
$namespace_desc = 'Unknown object type'; |
foreach ($known_objecttype_plugins as $oid => $name) { |
if ((hexdec(substr(sha1($oid),-4)) & 0x3fff) == hexdec($custom_block4)) $namespace_desc = $name; |
if ((hexdec(substr(sha1($oid),-4)) & 0x3fff) == hexdec($custom_block4)) $namespace_desc = "$oid = $name"; |
} |
|
echo sprintf("%-32s %s\n", "System ID:", "[0x$custom_block1] ".hexdec($custom_block1)); |
echo sprintf("%-32s %s\n", "Creation time:", "[0x$custom_block2] ".date('Y-m-d', hexdec($custom_block2)*24*60*60)); |
echo sprintf("%-32s %s\n", "Creation time:", "[0x$custom_block2] ".($custom_block2 == '0000' ? 'Unknown' : date('Y-m-d', hexdec($custom_block2)*24*60*60))); |
echo sprintf("%-32s %s\n", "Reserved:", "[0x$custom_block3]"); |
echo sprintf("%-32s %s\n", "Namespace hash:", "[0x$custom_block4] $namespace_desc"); |
echo sprintf("%-32s %s\n", "Namespace (Obj.type OID) hash:", "[0x$custom_block4] $namespace_desc"); |
echo sprintf("%-32s %s\n", "Object ID hash:", "[0x$custom_block5] SHA1 = ????????????????????????????$custom_block5"); |
|
} |
} |
|
break; |
default: |