r3352 vrp53TranslatePushQueue(): initial version
authorDenis Ovsienko <infrastation@yandex.ru>
Mon, 15 Mar 2010 18:28:01 +0000 (18:28 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 15 Mar 2010 18:28:01 +0000 (18:28 +0000)
inc/functions.php
inc/gateways.php

index f5c9103..e679c9b 100644 (file)
@@ -2890,4 +2890,33 @@ function fdry5TranslatePushQueue ($queue)
        return $ret;
 }
 
+function vrp53TranslatePushQueue ($queue)
+{
+       $ret = "system-view\n";
+       foreach ($queue as $cmd)
+               switch ($cmd['opcode'])
+               {
+               case 'create VLAN':
+                       $ret .= "vlan ${cmd['arg1']}\nquit\n";
+                       break;
+               case 'destroy VLAN':
+                       $ret .= "undo vlan ${cmd['arg1']}\n";
+                       break;
+               case 'add allowed':
+                       $ret .= "interface ${cmd['arg1']}\nport trunk allow-pass vlan ${cmd['arg2']}\nquit\n";
+                       break;
+               case 'rem allowed':
+                       $ret .= "interface ${cmd['arg1']}\nundo port trunk allow-pass vlan ${cmd['arg2']}\nquit\n";
+                       break;
+               case 'set native':
+                       $ret .= "interface ${cmd['arg1']}\nport default vlan ${cmd['arg2']}\nquit\n";
+                       break;
+               case 'unset native':
+                       $ret .= "interface ${cmd['arg1']}\nundo port default vlan\nquit\n";
+                       break;
+               }
+       $ret .= "return\n";
+       return $ret;
+}
+
 ?>
index 672b94f..6f7afff 100644 (file)
@@ -325,6 +325,7 @@ function setDevice8021QConfig ($object_id, $pseudocode)
        (
                'ios12' => 'ios12TranslatePushQueue',
                'fdry5' => 'fdry5TranslatePushQueue',
+               'vrp53' => 'vrp53TranslatePushQueue',
        );
        return gwDeployDeviceConfig ($object_id, $breed, unix2dos ($xlator[$breed] ($pseudocode)));
 }