Lines Matching refs:vars
384 snmpobjarg *vars; member
551 static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_DC, int valueretriev… in php_snmp_getvalue() argument
558 int val_len = vars->val_len; in php_snmp_getvalue()
567 if (snprint_value(buf, buflen, vars->name, vars->name_length, vars) == -1) { in php_snmp_getvalue()
608 switch (vars->type) { in php_snmp_getvalue()
610 ZVAL_STRINGL(val, (char *)vars->val.bitstring, vars->val_len, 1); in php_snmp_getvalue()
615 ZVAL_STRINGL(val, (char *)vars->val.string, vars->val_len, 1); in php_snmp_getvalue()
623 snprint_objid(buf, buflen, vars->val.objid, vars->val_len / sizeof(oid)); in php_snmp_getvalue()
629 (vars->val.string)[0], (vars->val.string)[1], in php_snmp_getvalue()
630 (vars->val.string)[2], (vars->val.string)[3]); in php_snmp_getvalue()
640 snprintf(buf, buflen, "%lu", *vars->val.integer); in php_snmp_getvalue()
646 snprintf(buf, buflen, "%ld", *vars->val.integer); in php_snmp_getvalue()
653 snprintf(buf, buflen, "%f", *vars->val.floatVal); in php_snmp_getvalue()
658 snprintf(buf, buflen, "%Lf", *vars->val.doubleVal); in php_snmp_getvalue()
663 printI64(buf, vars->val.counter64); in php_snmp_getvalue()
670 printU64(buf, vars->val.counter64); in php_snmp_getvalue()
676 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value type: %u", vars->type); in php_snmp_getvalue()
686 add_property_long(snmpval, "type", vars->type); in php_snmp_getvalue()
711 struct variable_list *vars; in php_snmp_internal() local
729 …memmove((char *)root, (char *)(objid_query->vars[0].name), (objid_query->vars[0].name_length) * si… in php_snmp_internal()
730 rootlen = objid_query->vars[0].name_length; in php_snmp_internal()
756 snmp_add_null_var(pdu, objid_query->vars[0].name, objid_query->vars[0].name_length); in php_snmp_internal()
772 …y->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length, objid_query… in php_snmp_internal()
773 …snprint_objid(buf, sizeof(buf), objid_query->vars[objid_query->offset].name, objid_query->vars[obj… in php_snmp_internal()
774 …D='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->v… in php_snmp_internal()
781 …snmp_add_null_var(pdu, objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query-… in php_snmp_internal()
806 for (vars = response->variables; vars; vars = vars->next_variable) { in php_snmp_internal()
808 if ( vars->type == SNMP_ENDOFMIBVIEW || in php_snmp_internal()
809 vars->type == SNMP_NOSUCHOBJECT || in php_snmp_internal()
810 vars->type == SNMP_NOSUCHINSTANCE ) { in php_snmp_internal()
814 snprint_objid(buf, sizeof(buf), vars->name, vars->name_length); in php_snmp_internal()
815 snprint_value(buf2, sizeof(buf2), vars->name, vars->name_length, vars); in php_snmp_internal()
821 …(vars->name_length < rootlen || memcmp(root, vars->name, rootlen * sizeof(oid)))) { /* not part of… in php_snmp_internal()
835 php_snmp_getvalue(vars, snmpval TSRMLS_CC, objid_query->valueretrieval); in php_snmp_internal()
846 …>vars[count].name_length == vars->name_length && snmp_oid_compare(objid_query->vars[count].name, o… in php_snmp_internal()
848 objid_query->vars[count].name_length = 0; /* mark this name as used */ in php_snmp_internal()
853 add_assoc_zval(return_value, objid_query->vars[count].oid, snmpval); in php_snmp_internal()
855 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
859 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
860 … if (rootlen <= vars->name_length && snmp_oid_compare(root, rootlen, vars->name, rootlen) == 0) { in php_snmp_internal()
863 while(count < vars->name_length){ in php_snmp_internal()
864 sprintf(buf, "%lu.", vars->name[count]); in php_snmp_internal()
872 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
884 …ck == TRUE && snmp_oid_compare(objid_query->vars[0].name, objid_query->vars[0].name_length, vars->… in php_snmp_internal()
885 snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); in php_snmp_internal()
889 … memmove((char *)(objid_query->vars[0].name), (char *)vars->name, vars->name_length * sizeof(oid)); in php_snmp_internal()
890 objid_query->vars[0].name_length = vars->name_length; in php_snmp_internal()
906 for ( count=1, vars = response->variables; in php_snmp_internal()
907 vars && count != response->errindex; in php_snmp_internal()
908 vars = vars->next_variable, count++); in php_snmp_internal()
917 if (vars) { in php_snmp_internal()
918 snprint_objid(buf, sizeof(buf), vars->name, vars->name_length); in php_snmp_internal()
1008 objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg)); in php_snmp_parse_oid()
1009 if (objid_query->vars == NULL) { in php_snmp_parse_oid()
1011 efree(objid_query->vars); in php_snmp_parse_oid()
1014 objid_query->vars[objid_query->count].oid = Z_STRVAL_PP(oid); in php_snmp_parse_oid()
1019 efree(objid_query->vars); in php_snmp_parse_oid()
1023 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
1024 objid_query->vars[objid_query->count].value = Z_STRVAL_PP(value); in php_snmp_parse_oid()
1027 efree(objid_query->vars); in php_snmp_parse_oid()
1037 …objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg) * zend_hash_num_elements(Z_ARRVAL_PP(… in php_snmp_parse_oid()
1038 if (objid_query->vars == NULL) { in php_snmp_parse_oid()
1040 efree(objid_query->vars); in php_snmp_parse_oid()
1049 objid_query->vars[objid_query->count].oid = Z_STRVAL_PP(tmp_oid); in php_snmp_parse_oid()
1053 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
1059 efree(objid_query->vars); in php_snmp_parse_oid()
1063 objid_query->vars[objid_query->count].type = *pptr; in php_snmp_parse_oid()
1067 efree(objid_query->vars); in php_snmp_parse_oid()
1073 objid_query->vars[objid_query->count].value = Z_STRVAL_PP(value); in php_snmp_parse_oid()
1077 objid_query->vars[objid_query->count].value = Z_STRVAL_PP(tmp_value); in php_snmp_parse_oid()
1081 efree(objid_query->vars); in php_snmp_parse_oid()
1094 efree(objid_query->vars); in php_snmp_parse_oid()
1097 objid_query->vars[0].name_length = MAX_NAME_LEN; in php_snmp_parse_oid()
1098 …if (strlen(objid_query->vars[0].oid)) { /* on a walk, an empty string means top of tree - no error… in php_snmp_parse_oid()
1099 …if (!snmp_parse_oid(objid_query->vars[0].oid, objid_query->vars[0].name, &(objid_query->vars[0].na… in php_snmp_parse_oid()
1100 …S_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid); in php_snmp_parse_oid()
1101 efree(objid_query->vars); in php_snmp_parse_oid()
1105 memmove((char *)objid_query->vars[0].name, (char *)objid_mib, sizeof(objid_mib)); in php_snmp_parse_oid()
1106 objid_query->vars[0].name_length = sizeof(objid_mib) / sizeof(oid); in php_snmp_parse_oid()
1110 objid_query->vars[objid_query->offset].name_length = MAX_OID_LEN; in php_snmp_parse_oid()
1111 …!snmp_parse_oid(objid_query->vars[objid_query->offset].oid, objid_query->vars[objid_query->offset]… in php_snmp_parse_oid()
1112 …MP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offset… in php_snmp_parse_oid()
1113 efree(objid_query->vars); in php_snmp_parse_oid()
1512 efree(objid_query.vars); in php_snmp()
1517 efree(objid_query.vars); in php_snmp()
1528 efree(objid_query.vars); in php_snmp()
1554 efree(objid_query.vars); in php_snmp()