Lines Matching refs:vars
373 snmpobjarg *vars; member
539 static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval, int valueretrieval) in php_snmp_getvalue() argument
546 int val_len = vars->val_len; in php_snmp_getvalue()
555 if (snprint_value(buf, buflen, vars->name, vars->name_length, vars) == -1) { in php_snmp_getvalue()
594 switch (vars->type) { in php_snmp_getvalue()
596 ZVAL_STRINGL(&val, (char *)vars->val.bitstring, vars->val_len); in php_snmp_getvalue()
601 ZVAL_STRINGL(&val, (char *)vars->val.string, vars->val_len); in php_snmp_getvalue()
609 snprint_objid(buf, buflen, vars->val.objid, vars->val_len / sizeof(oid)); in php_snmp_getvalue()
615 (vars->val.string)[0], (vars->val.string)[1], in php_snmp_getvalue()
616 (vars->val.string)[2], (vars->val.string)[3]); in php_snmp_getvalue()
626 snprintf(buf, buflen, "%lu", *vars->val.integer); in php_snmp_getvalue()
632 snprintf(buf, buflen, "%ld", *vars->val.integer); in php_snmp_getvalue()
639 snprintf(buf, buflen, "%f", *vars->val.floatVal); in php_snmp_getvalue()
644 snprintf(buf, buflen, "%Lf", *vars->val.doubleVal); in php_snmp_getvalue()
649 printI64(buf, vars->val.counter64); in php_snmp_getvalue()
656 printU64(buf, vars->val.counter64); in php_snmp_getvalue()
662 php_error_docref(NULL, E_WARNING, "Unknown value type: %u", vars->type); in php_snmp_getvalue()
672 add_property_long(snmpval, "type", vars->type); in php_snmp_getvalue()
696 struct variable_list *vars; in php_snmp_internal() local
714 …memmove((char *)root, (char *)(objid_query->vars[0].name), (objid_query->vars[0].name_length) * si… in php_snmp_internal()
715 rootlen = objid_query->vars[0].name_length; in php_snmp_internal()
741 snmp_add_null_var(pdu, objid_query->vars[0].name, objid_query->vars[0].name_length); in php_snmp_internal()
757 …y->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length, objid_query… in php_snmp_internal()
758 …snprint_objid(buf, sizeof(buf), objid_query->vars[objid_query->offset].name, objid_query->vars[obj… in php_snmp_internal()
759 …D='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->v… in php_snmp_internal()
766 …snmp_add_null_var(pdu, objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query-… in php_snmp_internal()
791 for (vars = response->variables; vars; vars = vars->next_variable) { in php_snmp_internal()
793 if ( vars->type == SNMP_ENDOFMIBVIEW || in php_snmp_internal()
794 vars->type == SNMP_NOSUCHOBJECT || in php_snmp_internal()
795 vars->type == SNMP_NOSUCHINSTANCE ) { in php_snmp_internal()
799 snprint_objid(buf, sizeof(buf), vars->name, vars->name_length); in php_snmp_internal()
800 snprint_value(buf2, sizeof(buf2), vars->name, vars->name_length, vars); in php_snmp_internal()
806 …(vars->name_length < rootlen || memcmp(root, vars->name, rootlen * sizeof(oid)))) { /* not part of… in php_snmp_internal()
820 php_snmp_getvalue(vars, &snmpval, objid_query->valueretrieval); in php_snmp_internal()
831 …>vars[count].name_length == vars->name_length && snmp_oid_compare(objid_query->vars[count].name, o… in php_snmp_internal()
833 objid_query->vars[count].name_length = 0; /* mark this name as used */ in php_snmp_internal()
838 add_assoc_zval(return_value, objid_query->vars[count].oid, &snmpval); in php_snmp_internal()
840 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
844 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
845 … if (rootlen <= vars->name_length && snmp_oid_compare(root, rootlen, vars->name, rootlen) == 0) { in php_snmp_internal()
848 while(count < vars->name_length){ in php_snmp_internal()
849 sprintf(buf, "%lu.", vars->name[count]); in php_snmp_internal()
857 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
867 …ck == TRUE && snmp_oid_compare(objid_query->vars[0].name, objid_query->vars[0].name_length, vars->… in php_snmp_internal()
868 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
872 … memmove((char *)(objid_query->vars[0].name), (char *)vars->name, vars->name_length * sizeof(oid)); in php_snmp_internal()
873 objid_query->vars[0].name_length = vars->name_length; in php_snmp_internal()
889 for (count=1, vars = response->variables; in php_snmp_internal()
890 vars && count != response->errindex; in php_snmp_internal()
891 vars = vars->next_variable, count++); in php_snmp_internal()
900 if (vars) { in php_snmp_internal()
901 snprint_objid(buf, sizeof(buf), vars->name, vars->name_length); in php_snmp_internal()
976 objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg)); in php_snmp_parse_oid()
977 if (objid_query->vars == NULL) { in php_snmp_parse_oid()
979 efree(objid_query->vars); in php_snmp_parse_oid()
982 objid_query->vars[objid_query->count].oid = Z_STRVAL_P(oid); in php_snmp_parse_oid()
987 efree(objid_query->vars); in php_snmp_parse_oid()
991 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
992 objid_query->vars[objid_query->count].value = Z_STRVAL_P(value); in php_snmp_parse_oid()
995 efree(objid_query->vars); in php_snmp_parse_oid()
1005 …objid_query->vars = (snmpobjarg *)safe_emalloc(sizeof(snmpobjarg), zend_hash_num_elements(Z_ARRVAL… in php_snmp_parse_oid()
1006 if (objid_query->vars == NULL) { in php_snmp_parse_oid()
1008 efree(objid_query->vars); in php_snmp_parse_oid()
1014 objid_query->vars[objid_query->count].oid = Z_STRVAL_P(tmp_oid); in php_snmp_parse_oid()
1018 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
1031 efree(objid_query->vars); in php_snmp_parse_oid()
1035 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
1039 efree(objid_query->vars); in php_snmp_parse_oid()
1045 objid_query->vars[objid_query->count].value = Z_STRVAL_P(value); in php_snmp_parse_oid()
1056 objid_query->vars[objid_query->count].value = Z_STRVAL_P(tmp_value); in php_snmp_parse_oid()
1060 efree(objid_query->vars); in php_snmp_parse_oid()
1073 efree(objid_query->vars); in php_snmp_parse_oid()
1076 objid_query->vars[0].name_length = MAX_NAME_LEN; in php_snmp_parse_oid()
1077 …if (strlen(objid_query->vars[0].oid)) { /* on a walk, an empty string means top of tree - no error… in php_snmp_parse_oid()
1078 …if (!snmp_parse_oid(objid_query->vars[0].oid, objid_query->vars[0].name, &(objid_query->vars[0].na… in php_snmp_parse_oid()
1079 …NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid); in php_snmp_parse_oid()
1080 efree(objid_query->vars); in php_snmp_parse_oid()
1084 memmove((char *)objid_query->vars[0].name, (char *)objid_mib, sizeof(objid_mib)); in php_snmp_parse_oid()
1085 objid_query->vars[0].name_length = sizeof(objid_mib) / sizeof(oid); in php_snmp_parse_oid()
1089 objid_query->vars[objid_query->offset].name_length = MAX_OID_LEN; in php_snmp_parse_oid()
1090 …!snmp_parse_oid(objid_query->vars[objid_query->offset].oid, objid_query->vars[objid_query->offset]… in php_snmp_parse_oid()
1091 …MP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offset… in php_snmp_parse_oid()
1092 efree(objid_query->vars); in php_snmp_parse_oid()
1491 efree(objid_query.vars); in php_snmp()
1496 efree(objid_query.vars); in php_snmp()
1507 efree(objid_query.vars); in php_snmp()
1533 efree(objid_query.vars); in php_snmp()