Отак це робиться для будь кого Ethernet порту ONU
// для 1/2/12:13
$shelf = 1;
$slot = 2;
$olt = 12;
$onu_number= 13;
$index_type = str_pad(decbin(1), 4, '0', STR_PAD_LEFT);
$rack = str_pad(decbin(1), 4, '0', STR_PAD_LEFT);
$shelf = str_pad(decbin($shelf), 8, '0', STR_PAD_LEFT);
$slot = str_pad(decbin($slot), 8, '0', STR_PAD_LEFT);
$olt = str_pad(decbin($olt), 8, '0', STR_PAD_LEFT);
$olt_port_index = bindec($index_type . $rack . $shelf . $slot . $olt);
if ($onu_number == null){
return("$olt_port_index.0");// convert bin to dec
}else{
$index_type = str_pad(dec