Lines Matching refs:vars
120 snmpobjarg *vars; member
240 static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval, int valueretrieval) in php_snmp_getvalue() argument
247 int val_len = vars->val_len; in php_snmp_getvalue()
256 if (snprint_value(buf, buflen, vars->name, vars->name_length, vars) == -1) { in php_snmp_getvalue()
285 switch (vars->type) { in php_snmp_getvalue()
287 ZVAL_STRINGL(&val, (char *)vars->val.bitstring, vars->val_len); in php_snmp_getvalue()
292 ZVAL_STRINGL(&val, (char *)vars->val.string, vars->val_len); in php_snmp_getvalue()
300 snprint_objid(buf, buflen, vars->val.objid, vars->val_len / sizeof(oid)); in php_snmp_getvalue()
306 (vars->val.string)[0], (vars->val.string)[1], in php_snmp_getvalue()
307 (vars->val.string)[2], (vars->val.string)[3]); in php_snmp_getvalue()
317 snprintf(buf, buflen, "%lu", *vars->val.integer); in php_snmp_getvalue()
323 snprintf(buf, buflen, "%ld", *vars->val.integer); in php_snmp_getvalue()
330 snprintf(buf, buflen, "%f", *vars->val.floatVal); in php_snmp_getvalue()
335 snprintf(buf, buflen, "%f", *vars->val.doubleVal); in php_snmp_getvalue()
340 printI64(buf, vars->val.counter64); in php_snmp_getvalue()
347 printU64(buf, vars->val.counter64); in php_snmp_getvalue()
353 php_error_docref(NULL, E_WARNING, "Unknown value type: %u", vars->type); in php_snmp_getvalue()
363 add_property_long(snmpval, "type", vars->type); in php_snmp_getvalue()
387 struct variable_list *vars; in php_snmp_internal() local
405 …memcpy((char *)root, (char *)(objid_query->vars[0].name), (objid_query->vars[0].name_length) * siz… in php_snmp_internal()
406 rootlen = objid_query->vars[0].name_length; in php_snmp_internal()
431 snmp_add_null_var(pdu, objid_query->vars[0].name, objid_query->vars[0].name_length); in php_snmp_internal()
446 …y->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length, objid_query… in php_snmp_internal()
447 …snprint_objid(buf, sizeof(buf), objid_query->vars[objid_query->offset].name, objid_query->vars[obj… in php_snmp_internal()
448 …D='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->v… in php_snmp_internal()
454 …snmp_add_null_var(pdu, objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query-… in php_snmp_internal()
478 for (vars = response->variables; vars; vars = vars->next_variable) { in php_snmp_internal()
480 if ( vars->type == SNMP_ENDOFMIBVIEW || in php_snmp_internal()
481 vars->type == SNMP_NOSUCHOBJECT || in php_snmp_internal()
482 vars->type == SNMP_NOSUCHINSTANCE ) { in php_snmp_internal()
486 snprint_objid(buf, sizeof(buf), vars->name, vars->name_length); in php_snmp_internal()
487 snprint_value(buf2, sizeof(buf2), vars->name, vars->name_length, vars); in php_snmp_internal()
493 …(vars->name_length < rootlen || memcmp(root, vars->name, rootlen * sizeof(oid)))) { /* not part of… in php_snmp_internal()
507 php_snmp_getvalue(vars, &snmpval, objid_query->valueretrieval); in php_snmp_internal()
518 …>vars[count].name_length == vars->name_length && snmp_oid_compare(objid_query->vars[count].name, o… in php_snmp_internal()
520 objid_query->vars[count].name_length = 0; /* mark this name as used */ in php_snmp_internal()
525 add_assoc_zval(return_value, objid_query->vars[count].oid, &snmpval); in php_snmp_internal()
527 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
531 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
532 … if (rootlen <= vars->name_length && snmp_oid_compare(root, rootlen, vars->name, rootlen) == 0) { in php_snmp_internal()
535 while(count < vars->name_length){ in php_snmp_internal()
536 snprintf(buf, sizeof(buf), "%lu.", vars->name[count]); in php_snmp_internal()
544 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
554 …sing_check && snmp_oid_compare(objid_query->vars[0].name, objid_query->vars[0].name_length, vars->… in php_snmp_internal()
555 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
559 … memcpy((char *)(objid_query->vars[0].name), (char *)vars->name, vars->name_length * sizeof(oid)); in php_snmp_internal()
560 objid_query->vars[0].name_length = vars->name_length; in php_snmp_internal()
576 for (count=1, vars = response->variables; in php_snmp_internal()
577 vars && count != response->errindex; in php_snmp_internal()
578 vars = vars->next_variable, count++); in php_snmp_internal()
587 if (vars) { in php_snmp_internal()
588 snprint_objid(buf, sizeof(buf), vars->name, vars->name_length); in php_snmp_internal()
647 objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg)); in php_snmp_parse_oid()
648 objid_query->vars[objid_query->count].oid = ZSTR_VAL(oid_str); in php_snmp_parse_oid()
652 efree(objid_query->vars); in php_snmp_parse_oid()
657 efree(objid_query->vars); in php_snmp_parse_oid()
666 efree(objid_query->vars); in php_snmp_parse_oid()
670 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
671 objid_query->vars[objid_query->count].value = ZSTR_VAL(value_str); in php_snmp_parse_oid()
679 …objid_query->vars = (snmpobjarg *)safe_emalloc(sizeof(snmpobjarg), zend_hash_num_elements(oid_ht),… in php_snmp_parse_oid()
683 objid_query->vars[objid_query->count].oid = Z_STRVAL_P(tmp_oid); in php_snmp_parse_oid()
687 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
710 efree(objid_query->vars); in php_snmp_parse_oid()
714 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
718 efree(objid_query->vars); in php_snmp_parse_oid()
724 objid_query->vars[objid_query->count].value = ZSTR_VAL(value_str); in php_snmp_parse_oid()
745 objid_query->vars[objid_query->count].value = Z_STRVAL_P(tmp_value); in php_snmp_parse_oid()
749 efree(objid_query->vars); in php_snmp_parse_oid()
762 efree(objid_query->vars); in php_snmp_parse_oid()
765 objid_query->vars[0].name_length = MAX_NAME_LEN; in php_snmp_parse_oid()
766 …if (strlen(objid_query->vars[0].oid)) { /* on a walk, an empty string means top of tree - no error… in php_snmp_parse_oid()
767 …if (!snmp_parse_oid(objid_query->vars[0].oid, objid_query->vars[0].name, &(objid_query->vars[0].na… in php_snmp_parse_oid()
768 …ject, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid); in php_snmp_parse_oid()
769 efree(objid_query->vars); in php_snmp_parse_oid()
773 memmove((char *)objid_query->vars[0].name, (const char *)objid_mib, sizeof(objid_mib)); in php_snmp_parse_oid()
774 objid_query->vars[0].name_length = sizeof(objid_mib) / sizeof(oid); in php_snmp_parse_oid()
778 objid_query->vars[objid_query->offset].name_length = MAX_OID_LEN; in php_snmp_parse_oid()
779 …!snmp_parse_oid(objid_query->vars[objid_query->offset].oid, objid_query->vars[objid_query->offset]… in php_snmp_parse_oid()
780 …MP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offset… in php_snmp_parse_oid()
781 efree(objid_query->vars); in php_snmp_parse_oid()
1253 efree(objid_query.vars); in php_snmp()
1258 efree(objid_query.vars); in php_snmp()
1269 efree(objid_query.vars); in php_snmp()
1295 efree(objid_query.vars); in php_snmp()