mirror of
https://github.com/php/php-src.git
synced 2026-04-20 14:31:06 +02:00
swap non_repeaters and max_repetitions in walk query, max_repetitions whould be used more frequently
This commit is contained in:
@@ -345,8 +345,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)
|
||||
@@ -1355,7 +1355,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) {
|
||||
@@ -1763,7 +1763,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)
|
||||
{
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user