]> granicus.if.org Git - php/commitdiff
s/noOIDIncreasingCheck/oid_increasing_check/
authorBoris Lytochkin <lytboris@php.net>
Thu, 21 Jul 2011 12:48:47 +0000 (12:48 +0000)
committerBoris Lytochkin <lytboris@php.net>
Thu, 21 Jul 2011 12:48:47 +0000 (12:48 +0000)
ext/snmp/php_snmp.h
ext/snmp/snmp.c
ext/snmp/tests/snmp-object-properties.phpt

index e7b3576ee5de6105830958fa625a86f47c0487ad..81db1130c4ca6878cf3f366e49706ee0341af730 100644 (file)
@@ -93,7 +93,7 @@ typedef struct _php_snmp_object {
        int enum_print;
        int oid_output_format;
        int snmp_errno;
-       int noOIDIncreasingCheck;
+       int oid_increasing_check;
        char snmp_errstr[128];
 } php_snmp_object;
 
index c457fccdfe7d6052341738390c22864dbe15d23b..4ec880e8cacf1d45c45c73c924d7d6d02ecabde9 100644 (file)
@@ -368,7 +368,7 @@ struct objid_query {
        long max_repetitions;
        int valueretrieval;
        int array_output;
-       int noOIDIncreasingCheck;
+       int oid_increasing_check;
        snmpobjarg *vars;
 };
 
@@ -864,7 +864,7 @@ retry:
 
                                        /* OID increase check */
                                        if (st & SNMP_CMD_WALK) {
-                                               if (objid_query->noOIDIncreasingCheck == FALSE && snmp_oid_compare(name, name_length, vars->name, vars->name_length) >= 0) {
+                                               if (objid_query->oid_increasing_check == TRUE && snmp_oid_compare(name, name_length, vars->name, vars->name_length) >= 0) {
                                                        snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
                                                        php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_NOT_INCREASING, "Error: OID not increasing: %s", buf2);
                                                        keepwalking = 0;
@@ -1317,7 +1317,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
        objid_query.max_repetitions = -1;
        objid_query.non_repeaters = 0;
        objid_query.valueretrieval = SNMP_G(valueretrieval);
-       objid_query.noOIDIncreasingCheck = FALSE;
+       objid_query.oid_increasing_check = TRUE;
 
        if (session_less_mode) {
                if (version == SNMP_VERSION_3) {
@@ -1411,7 +1411,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
                                objid_query.max_repetitions = snmp_object->max_oids;
                        }
                }
-               objid_query.noOIDIncreasingCheck = snmp_object->noOIDIncreasingCheck;
+               objid_query.oid_increasing_check = snmp_object->oid_increasing_check;
                objid_query.valueretrieval = snmp_object->valueretrieval;
                glob_snmp_object.enum_print = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM);
                netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM, snmp_object->enum_print);
@@ -1728,6 +1728,7 @@ PHP_METHOD(snmp, __construct)
        snmp_object->enum_print = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM);
        snmp_object->oid_output_format = netsnmp_ds_get_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT);
        snmp_object->quick_print = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT);
+       snmp_object->oid_increasing_check = TRUE;
 }
 /* }}} */
 
@@ -2053,7 +2054,7 @@ static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval **retval TS
                return SUCCESS; \
        }
 
-PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(noOIDIncreasingCheck)
+PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(oid_increasing_check)
 PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(quick_print)
 PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(enum_print)
 
@@ -2157,7 +2158,7 @@ static int php_snmp_write_##name(php_snmp_object *snmp_object, zval *newval TSRM
 
 PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(quick_print)
 PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(enum_print)
-PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(noOIDIncreasingCheck)
+PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(oid_increasing_check)
 
 /* {{{ */
 static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
@@ -2219,7 +2220,7 @@ const php_snmp_prop_handler php_snmp_property_entries[] = {
        PHP_SNMP_PROPERTY_ENTRY_RECORD(quick_print),
        PHP_SNMP_PROPERTY_ENTRY_RECORD(enum_print),
        PHP_SNMP_PROPERTY_ENTRY_RECORD(oid_output_format),
-       PHP_SNMP_PROPERTY_ENTRY_RECORD(noOIDIncreasingCheck),
+       PHP_SNMP_PROPERTY_ENTRY_RECORD(oid_increasing_check),
        { NULL, 0, NULL, NULL}
 };
 /* }}} */
index 51699a5a30822b035d0e8293fadd7e38b7c32cb7..e4c0538a09c51297b38b6ff8e1836db0fbe369e9 100644 (file)
@@ -26,7 +26,7 @@ $session->enum_print = TRUE;
 $session->quick_print = TRUE;
 $session->valueretrieval = SNMP_VALUE_LIBRARY;
 $session->oid_output_format = SNMP_OID_OUTPUT_NUMERIC;
-$session->noOIDIncreasingCheck = TRUE;
+$session->oid_increasing_check = FALSE;
 
 var_dump($session);
 
@@ -35,7 +35,7 @@ $session->enum_print = "1";
 $session->quick_print = "1";
 $session->valueretrieval = "1";
 $session->oid_output_format = "3";
-$session->noOIDIncreasingCheck = "45";
+$session->oid_increasing_check = "45";
 
 var_dump($session);
 
@@ -89,8 +89,8 @@ object(SNMP)#%d (%d) {
   bool(false)
   ["oid_output_format"]=>
   int(3)
-  ["noOIDIncreasingCheck"]=>
-  bool(false)
+  ["oid_increasing_check"]=>
+  bool(true)
 }
 object(SNMP)#%d (%d) {
   ["info"]=>
@@ -114,8 +114,8 @@ object(SNMP)#%d (%d) {
   bool(true)
   ["oid_output_format"]=>
   int(4)
-  ["noOIDIncreasingCheck"]=>
-  bool(true)
+  ["oid_increasing_check"]=>
+  bool(false)
 }
 object(SNMP)#%d (%d) {
   ["info"]=>
@@ -139,7 +139,7 @@ object(SNMP)#%d (%d) {
   bool(true)
   ["oid_output_format"]=>
   int(3)
-  ["noOIDIncreasingCheck"]=>
+  ["oid_increasing_check"]=>
   bool(true)
 }
 bool(true)
@@ -167,7 +167,7 @@ object(SNMP)#%d (%d) {
   bool(true)
   ["oid_output_format"]=>
   int(3)
-  ["noOIDIncreasingCheck"]=>
+  ["oid_increasing_check"]=>
   bool(true)
   ["123"]=>
   string(11) "param_value"