r3709 replace "retrieve" command code with "get8021q"
authorDenis Ovsienko <infrastation@yandex.ru>
Mon, 31 May 2010 13:11:11 +0000 (13:11 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 31 May 2010 13:11:11 +0000 (13:11 +0000)
gateways/deviceconfig/fdry5.connector
gateways/deviceconfig/ios12.connector
gateways/deviceconfig/main
gateways/deviceconfig/nxos4.connector
gateways/deviceconfig/vrp53.connector
gateways/deviceconfig/xos12.connector
inc/gateways.php

index aab9cfdce3349e296776f39fca9b83cac8502a7e..a2a48f21697c528717de559058894a88f317da24 100755 (executable)
@@ -46,7 +46,7 @@ SESSION=`mktemp /tmp/fdry5.connector.XXXX`
 [ -f "$SESSION" ] || exit 5
 prepare_connect_commands $ENDPOINT
 case $COMMAND in
-retrieve)
+get8021q)
        printf 'skip-page-display\r\nshow running-config\r\n' >> "$SESSION"
        outfile="$WORKFILE"
        ;;
index b01ceef7cde6b9f6d7ca6e6081a59f09b4af3ed2..dabf49347ba4d53dc27bf3f8bbabcbf272cbeaf9 100755 (executable)
@@ -47,7 +47,7 @@ SESSION=`mktemp /tmp/ios12.connector.XXXX`
 [ -f "$SESSION" ] || exit 5
 prepare_connect_commands $ENDPOINT
 case $COMMAND in
-retrieve)
+get8021q)
        printf 'term len 0\nshow run\n! END OF CONFIG\nshow vlan brief\n! END OF VLAN LIST\n' >> "$SESSION"
        outfile="$WORKFILE"
        ;;
index 257eedee3fbcc0b428735f7dd980fa17d5ae8652..02b1e20471d8b0a3d459aca0a35b1f9a301c6e73 100755 (executable)
@@ -4,9 +4,12 @@
 # equivalent) and prints it onto stdout. When run, it accepts the
 # following commands on stdin:
 #
-# * retrieve <endpoint> <handler> <outputfile>
+# * get8021q <endpoint> <handler> <outputfile>
 #   (save remote config text into provided local file)
 #
+# * getcdpstatus <endpoint> <handler> <outputfile>
+#   (save remote status text into provided local file)
+#
 # * deploy <endpoint> <handler> <inputfile>
 #   (execute given text in privileged mode)
 
@@ -77,7 +80,7 @@ do_work()
 
 while read cmd args; do
        case $cmd in
-               retrieve|deploy|getcdpstatus)
+               get8021q|deploy|getcdpstatus)
                        do_work $cmd $args
                        ;;
                *)
index 3cbaaefa520dd83be8c654067cce592c4b56dbc0..df61f1773a1c51e59104df7e4fd451b09759b810 100755 (executable)
@@ -47,7 +47,7 @@ $session->login($username, $password);
 if ($enable_password ne "-") {
     $session->enable($enable_password);
 }
-if ($command eq "retrieve") {
+if ($command eq "get8021q") {
     open(WORKFILE, ">$workfile") || die "$workfile: $!";
     $session->cmd ('terminal length 0');
     $session->cmd ('terminal no monitor');
index 07ea6c931778c7a8cb2ed9d95aca74a1d576da81..fb90d9304aa63293fae72144a1124e0572b240a7 100755 (executable)
@@ -47,7 +47,7 @@ SESSION=`mktemp /tmp/$MYNAME.XXXX`
 [ -f "$SESSION" ] || exit 5
 prepare_connect_commands $ENDPOINT
 case $COMMAND in
-retrieve)
+get8021q)
        printf 'display current-configuration\n' >> "$SESSION"
        outfile="$WORKFILE"
        ;;
index 0cdd84e32cbbc9790c5889eb658cc28a7058252d..4b600f5032f56cb5f5cf3aa3d6cda22b05c2d99a 100755 (executable)
@@ -44,7 +44,7 @@ SESSION=`mktemp /tmp/$MYNAME.XXXX`
 [ -f "$SESSION" ] || exit 5
 prepare_connect_commands $ENDPOINT
 case $COMMAND in
-retrieve)
+get8021q)
        printf 'disable clipaging\nshow configuration "vlan"\n' >> "$SESSION"
        outfile="$WORKFILE"
        ;;
index 80005270ed6080c4b601ed7b2e709d237f81d2e4..cb2df3152230d845a4a42ed382941541cb651de0 100644 (file)
@@ -16,7 +16,7 @@
 // translating functions maps
 $gwrxlator = array();
 $gwrxlator['getcdpstatus']['ios12'] = 'ios12ReadCDPStatus';
-$gwrxlator['retrieve'] = array
+$gwrxlator['get8021q'] = array
 (
        'ios12' => 'ios12ReadVLANConfig',
        'fdry5' => 'fdry5ReadVLANConfig',
@@ -306,7 +306,7 @@ function detectDeviceBreed ($object_id)
 
 function getRunning8021QConfig ($object_id)
 {
-       $ret = gwRetrieveDeviceConfig ($object_id, 'retrieve');
+       $ret = gwRetrieveDeviceConfig ($object_id, 'get8021q');
        // Once there is no default VLAN in the parsed data, it means
        // something else was parsed instead of config text.
        if (!in_array (VLAN_DFL_ID, $ret['vlanlist']))
@@ -333,7 +333,7 @@ function setDevice8021QConfig ($object_id, $pseudocode)
        gwDeployDeviceConfig ($object_id, $breed, unix2dos ($xlator[$breed] ($pseudocode)));
 }
 
-function gwRetrieveDeviceConfig ($object_id, $command = 'retrieve')
+function gwRetrieveDeviceConfig ($object_id)
 {
        global $gwrxlator;
        if (!array_key_exists ($command, $gwrxlator))