Lines Matching refs:objid_query
106 struct objid_query { struct
378 struct objid_query *objid_query) in php_snmp_internal() argument
400 …memcpy((char *)root, (char *)(objid_query->vars[0].name), (objid_query->vars[0].name_length) * siz… in php_snmp_internal()
401 rootlen = objid_query->vars[0].name_length; in php_snmp_internal()
402 objid_query->offset = objid_query->count; in php_snmp_internal()
412 if ((st & SNMP_CMD_SET) && objid_query->count > objid_query->step) { in php_snmp_internal()
423 pdu->non_repeaters = objid_query->non_repeaters; in php_snmp_internal()
424 pdu->max_repetitions = objid_query->max_repetitions; in php_snmp_internal()
426 snmp_add_null_var(pdu, objid_query->vars[0].name, objid_query->vars[0].name_length); in php_snmp_internal()
439 …for (count = 0; objid_query->offset < objid_query->count && count < objid_query->step; objid_query… in php_snmp_internal()
441 …objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length, o… in php_snmp_internal()
442 …snprint_objid(buf, sizeof(buf), objid_query->vars[objid_query->offset].name, objid_query->vars[obj… in php_snmp_internal()
443 …D='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->v… in php_snmp_internal()
449 …snmp_add_null_var(pdu, objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query-… in php_snmp_internal()
464 if (objid_query->offset < objid_query->count) { /* we have unprocessed OIDs */ in php_snmp_internal()
495 objid_query->offset = 0; in php_snmp_internal()
502 php_snmp_getvalue(vars, &snmpval, objid_query->valueretrieval); in php_snmp_internal()
504 if (objid_query->array_output) { in php_snmp_internal()
512 for (count = 0; count < objid_query->count; count++) { in php_snmp_internal()
513 …if (objid_query->vars[count].name_length == vars->name_length && snmp_oid_compare(objid_query->var… in php_snmp_internal()
515 objid_query->vars[count].name_length = 0; /* mark this name as used */ in php_snmp_internal()
520 add_assoc_zval(return_value, objid_query->vars[count].oid, &snmpval); in php_snmp_internal()
549 …if (objid_query->oid_increasing_check && snmp_oid_compare(objid_query->vars[0].name, objid_query->… in php_snmp_internal()
554 … memcpy((char *)(objid_query->vars[0].name), (char *)vars->name, vars->name_length * sizeof(oid)); in php_snmp_internal()
555 objid_query->vars[0].name_length = vars->name_length; in php_snmp_internal()
560 if (objid_query->offset < objid_query->count) { /* we have unprocessed OIDs */ in php_snmp_internal()
564 …if (st & SNMP_CMD_WALK && response->errstat == SNMP_ERR_TOOBIG && objid_query->max_repetitions > 1… in php_snmp_internal()
565 objid_query->max_repetitions /= 2; in php_snmp_internal()
575 …CMD_GET | SNMP_CMD_GETNEXT) && response->errstat == SNMP_ERR_TOOBIG && objid_query->step > 1) { /*… in php_snmp_internal()
576 …objid_query->offset = ((objid_query->offset > objid_query->step) ? (objid_query->offset - objid_qu… in php_snmp_internal()
577 objid_query->step /= 2; in php_snmp_internal()
596 if (objid_query->array_output) { in php_snmp_internal()
604 if (objid_query->array_output) { in php_snmp_internal()
613 if (objid_query->array_output) { in php_snmp_internal()
632 zval *object, int st, struct objid_query *objid_query, zend_string *oid_str, HashTable *oid_ht, in php_snmp_parse_oid() argument
639 objid_query->count = 0; in php_snmp_parse_oid()
640 objid_query->array_output = (st & SNMP_CMD_WALK) != 0; in php_snmp_parse_oid()
642 objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg)); in php_snmp_parse_oid()
643 objid_query->vars[objid_query->count].oid = ZSTR_VAL(oid_str); in php_snmp_parse_oid()
647 efree(objid_query->vars); in php_snmp_parse_oid()
652 efree(objid_query->vars); in php_snmp_parse_oid()
661 efree(objid_query->vars); in php_snmp_parse_oid()
665 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
666 objid_query->vars[objid_query->count].value = ZSTR_VAL(value_str); in php_snmp_parse_oid()
668 objid_query->count++; in php_snmp_parse_oid()
674 …objid_query->vars = (snmpobjarg *)safe_emalloc(sizeof(snmpobjarg), zend_hash_num_elements(oid_ht),… in php_snmp_parse_oid()
675 objid_query->array_output = (st & SNMP_CMD_SET) == 0; in php_snmp_parse_oid()
678 objid_query->vars[objid_query->count].oid = Z_STRVAL_P(tmp_oid); in php_snmp_parse_oid()
682 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
705 efree(objid_query->vars); in php_snmp_parse_oid()
709 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
713 efree(objid_query->vars); in php_snmp_parse_oid()
719 objid_query->vars[objid_query->count].value = ZSTR_VAL(value_str); in php_snmp_parse_oid()
740 objid_query->vars[objid_query->count].value = Z_STRVAL_P(tmp_value); in php_snmp_parse_oid()
744 efree(objid_query->vars); in php_snmp_parse_oid()
749 objid_query->count++; in php_snmp_parse_oid()
755 if (objid_query->count > 1) { in php_snmp_parse_oid()
757 efree(objid_query->vars); in php_snmp_parse_oid()
760 objid_query->vars[0].name_length = MAX_NAME_LEN; in php_snmp_parse_oid()
761 …if (strlen(objid_query->vars[0].oid)) { /* on a walk, an empty string means top of tree - no error… in php_snmp_parse_oid()
762 …if (!snmp_parse_oid(objid_query->vars[0].oid, objid_query->vars[0].name, &(objid_query->vars[0].na… in php_snmp_parse_oid()
763 …ject, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid); in php_snmp_parse_oid()
764 efree(objid_query->vars); in php_snmp_parse_oid()
768 memmove((char *)objid_query->vars[0].name, (const char *)objid_mib, sizeof(objid_mib)); in php_snmp_parse_oid()
769 objid_query->vars[0].name_length = sizeof(objid_mib) / sizeof(oid); in php_snmp_parse_oid()
772 for (objid_query->offset = 0; objid_query->offset < objid_query->count; objid_query->offset++) { in php_snmp_parse_oid()
773 objid_query->vars[objid_query->offset].name_length = MAX_OID_LEN; in php_snmp_parse_oid()
774 …!snmp_parse_oid(objid_query->vars[objid_query->offset].oid, objid_query->vars[objid_query->offset]… in php_snmp_parse_oid()
775 …NMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offse… in php_snmp_parse_oid()
776 efree(objid_query->vars); in php_snmp_parse_oid()
781 objid_query->offset = 0; in php_snmp_parse_oid()
782 objid_query->step = objid_query->count; in php_snmp_parse_oid()
783 return (objid_query->count > 0); in php_snmp_parse_oid()
1136 struct objid_query objid_query; in php_snmp() local
1142 objid_query.max_repetitions = -1; in php_snmp()
1143 objid_query.non_repeaters = 0; in php_snmp()
1144 objid_query.valueretrieval = SNMP_G(valueretrieval); in php_snmp()
1145 objid_query.oid_increasing_check = true; in php_snmp()
1223 Z_PARAM_LONG(objid_query.max_repetitions) in php_snmp()
1224 Z_PARAM_LONG(objid_query.non_repeaters) in php_snmp()
1247 …if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid_str, oid_ht, type_str, type_ht, value_str… in php_snmp()
1253 efree(objid_query.vars); in php_snmp()
1258 efree(objid_query.vars); in php_snmp()
1269 efree(objid_query.vars); in php_snmp()
1274 objid_query.step = snmp_object->max_oids; in php_snmp()
1275 if (objid_query.max_repetitions < 0) { /* unspecified in function call, use session-wise */ in php_snmp()
1276 objid_query.max_repetitions = snmp_object->max_oids; in php_snmp()
1279 objid_query.oid_increasing_check = snmp_object->oid_increasing_check; in php_snmp()
1280 objid_query.valueretrieval = snmp_object->valueretrieval; in php_snmp()
1289 if (objid_query.max_repetitions < 0) { in php_snmp()
1290 objid_query.max_repetitions = 20; /* provide correct default value */ in php_snmp()
1293 php_snmp_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU, st, session, &objid_query); in php_snmp()
1295 efree(objid_query.vars); in php_snmp()