diff --git a/src/Modules/BDcom/BDcomAbstractModule.php b/src/Modules/BDcom/BDcomAbstractModule.php index bdcf1ed5..bb1a1037 100644 --- a/src/Modules/BDcom/BDcomAbstractModule.php +++ b/src/Modules/BDcom/BDcomAbstractModule.php @@ -291,7 +291,7 @@ private function loadInterfaces($useCache = true) 'parent' => $this->findParentByName($name), '_slot' => $slot, '_port' => $port, - '_onu_num' => $onuNum, + '_onu' => $onuNum, '_technology' => 'epon', ]; } diff --git a/src/Modules/BDcom/GP3600/BDcomAbstractModule.php b/src/Modules/BDcom/GP3600/BDcomAbstractModule.php index d844b03b..dccef0ab 100644 --- a/src/Modules/BDcom/GP3600/BDcomAbstractModule.php +++ b/src/Modules/BDcom/GP3600/BDcomAbstractModule.php @@ -162,7 +162,7 @@ private function loadInterfaces($useCache = true) { 'parent' => $this->findParentByName($iface->getValue()), '_slot' => 0, '_port' => (int)$m[1], - '_onu_num' => (int)$m[2], + '_onu' => (int)$m[2], '_type' => 'gpon', '_technology' => 'gpon', ]; diff --git a/src/Modules/BDcom/GP3600/UnregisteredOnts.php b/src/Modules/BDcom/GP3600/UnregisteredOnts.php index 5e115395..98b78f21 100644 --- a/src/Modules/BDcom/GP3600/UnregisteredOnts.php +++ b/src/Modules/BDcom/GP3600/UnregisteredOnts.php @@ -60,6 +60,7 @@ function getGponUnregisteredFromResponses($response) '_serial_ascii' => $sn->getValue(), '_serial_hex' => $hexVal, 'serial' => str_replace(":", "", $sn->getValue()), + '_ident' => str_replace(":", "", $sn->getValue()), 'interface' => $iface, 'password' => null, 'version' => null, diff --git a/src/Modules/BDcom/UnregisteredOnts.php b/src/Modules/BDcom/UnregisteredOnts.php index d28b4808..0de13804 100644 --- a/src/Modules/BDcom/UnregisteredOnts.php +++ b/src/Modules/BDcom/UnregisteredOnts.php @@ -47,6 +47,7 @@ function ($e) { unset($un['bind_status']); $un['_mac_address_hex'] = str_replace(":", "", $mac); $un['mac_address'] = $mac; + $un['_ident'] = $mac; return $un; }, $unregistered)); diff --git a/src/Modules/CData/CDataAbstractModule.php b/src/Modules/CData/CDataAbstractModule.php index a4d0bb70..0487bb86 100755 --- a/src/Modules/CData/CDataAbstractModule.php +++ b/src/Modules/CData/CDataAbstractModule.php @@ -62,7 +62,7 @@ protected function parseInterface($input) 'type' => $interface['type'], '_port' => isset($interface['_port']) ? $interface['_port'] : null, '_slot' => isset($interface['_slot']) ? $interface['_slot'] : null, - '_onu_num' => null, + '_onu' => null, 'onu_id' => null, 'uni' => null, 'parent' => null, @@ -80,7 +80,7 @@ protected function parseInterface($input) 'type' => $interface['type'], '_port' => isset($interface['_port']) ? $interface['_port'] : null, '_slot' => isset($interface['_slot']) ? $interface['_slot'] : null, - '_onu_num' => null, + '_onu' => null, 'uni' => null, 'pontype' => isset($interface['pontype']) ? $interface['pontype'] : null, '_technology' => isset($interface['pontype']) ? $interface['pontype'] : null, @@ -98,7 +98,7 @@ protected function parseInterface($input) 'xid' => $interface['xid'], '_port' => isset($interface['_port']) ? $interface['_port'] : null, '_slot' => isset($interface['_slot']) ? $interface['_slot'] : null, - '_onu_num' => $onuNum, + '_onu' => $onuNum, 'type' => 'ONU', 'uni' => null, 'pontype' => isset($interface['pontype']) ? $interface['pontype'] : null, @@ -116,7 +116,7 @@ protected function parseInterface($input) 'type' => $interface['type'], '_port' => isset($interface['_port']) ? $interface['_port'] : null, '_slot' => isset($interface['_slot']) ? $interface['_slot'] : null, - '_onu_num' => null, + '_onu' => null, 'uni' => null, 'pontype' => isset($interface['pontype']) ? $interface['pontype'] : null, '_technology' => isset($interface['pontype']) ? $interface['pontype'] : null, @@ -125,13 +125,13 @@ protected function parseInterface($input) case 7: $response['name'] .= ":{$m[5]}"; $response['uni'] = (int)$m[6]; - $response['_onu_num'] = (int)$m[5]; + $response['_onu'] = (int)$m[5]; $response['type'] = 'UNI'; $response['id'] = (int)$m[5] + $response['id']; break; case 6: $response['name'] .= ":{$m[5]}"; - $response['_onu_num'] = (int)$m[5]; + $response['_onu'] = (int)$m[5]; $response['type'] = 'ONU'; $response['id'] = (int)$m[5] + $response['id']; break; diff --git a/src/Modules/CData/FD11XX/CDataAbstractModule.php b/src/Modules/CData/FD11XX/CDataAbstractModule.php index 0a6ff7cb..d8b84164 100644 --- a/src/Modules/CData/FD11XX/CDataAbstractModule.php +++ b/src/Modules/CData/FD11XX/CDataAbstractModule.php @@ -72,7 +72,7 @@ protected function parseInterface($input, $parseBy = 'xid') 'xid' => $interface['xid'], 'type' => $interface['type'], 'phys_snmp_id' => $interface['phys_snmp_id'], - '_onu_num' => null, + '_onu' => null, 'parent' => null, '_snmp_id' => null, ]; @@ -87,7 +87,7 @@ protected function parseInterface($input, $parseBy = 'xid') 'id' => ($interface['xid'] * 1000) + $onuNum, 'xid' => null, 'type' => 'ONU', - '_onu_num' => $onuNum, + '_onu' => $onuNum, 'phys_snmp_id' => $interface['phys_snmp_id'], '_snmp_id' => "{$interface['xid']}.{$onuNum}", ]; @@ -102,14 +102,14 @@ protected function parseInterface($input, $parseBy = 'xid') 'xid' => $interface['xid'], 'type' => $interface['type'], 'phys_snmp_id' => $interface['phys_snmp_id'], - '_onu_num' => null, + '_onu' => null, '_snmp_id' => null, ]; switch (count($m)) { case 3: $response['name'] .= ":{$m[2]}"; $response['parent'] = $interface['id']; - $response['_onu_num'] = (int)$m[2]; + $response['_onu'] = (int)$m[2]; $response['type'] = 'ONU'; $response['_snmp_id'] = "{$response['xid']}.{$m[2]}"; $response['id'] = ((int)$response['xid'] * 1000) + $m[2]; diff --git a/src/Modules/CData/FD11XX/OntListWithStatuses.php b/src/Modules/CData/FD11XX/OntListWithStatuses.php index 500c6d5e..8d07d2c4 100644 --- a/src/Modules/CData/FD11XX/OntListWithStatuses.php +++ b/src/Modules/CData/FD11XX/OntListWithStatuses.php @@ -62,7 +62,7 @@ protected function formate($resp, $filter) { 'xid' => $interface['xid'], '_snmp_id' => "{$interface['xid']}.{$ontNum}", 'type' => 'ONU', - '_onu_num' => $ontNum, + '_onu' => $ontNum, ], 'status' => $statusText, 'admin_state' => null, diff --git a/src/Modules/CData/FD16xxV3/CDataAbstractModuleFD16xxV3.php b/src/Modules/CData/FD16xxV3/CDataAbstractModuleFD16xxV3.php index b398e2f7..58f174c7 100755 --- a/src/Modules/CData/FD16xxV3/CDataAbstractModuleFD16xxV3.php +++ b/src/Modules/CData/FD16xxV3/CDataAbstractModuleFD16xxV3.php @@ -73,7 +73,7 @@ function getPhysicalInterfaces() '_shelf' => $m[2], '_slot' => $m[3], '_port' => $m[4], - '_onu_num' => null, + '_onu' => null, '_technology' => 'gpon', ]; } @@ -136,7 +136,7 @@ function decodeSnmpOid($oid) 'parent' => $iface['id'], 'type' => 'ONU', '_snmp_id' => $oid, - '_onu_num' => $onuNum, + '_onu' => $onuNum, '_type' => $iface['_type'], '_shelf' => $iface['_shelf'], '_slot' => $iface['_slot'], @@ -172,7 +172,7 @@ protected function parseInterface($input, $searchBy=null) $interface['id'] = $input; $interface['name'] .= ":{$onu}"; $interface['_snmp_id'] = $this->encodeSnmpOid($interface['name']); - $interface['_onu_num'] = $onu; + $interface['_onu'] = $onu; return $interface; } } @@ -202,7 +202,7 @@ protected function parseInterface($input, $searchBy=null) $interface['id'] = $interface['id'] + (int)$m[5]; $interface['name'] .= ":{$m[5]}"; $interface['_snmp_id'] = $this->encodeSnmpOid($interface['name']); - $interface['_onu_num'] = (int)$m[5]; + $interface['_onu'] = (int)$m[5]; } return $interface; } diff --git a/src/Modules/CData/FD16xxV3/FdbTableConsoleFD1616.php b/src/Modules/CData/FD16xxV3/FdbTableConsoleFD1616.php index 23fe8db2..8787171a 100644 --- a/src/Modules/CData/FD16xxV3/FdbTableConsoleFD1616.php +++ b/src/Modules/CData/FD16xxV3/FdbTableConsoleFD1616.php @@ -50,7 +50,7 @@ public function run($filter = []) } $telnetIdent = "{$iface['_type']} 0/0/{$iface['_port']}"; if ($iface['type'] === 'ONU') { - $resp = $this->console->exec("show mac-address port {$telnetIdent} ont {$iface['_onu_num']}"); + $resp = $this->console->exec("show mac-address port {$telnetIdent} ont {$iface['_onu']}"); } else { $resp = $this->console->exec("show mac-address port {$telnetIdent}"); } diff --git a/src/Modules/CData/FD16xxV3/GponOntSerial.php b/src/Modules/CData/FD16xxV3/GponOntSerial.php index e4ab09c8..e1f3c0a6 100755 --- a/src/Modules/CData/FD16xxV3/GponOntSerial.php +++ b/src/Modules/CData/FD16xxV3/GponOntSerial.php @@ -32,6 +32,9 @@ private function processNoInterface($response) { $onuId = Helper::getIndexByOid($r->getOid()); $interface = $this->parseInterface($onuId); $interface['onu_id'] = $onuId; + if(!$interface) { + continue; + } $return[] = [ 'interface' => $interface, 'serial' => Helper::hexToStr(substr($r->getHexValue(), 0, 12)) . substr(str_replace(":", "", $r->getHexValue()), 8), diff --git a/src/Modules/CData/FD16xxV3/OntDeleteGpon.php b/src/Modules/CData/FD16xxV3/OntDeleteGpon.php index 0f9092e8..9aad050c 100644 --- a/src/Modules/CData/FD16xxV3/OntDeleteGpon.php +++ b/src/Modules/CData/FD16xxV3/OntDeleteGpon.php @@ -30,7 +30,7 @@ public function run($filter = []) if(!$interface['id']) { throw new \Exception("Incorrect ONU number"); } - if (!preg_match('/^(pon|xge|ge)([0-9])\/([0-9])\/([0-9]){1,}\:?([0-9]{1,3})?\/?([0-9]{1,3})?$/', $interface['name'], $m)) { + if (!preg_match('/^(pon|xge|ge|gpon) ([0-9])\/([0-9])\/([0-9]){1,}\:?([0-9]{1,3})?\/?([0-9]{1,3})?$/', $interface['name'], $m)) { throw new \Exception("Interface {$filter['interface']} not supported!"); } if(count($m) < 5) { diff --git a/src/Modules/CData/FD16xxV3/OntListWithStatuses.php b/src/Modules/CData/FD16xxV3/OntListWithStatuses.php index eb3fb4db..a8dee9b3 100755 --- a/src/Modules/CData/FD16xxV3/OntListWithStatuses.php +++ b/src/Modules/CData/FD16xxV3/OntListWithStatuses.php @@ -61,7 +61,7 @@ protected function formate($resp) { 'id' => $interface['id'] + $ontNum, 'xid' => $interface['xid'], 'type' => 'ONU', - '_onu_num' => $ontNum, + '_onu' => $ontNum, 'uni' => null, ], 'status' => $statusText, diff --git a/src/Modules/CData/FD16xxV3/OntUniPortsStatus.php b/src/Modules/CData/FD16xxV3/OntUniPortsStatus.php index b8b49e7b..e68b1a62 100644 --- a/src/Modules/CData/FD16xxV3/OntUniPortsStatus.php +++ b/src/Modules/CData/FD16xxV3/OntUniPortsStatus.php @@ -41,7 +41,7 @@ public function getUniDataByConsole($iface){ $this->console->exec("interface {$iface['_type']} 0/0"); - $resp = $this->console->exec("show ont port state {$iface['_port']} {$iface['_onu_num']} eth all"); + $resp = $this->console->exec("show ont port state {$iface['_port']} {$iface['_onu']} eth all"); $response = []; $lines = explode("\n", $resp); diff --git a/src/Modules/CData/FD16xxV3/RawConsoleCommand.php b/src/Modules/CData/FD16xxV3/RawConsoleCommand.php index b248507a..7fa7cd2f 100644 --- a/src/Modules/CData/FD16xxV3/RawConsoleCommand.php +++ b/src/Modules/CData/FD16xxV3/RawConsoleCommand.php @@ -35,6 +35,7 @@ protected function validResponse($response) if (preg_match('/Command incomplete/', $response)) return false; if (preg_match('/Unknown command/', $response)) return false; if (preg_match('/Error/', $response)) return false; + if (preg_match('/failed/i', $response)) return false; return true; } diff --git a/src/Modules/CData/FD16xxV3/SnmpUnregisteredOnts.php b/src/Modules/CData/FD16xxV3/SnmpUnregisteredOnts.php new file mode 100644 index 00000000..4f04a36c --- /dev/null +++ b/src/Modules/CData/FD16xxV3/SnmpUnregisteredOnts.php @@ -0,0 +1,96 @@ +response; + } + + function getPretty() + { + return $this->response; + } + + /** + * @param array $filter + * @return $this|AbstractModule + * @throws Exception + */ + public function run($filter = []) + { + $oids = array_map(function ($e) { + return Oid::init($e->getOid()); + }, $this->oids->getOidsByRegex('ont.autofind..*')); + $response = $this->formatResponse($this->snmp->walk($oids)); + $this->response = array_values($this->getGponUnregisteredFromResponses($response)); + return $this; + } + + function getGponUnregisteredFromResponses($response) + { + $data = []; + if (isset($response['ont.autofind.ident'])) { + if ($response['ont.autofind.ident']->error()) { + return []; + } + foreach ($response['ont.autofind.ident']->fetchAll() as $onuId => $sn) { + $uniqId = Helper::getIndexByOid($sn->getOid()); + $ifacePort = explode(":", $this->parseInterface($uniqId, '_snmp_id')['name'])[0]; + $iface = $this->parseInterface($ifacePort . ":" . ($onuId + 1)); + $val = $sn->getValue(); + $hexVal = strtoupper(bin2hex(substr($val, 0, 4))) . substr($val, 5); + $data[$uniqId] = [ + '_serial_ascii' => $sn->getValue(), + '_serial_hex' => $hexVal, + 'serial' => str_replace("-", "", $sn->getValue()), + '_ident' => str_replace("-", "", $sn->getValue()), + 'interface' => $iface, + 'password' => null, + 'version' => null, + 'equipment_id' => null, + 'fw_version' => null, + 'check_code' => null, + 'loid' => null, + 'reg_time' => null, + 'model' => null, + 'type' => null, + ]; + } + } + foreach ($response['ont.autofind.equipmentId']->fetchAll() as $d) { + $uniqId = Helper::getIndexByOid($d->getOid()); + $data[$uniqId]['equipment_id'] = $this->convertHexToString($d->getHexValue()); + } + foreach ($response['ont.autofind.password']->fetchAll() as $d) { + $uniqId = Helper::getIndexByOid($d->getOid()); + $data[$uniqId]['password'] = $this->convertHexToString($d->getHexValue()); + } + foreach ($response['ont.autofind.softwareVer']->fetchAll() as $d) { + $uniqId = Helper::getIndexByOid($d->getOid()); + $data[$uniqId]['fw_version'] = $this->convertHexToString($d->getHexValue()); + } + return $data; + } + + function getPrettyFiltered($filter = [], $fromCache = false) + { + return parent::getPrettyFiltered($filter, $fromCache); // TODO: Change the autogenerated stub + } +} + diff --git a/src/Modules/CData/FD16xxV3/UnregisteredOnts.php b/src/Modules/CData/FD16xxV3/UnregisteredOnts.php index eeda92bc..7f6c4629 100644 --- a/src/Modules/CData/FD16xxV3/UnregisteredOnts.php +++ b/src/Modules/CData/FD16xxV3/UnregisteredOnts.php @@ -8,10 +8,19 @@ use SnmpWrapper\Oid; use SwitcherCore\Modules\AbstractModule; use SwitcherCore\Modules\Helper; +use SwitcherCore\Switcher\Console\ConsoleInterface; use SwitcherCore\Switcher\Objects\WrappedResponse; class UnregisteredOnts extends CDataAbstractModuleFD16xxV3 { + + + /** + * @Inject + * @var ConsoleInterface + */ + protected $console; + /** * @var WrappedResponse[] */ @@ -34,11 +43,59 @@ function getPretty() */ public function run($filter = []) { - $oids = array_map(function ($e) { - return Oid::init($e->getOid()); - }, $this->oids->getOidsByRegex('ont.autofind..*')); - $response = $this->formatResponse($this->snmp->walk($oids)); - $this->response = array_values($this->getGponUnregisteredFromResponses($response)); + $finded = $this->console->exec("show ont autofind all"); + $countOnts = 0; + if (preg_match('/Total: ([0-9]{1,3})/m', $finded, $matches)) { + $countOnts = (int)$matches[1]; + } + if ($countOnts == 0) { + $this->response = []; + return $this; + } + $fieldID = 0; + $result = []; + foreach (explode("\n", $finded) as $line) { + if (preg_match('/Aging time|Total/', $line)) continue; + if (preg_match('/Frame\/Slot/', $line)) { + $fieldID++; + continue; + } + if (preg_match('/^(.*): (.*)$/', trim($line), $matches)) { + $result[$fieldID][Helper::fromCamelCase(trim($matches[1]))] = trim($matches[2]); + } + } + $portUniqIds = []; + $data = []; + foreach ($result as $ont) { + $id = 1; + if (isset($portUniqIds[$ont['port']])) { + $portUniqIds[$ont['port']] = $portUniqIds[$ont['port']]+1; + $id = $portUniqIds[$ont['port']]; + } else { + $portUniqIds[$ont['port']] = $id; + } + if(!preg_match('/^([[:xdigit:]]{16}).*\((.*)\)$/', $ont['sn'], $ontSN)) { + throw new \Exception("Parse error"); + } + $iface = $this->parseInterface("gpon 0/0/{$ont['port']}" . ":" . ($id)); + $data[] = [ + '_serial_ascii' => trim($ontSN[2]), + '_serial_hex' => trim($ontSN[1]), + 'serial' => str_replace("-", "", trim($ontSN[2])), + '_ident' => str_replace("-", "", trim($ontSN[2])), + 'interface' => $iface, + 'password' => isset($ont['password']) ? $ont['password'] : '', + 'version' => isset($ont['ont_version']) ? $ont['ont_version'] : null, + 'equipment_id' => isset($ont['equipment_id']) ? $ont['equipment_id'] : null, + 'fw_version' => isset($ont['ont_software_version']) ? $ont['ont_software_version'] : null, + 'check_code' => null, + 'loid' => isset($ont['loid']) ? $ont['loid'] : null, + 'reg_time' => isset($ont['last_autofind_time']) ? $ont['last_autofind_time'] : null, + 'model' => null, + 'type' => null, + ]; + } + $this->response = $data; return $this; } @@ -59,6 +116,7 @@ function getGponUnregisteredFromResponses($response) '_serial_ascii' => $sn->getValue(), '_serial_hex' => $hexVal, 'serial' => str_replace("-", "", $sn->getValue()), + '_ident' => str_replace("-", "", $sn->getValue()), 'interface' => $iface, 'password' => null, 'version' => null, diff --git a/src/Modules/CData/GponOntFdbTable.php b/src/Modules/CData/GponOntFdbTable.php index 075ba2d4..4df6dc40 100644 --- a/src/Modules/CData/GponOntFdbTable.php +++ b/src/Modules/CData/GponOntFdbTable.php @@ -90,7 +90,7 @@ protected function getVlanByMacInterfaceId($mac, $interfaceId) { private function processWithInterface($interface) { $response = $this->formatResponse( $this->snmp->walk( - [Oid::init($this->oids->getOidByName('pon.fdbWithUni')->getOid() . ".{$interface['xid']}.{$interface['_onu_num']}")] + [Oid::init($this->oids->getOidByName('pon.fdbWithUni')->getOid() . ".{$interface['xid']}.{$interface['_onu']}")] ) ); return $this->parseWalk($response); diff --git a/src/Modules/CData/OntListWithStatuses.php b/src/Modules/CData/OntListWithStatuses.php index e76c4a17..1f4fab5d 100755 --- a/src/Modules/CData/OntListWithStatuses.php +++ b/src/Modules/CData/OntListWithStatuses.php @@ -61,7 +61,7 @@ protected function formate($resp) { 'id' => $interface['id'] + $ontNum, 'xid' => $interface['xid'], 'type' => 'ONU', - '_onu_num' => $ontNum, + '_onu' => $ontNum, 'uni' => null, ], 'status' => $statusText, diff --git a/src/Modules/CData/RawConsoleCommand.php b/src/Modules/CData/RawConsoleCommand.php index 919a8e73..ce9b989a 100644 --- a/src/Modules/CData/RawConsoleCommand.php +++ b/src/Modules/CData/RawConsoleCommand.php @@ -32,9 +32,10 @@ public function run($params = []) protected function validResponse($response) { - if (preg_match('/Command incomplete/', $response)) return false; - if (preg_match('/Unknown command/', $response)) return false; - if (preg_match('/Error/', $response)) return false; + if (preg_match('/Command incomplete/i', $response)) return false; + if (preg_match('/Unknown command/i', $response)) return false; + if (preg_match('/Error/i', $response)) return false; + if (preg_match('/failed/i', $response)) return false; return true; } diff --git a/src/Modules/CData/UnregisteredOnts.php b/src/Modules/CData/UnregisteredOnts.php index 8b4a9930..a5eb6274 100644 --- a/src/Modules/CData/UnregisteredOnts.php +++ b/src/Modules/CData/UnregisteredOnts.php @@ -105,6 +105,7 @@ function getEponUnregisteredFromResponses($response) $data[$uniqId] = [ '_mac_address_hex' => str_replace(":", "", $sn->getHexValue()), 'mac_address' => $sn->getHexValue(), + '_ident' => $sn->getHexValue(), 'interface' => $iface, 'password' => null, 'version' => null, diff --git a/src/Modules/HuaweiOLT/UnregisteredOnts.php b/src/Modules/HuaweiOLT/UnregisteredOnts.php index a994c08f..19ea5e6d 100644 --- a/src/Modules/HuaweiOLT/UnregisteredOnts.php +++ b/src/Modules/HuaweiOLT/UnregisteredOnts.php @@ -61,6 +61,7 @@ function getGponUnregisteredFromResponses($response) , '_serial_hex' => str_replace(":", "", $sn->getHexValue()), 'serial' => str_replace(":", "", $sn->getHexValue()), + '_ident' => str_replace(":", "", $sn->getHexValue()), 'interface' => $iface, 'password' => null, 'version' => null, @@ -122,6 +123,7 @@ function getEponUnregisteredFromResponses($response) $iface = $this->findIfaceByOid($ident->getOid()); $data[$iface['id']] = [ 'mac_address' => $ident->getHexValue(), + '_ident' => $ident->getHexValue(), 'interface' => $iface, 'password' => null, 'version' => null, diff --git a/src/Modules/ZTE/C300Series/UnregisteredOntList.php b/src/Modules/ZTE/C300Series/UnregisteredOntList.php index a57a207b..4227567d 100644 --- a/src/Modules/ZTE/C300Series/UnregisteredOntList.php +++ b/src/Modules/ZTE/C300Series/UnregisteredOntList.php @@ -55,6 +55,7 @@ private function getUnregisteredEPON() $data["{$key}"] = [ 'interface' => $interface, 'mac_address' => Helper::formatMac3Blocks($d->getHexValue()), + '_ident' => Helper::formatMac3Blocks($d->getHexValue()), ]; } foreach ($this->getResponseByName('epon.uncfg.onuModel', $response)->fetchAll() as $d) { @@ -91,6 +92,9 @@ private function getUnregisteredGPON() $blocks = explode(":", $d->getHexValue()); $data["{$key}"] = [ 'interface' => $interface, + '_ident' => $this->convertHexToString("{$blocks[0]}:{$blocks[1]}:{$blocks[2]}:{$blocks[3]}") . + $blocks[4] . $blocks[5] . $blocks[6] . $blocks[7] + , 'serial' => $this->convertHexToString("{$blocks[0]}:{$blocks[1]}:{$blocks[2]}:{$blocks[3]}") . $blocks[4] . $blocks[5] . $blocks[6] . $blocks[7] , diff --git a/src/Modules/ZTE/C600Series/UnregisteredOntList.php b/src/Modules/ZTE/C600Series/UnregisteredOntList.php index 9887ef13..5eba0947 100644 --- a/src/Modules/ZTE/C600Series/UnregisteredOntList.php +++ b/src/Modules/ZTE/C600Series/UnregisteredOntList.php @@ -60,6 +60,9 @@ private function getUnregisteredGPON() 'serial' => $this->convertHexToString("{$blocks[0]}:{$blocks[1]}:{$blocks[2]}:{$blocks[3]}") . $blocks[4] . $blocks[5] . $blocks[6] . $blocks[7] , + '_ident' => $this->convertHexToString("{$blocks[0]}:{$blocks[1]}:{$blocks[2]}:{$blocks[3]}") . + $blocks[4] . $blocks[5] . $blocks[6] . $blocks[7] + , ]; } foreach ($this->getResponseByName('gpon.uncfg.type', $response)->fetchAll() as $d) {