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 13:36:21 +02:00
|
|
|
unset($port_ifAlias);
|
|
|
|
|
|
|
|
echo $this_port['ifAlias'];
|
|
|
|
|
2022-08-21 16:23:43 -05:00
|
|
|
$split = preg_split('/[:\[\]{}()]/', $this_port['ifAlias']);
|
|
|
|
$type = $split[0] ?? null;
|
|
|
|
$descr = trim($split[1] ?? null);
|
|
|
|
$circuit = preg_split('/[{}]/', $this_port['ifAlias'])[1] ?? null;
|
|
|
|
$notes = preg_split('/[()]/', $this_port['ifAlias'])[1] ?? null;
|
|
|
|
$speed = preg_split('/[\[\]]/', $this_port['ifAlias'])[1] ?? null;
|
2015-07-10 13:36:21 +02:00
|
|
|
|
|
|
|
if ($type && $descr) {
|
|
|
|
$type = strtolower($type);
|
|
|
|
$port_ifAlias['type'] = $type;
|
|
|
|
$port_ifAlias['descr'] = $descr;
|
|
|
|
$port_ifAlias['circuit'] = $circuit;
|
2018-11-27 17:11:58 +01:00
|
|
|
$port_ifAlias['speed'] = substr($speed, 0, 32);
|
2015-07-10 13:36:21 +02:00
|
|
|
$port_ifAlias['notes'] = $notes;
|
|
|
|
|
2015-08-20 16:06:44 +02:00
|
|
|
d_echo($port_ifAlias);
|
2011-03-15 15:27:14 +00:00
|
|
|
}
|
2010-06-18 19:06:14 +00:00
|
|
|
|
2022-08-21 16:23:43 -05:00
|
|
|
unset($port_type, $port_descr, $port_circuit, $port_notes, $port_speed, $split);
|