]> granicus.if.org Git - php/commitdiff
swap non_repeaters and max_repetitions in walk query, max_repetitions whould be used...
authorBoris Lytochkin <lytboris@php.net>
Sun, 17 Jul 2011 18:17:43 +0000 (18:17 +0000)
committerBoris Lytochkin <lytboris@php.net>
Sun, 17 Jul 2011 18:17:43 +0000 (18:17 +0000)
ext/snmp/snmp.c
ext/snmp/tests/snmp-object-error.phpt
ext/snmp/tests/snmp-object.phpt

index 7507640debb9c0f8e45ac23e8c942b6455738191..cbbee99e59b10a864bc278abf95e63dc0cdf3345 100644 (file)
@@ -353,8 +353,8 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_walk, 0, 0, 4)
        ZEND_ARG_INFO(0, object_id)
        ZEND_ARG_INFO(0, suffix_keys)
-       ZEND_ARG_INFO(0, non_repeaters)
        ZEND_ARG_INFO(0, max_repetitions)
+       ZEND_ARG_INFO(0, non_repeaters)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set, 0, 0, 3)
@@ -1370,7 +1370,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
                                RETURN_FALSE;
                        }
                } else if (st & SNMP_CMD_WALK) {
-                       if (zend_parse_parameters(argc TSRMLS_CC, "Z|bll", &oid, &suffix_keys, &(objid_query.non_repeaters), &(objid_query.max_repetitions)) == FAILURE) {
+                       if (zend_parse_parameters(argc TSRMLS_CC, "Z|bll", &oid, &suffix_keys, &(objid_query.max_repetitions), &(objid_query.non_repeaters)) == FAILURE) {
                                RETURN_FALSE;
                        }
                        if (suffix_keys) {
@@ -1792,7 +1792,7 @@ PHP_METHOD(snmp, getnext)
 }
 /* }}} */
 
-/* {{{ proto mixed SNMP::walk(mixed object_id [, bool $suffix_as_key = FALSE [, int $non_repeaters [, int $max_repetitions ]]])
+/* {{{ proto mixed SNMP::walk(mixed object_id [, bool $suffix_as_key = FALSE [, int $max_repetitions [, int $non_repeaters]])
    Return all objects including their respective object id withing the specified one as array of oid->value pairs */
 PHP_METHOD(snmp, walk)
 {
index 00db3a318c5c85eeb5e9297949f963cb1571fe4b..83ba2b72631c6a0389aa26e47b7effd8d173fea9 100644 (file)
@@ -47,7 +47,7 @@ var_dump($session->close());
 
 $session = new SNMP(SNMP::VERSION_2c, $hostname, $community, $timeout, $retries);
 var_dump($session->walk('.1.3.6.1.2.1.1', FALSE, ''));
-var_dump($session->walk('.1.3.6.1.2.1.1', FALSE, 0, ''));
+var_dump($session->walk('.1.3.6.1.2.1.1', FALSE, 30, ''));
 var_dump($session->get());
 var_dump($session->getnext());
 var_dump($session->set());
index 684391b461e84f632803d5b3e9dafcc802469527..7830ec2cd7481e1dcaa0370103ab14a6f92ac757 100644 (file)
@@ -48,18 +48,18 @@ var_dump(key($z));
 var_dump(array_shift($z));
 var_dump($session->close());
 
-echo "WALK multiple on single OID, non_repeaters set to 0\n";
+echo "WALK multiple on single OID, max_repetitions set to 30\n";
 $session = new SNMP(SNMP::VERSION_2c, $hostname, $community, $timeout, $retries);
-$z = $session->walk('.1.3.6.1.2.1.1', 0);
+$z = $session->walk('.1.3.6.1.2.1.1', FALSE, 30);
 var_dump(gettype($z));
 var_dump(count($z));
 var_dump(key($z));
 var_dump(array_shift($z));
 var_dump($session->close());
 
-echo "WALK multiple on single OID, non_repeaters set to 0, max_repetitions set to 30\n";
+echo "WALK multiple on single OID, max_repetitions set to 30, non_repeaters set to 0\n";
 $session = new SNMP(SNMP::VERSION_2c, $hostname, $community, $timeout, $retries);
-$z = $session->walk('.1.3.6.1.2.1.1', 0, 30);
+$z = $session->walk('.1.3.6.1.2.1.1', FALSE, 30, 0);
 var_dump(gettype($z));
 var_dump(count($z));
 var_dump(key($z));
@@ -154,13 +154,13 @@ int(%d)
 string(%d) "%S"
 string(%d) "%S"
 bool(true)
-WALK multiple on single OID, non_repeaters set to 0
+WALK multiple on single OID, max_repetitions set to 30
 string(5) "array"
 int(%d)
 string(%d) "%S"
 string(%d) "%S"
 bool(true)
-WALK multiple on single OID, non_repeaters set to 0, max_repetitions set to 30
+WALK multiple on single OID, max_repetitions set to 30, non_repeaters set to 0
 string(5) "array"
 int(%d)
 string(%d) "%S"