function nxos4TranslatePushQueue($dummy_object_id, $queue, $dummy_vlan_names)
{
    $ret = '';
    foreach ($queue as $cmd) {
        switch ($cmd['opcode']) {
            case 'set mode':
                if ($cmd['arg2'] == 'trunk') {
                    // some NX-OS platforms ask for confirmation if user tries to
                    // overwrite allowed vlan list. Hence, we need to use
                    // the differentiative remove syntax here
                    $ret .= "interface {$cmd['arg1']}\n";
                    $ret .= "switchport trunk encapsulation dot1q\n";
                    $ret .= "switchport mode {$cmd['arg2']}\n";
                    $ret .= "no switchport trunk native vlan\n";
                    $ret .= "switchport trunk allowed vlan remove 1-4094\n";
                    break;
                }
                // fall-through
            // fall-through
            default:
                $ret .= ios12TranslatePushQueue($dummy_object_id, array($cmd), $dummy_vlan_names);
                break;
        }
    }
    return $ret;
}
示例#2
0
function nxos4TranslatePushQueue($dummy_object_id, $queue, $dummy_vlan_names)
{
    $ret = '';
    foreach ($queue as $cmd) {
        switch ($cmd['opcode']) {
            case 'getlldpstatus':
                $ret .= "show lldp neighbors detail\n";
                break;
            default:
                $ret .= ios12TranslatePushQueue($dummy_object_id, array($cmd), $dummy_vlan_names);
                break;
        }
    }
    return $ret;
}