Skip to content

Commit

Permalink
Adding technology
Browse files Browse the repository at this point in the history
  • Loading branch information
meklis committed May 3, 2024
1 parent ce939a5 commit 25844b7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Modules/BDcom/BDcomAbstractModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ private function loadInterfaces($useCache = true)
'_slot' => (int)$m[2],
'_port' => (int)$m[3],
'_type' => 'EPON',
'_technology' => 'epon',
];
}
if (preg_match('/^g(([0-9])\/([0-9]{1,3}))$/', $iface->getValue(), $m)) {
Expand Down Expand Up @@ -211,6 +212,7 @@ private function loadInterfaces($useCache = true)
'_slot' => (int)$m[2],
'_port' => (int)$m[3],
'_type' => 'epon',
'_technology' => 'epon',
];
}
if (preg_match('/aggregator([0-9]{1,3})$/', $iface->getValue(), $m)) {
Expand Down Expand Up @@ -290,6 +292,7 @@ private function loadInterfaces($useCache = true)
'_slot' => $slot,
'_port' => $port,
'_onu_num' => $onuNum,
'_technology' => 'epon',
];
}
ksort($ifaces);
Expand Down
4 changes: 4 additions & 0 deletions src/Modules/BDcom/GP3600/BDcomAbstractModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private function loadInterfaces($useCache = true) {
'_slot' => (int)$m[2],
'_port' => (int)$m[3],
'_type' => 'GigaEthernet',
'_technology' => null,
];
} else if (preg_match('/^TGigaEthernet(([0-9])\/([0-9]{1,3}))$/', $iface->getValue(), $m)) {
$name = "tg{$m[1]}";
Expand All @@ -138,6 +139,7 @@ private function loadInterfaces($useCache = true) {
'_slot' => (int)$m[2],
'_port' => (int)$m[3],
'_type' => 'TGigaEthernet',
'_technology' => null,
];
} else if (preg_match('/^gpon(([0-9])\/([0-9]{1,3}))$/', strtolower($iface->getValue()), $m)) {
$name = "gpon{$m[1]}";
Expand All @@ -149,6 +151,7 @@ private function loadInterfaces($useCache = true) {
'_slot' => (int)$m[2],
'_port' => (int)$m[3],
'_type' => 'gpon',
'_technology' => 'gpon',
];
} else if (preg_match('/^gpon0\/([0-9]{1,2}):([0-9]{1,3})$/', strtolower($iface->getValue()), $m)) {
$ifaces[$id] = [
Expand All @@ -161,6 +164,7 @@ private function loadInterfaces($useCache = true) {
'_port' => (int)$m[1],
'_onu_num' => (int)$m[2],
'_type' => 'gpon',
'_technology' => 'gpon',
];
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/Modules/CData/CDataAbstractModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ protected function parseInterface($input)
'uni' => null,
'parent' => null,
'pontype' => isset($interface['pontype']) ? $interface['pontype'] : null,
'_technology' => isset($interface['pontype']) ? $interface['pontype'] : null,
];
} elseif (is_numeric($input) && $input > 10000) {
//Check is port
Expand All @@ -82,6 +83,7 @@ protected function parseInterface($input)
'_onu_num' => null,
'uni' => null,
'pontype' => isset($interface['pontype']) ? $interface['pontype'] : null,
'_technology' => isset($interface['pontype']) ? $interface['pontype'] : null,
];
}
//Find ont number
Expand All @@ -100,6 +102,7 @@ protected function parseInterface($input)
'type' => 'ONU',
'uni' => null,
'pontype' => isset($interface['pontype']) ? $interface['pontype'] : null,
'_technology' => isset($interface['pontype']) ? $interface['pontype'] : null,
];
}
} elseif (!is_numeric($input)) {
Expand All @@ -116,6 +119,7 @@ protected function parseInterface($input)
'_onu_num' => null,
'uni' => null,
'pontype' => isset($interface['pontype']) ? $interface['pontype'] : null,
'_technology' => isset($interface['pontype']) ? $interface['pontype'] : null,
];
switch (count($m)) {
case 7:
Expand Down
2 changes: 2 additions & 0 deletions src/Modules/CData/FD16xxV3/CDataAbstractModuleFD16xxV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function getPhysicalInterfaces()
'_slot' => $m[3],
'_port' => $m[4],
'_onu_num' => null,
'_technology' => 'gpon',
];
}
}
Expand Down Expand Up @@ -140,6 +141,7 @@ function decodeSnmpOid($oid)
'_shelf' => $iface['_shelf'],
'_slot' => $iface['_slot'],
'_port' => $iface['_port'],
'_technology' => 'gpon',
];
}

Expand Down

0 comments on commit 25844b7

Please sign in to comment.