ios12ShortenIfName: the canonical form of Huawei port-channel interfaces is Eth-TrunkX
vrpReadInterfaceStatus: portchannel padding in the output of 'disp int bri' supported
$field_list = preg_split('/\s+/', $line);
if (count ($field_list) < 7)
break;
+ if ($field_list[0] == '')
+ array_shift ($field_list);
list ($portname, $status_raw) = $field_list;
$portname = ios12ShortenIfName ($portname);
// map interface name
function ios12ShortenIfName ($ifname)
{
+ if (preg_match ('@^eth-trunk(\d+)$@i', $ifname, $m))
+ return "Eth-Trunk${m[1]}";
$ifname = preg_replace ('@^Eth(?:ernet)?(.+)$@', 'e\\1', $ifname);
$ifname = preg_replace ('@^FastEthernet(.+)$@', 'fa\\1', $ifname);
$ifname = preg_replace ('@^(?:GigabitEthernet|GE)(.+)$@', 'gi\\1', $ifname);