Created
December 3, 2019 17:44
-
-
Save kedare/5fa5663c90cb28985e37355314eaeec7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
unset($port_ifAlias); | |
echo $this_port['ifAlias']; | |
list($type_code, $first, $second, $third) = explode(":", $this_port['ifAlias']); | |
if ($type_code == "X") { $type = "peering"; } // IXP | |
elseif ($type_code == "P") { $type = "peering"; } // Peering | |
elseif ($type_code == "T") { $type = "transit"; } // Transit | |
elseif ($type_code == "W") { $type = "core"; } // Wave | |
elseif ($type_code == "O") { $type = "core"; } // Optics | |
elseif ($type_code == "K") { $type = "core"; } // Dark | |
if ($type_code == "W" || $type_code == "K" || $type_code == "X" || $type_code == "T" || $type_code == "P") { | |
$circuit = $second; | |
$note = $first; | |
} | |
if ($type && $circuit) { | |
$type = strtolower($type); | |
$port_ifAlias['type'] = ucfirst($type); | |
$port_ifAlias['descr'] = $this_port["ifAlias"]; | |
$port_ifAlias['circuit'] = $circuit; | |
$port_ifAlias['notes'] = $notes; | |
d_echo($port_ifAlias); | |
} | |
unset($type_code, $first, $second, $third, $citcuit, $notes, $type); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment