2010-06-18 19:06:14 +00:00
|
|
|
<?php
|
|
|
|
|
2012-05-25 12:24:34 +00:00
|
|
|
// Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes
|
2015-07-10 11:36:21 +00:00
|
|
|
unset($port_ifAlias);
|
|
|
|
|
|
|
|
echo $this_port['ifAlias'];
|
|
|
|
|
2022-08-21 21:23:43 +00:00
|
|
|
$split = preg_split('/[:\[\]{}()]/', $this_port['ifAlias']);
|
2022-10-11 17:50:38 +00:00
|
|
|
$type = isset($split[0]) ? trim($split[0]) : null;
|
|
|
|
$descr = isset($split[1]) ? trim($split[1]) : null;
|
2022-10-25 17:27:28 +00:00
|
|
|
|
|
|
|
$circuit = trim(preg_split('/[{}]/', $this_port['ifAlias'])[1] ?? '');
|
|
|
|
$notes = trim(preg_split('/[()]/', $this_port['ifAlias'])[1] ?? '');
|
|
|
|
$speed = trim(preg_split('/[\[\]]/', $this_port['ifAlias'])[1] ?? '');
|
2015-07-10 11:36:21 +00:00
|
|
|
|
|
|
|
if ($type && $descr) {
|
|
|
|
$type = strtolower($type);
|
|
|
|
$port_ifAlias['type'] = $type;
|
|
|
|
$port_ifAlias['descr'] = $descr;
|
|
|
|
$port_ifAlias['circuit'] = $circuit;
|
2018-11-27 16:11:58 +00:00
|
|
|
$port_ifAlias['speed'] = substr($speed, 0, 32);
|
2015-07-10 11:36:21 +00:00
|
|
|
$port_ifAlias['notes'] = $notes;
|
|
|
|
|
2015-08-20 14:06:44 +00:00
|
|
|
d_echo($port_ifAlias);
|
2011-03-15 15:27:14 +00:00
|
|
|
}
|
2010-06-18 19:06:14 +00:00
|
|
|
|
2023-02-24 07:49:36 +00:00
|
|
|
unset($type, $descr, $circuit, $notes, $speed, $split);
|