diff options
author | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
commit | bdeb220f48825642f84cdbf3ff23a30613c92e86 (patch) | |
tree | 1a6cf34d20420e4815b4becb21311a4457d84103 /ext/snmp/snmp.c | |
parent | bb66f385d09e7e55390e9f57fcbca08f6b43ff91 (diff) | |
download | php-git-bdeb220f48825642f84cdbf3ff23a30613c92e86.tar.gz |
first shot remove TSRMLS_* things
Diffstat (limited to 'ext/snmp/snmp.c')
-rw-r--r-- | ext/snmp/snmp.c | 244 |
1 files changed, 122 insertions, 122 deletions
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 90c1bff951..4f42cac2d0 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -103,7 +103,7 @@ typedef struct snmp_session php_snmp_session; int i = 0; \ while (b[i].name != NULL) { \ php_snmp_add_property((a), (b)[i].name, (b)[i].name_length, \ - (php_snmp_read_t)(b)[i].read_func, (php_snmp_write_t)(b)[i].write_func TSRMLS_CC); \ + (php_snmp_read_t)(b)[i].read_func, (php_snmp_write_t)(b)[i].write_func); \ i++; \ } \ } @@ -467,14 +467,14 @@ static void netsnmp_session_free(php_snmp_session **session) /* {{{ */ } /* }}} */ -static void php_snmp_session_destructor(zend_resource *rsrc TSRMLS_DC) /* {{{ */ +static void php_snmp_session_destructor(zend_resource *rsrc) /* {{{ */ { php_snmp_session *session = (php_snmp_session *)rsrc->ptr; netsnmp_session_free(&session); } /* }}} */ -static void php_snmp_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */ +static void php_snmp_object_free_storage(zend_object *object) /* {{{ */ { php_snmp_object *intern = php_snmp_fetch_object(object); @@ -484,18 +484,18 @@ static void php_snmp_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ * netsnmp_session_free(&(intern->session)); - zend_object_std_dtor(&intern->zo TSRMLS_CC); + zend_object_std_dtor(&intern->zo); } /* }}} */ -static zend_object *php_snmp_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ +static zend_object *php_snmp_object_new(zend_class_entry *class_type) /* {{{ */ { php_snmp_object *intern; /* Allocate memory for it */ intern = ecalloc(1, sizeof(php_snmp_object) + sizeof(zval) * (class_type->default_properties_count - 1)); - zend_object_std_init(&intern->zo, class_type TSRMLS_CC); + zend_object_std_init(&intern->zo, class_type); object_properties_init(&intern->zo, class_type); intern->zo.handlers = &php_snmp_object_handlers; @@ -510,7 +510,7 @@ static zend_object *php_snmp_object_new(zend_class_entry *class_type TSRMLS_DC) * Record last SNMP-related error in object * */ -static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, const char *format, ...) +static void php_snmp_error(zval *object, const char *docref, int type, const char *format, ...) { va_list args; php_snmp_object *snmp_object = NULL; @@ -532,10 +532,10 @@ static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, } if (object && (snmp_object->exceptions_enabled & type)) { - zend_throw_exception_ex(php_snmp_exception_ce, type TSRMLS_CC, snmp_object->snmp_errstr); + zend_throw_exception_ex(php_snmp_exception_ce, type, snmp_object->snmp_errstr); } else { va_start(args, format); - php_verror(docref, "", E_WARNING, format, args TSRMLS_CC); + php_verror(docref, "", E_WARNING, format, args); va_end(args); } } @@ -547,7 +547,7 @@ static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, * SNMP value to zval converter * */ -static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_DC, int valueretrieval) +static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval, int valueretrieval) { zval val; char sbuf[512]; @@ -565,7 +565,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D *buf = '\0'; if (snprint_value(buf, buflen, vars->name, vars->name_length, vars) == -1) { if (val_len > 512*1024) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "snprint_value() asks for a buffer more than 512k, Net-SNMP bug?"); + php_error_docref(NULL, E_WARNING, "snprint_value() asks for a buffer more than 512k, Net-SNMP bug?"); break; } /* buffer is not long enough to hold full output, double it */ @@ -581,7 +581,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D } if (!dbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno)); + php_error_docref(NULL, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno)); buf = &(sbuf[0]); buflen = sizeof(sbuf) - 1; break; @@ -596,7 +596,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D buf = dbuf; buflen = val_len; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno)); + php_error_docref(NULL, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno)); } } @@ -670,7 +670,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D default: ZVAL_STRING(&val, "Unknown value type"); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value type: %u", vars->type); + php_error_docref(NULL, E_WARNING, "Unknown value type: %u", vars->type); break; } } else /* use Net-SNMP value translation */ { @@ -719,7 +719,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, RETVAL_FALSE; /* reset errno and errstr */ - php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_NOERROR, ""); + php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_NOERROR, ""); if (st & SNMP_CMD_WALK) { /* remember root OID */ memmove((char *)root, (char *)(objid_query->vars[0].name), (objid_query->vars[0].name_length) * sizeof(oid)); @@ -729,14 +729,14 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, if ((ss = snmp_open(session)) == NULL) { snmp_error(session, NULL, NULL, &err); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open snmp connection: %s", err); + php_error_docref(NULL, E_WARNING, "Could not open snmp connection: %s", err); free(err); RETVAL_FALSE; return; } if ((st & SNMP_CMD_SET) && objid_query->count > objid_query->step) { - php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES, "Can not fit all OIDs for SET query into one packet, using multiple queries"); + php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES, "Can not fit all OIDs for SET query into one packet, using multiple queries"); } while (keepwalking) { @@ -759,7 +759,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, pdu = snmp_pdu_create(SNMP_MSG_SET); } else { snmp_close(ss); - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown SNMP command (internals)"); + php_error_docref(NULL, E_ERROR, "Unknown SNMP command (internals)"); RETVAL_FALSE; return; } @@ -767,7 +767,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, if (st & SNMP_CMD_SET) { if ((snmp_errno = snmp_add_var(pdu, objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value))) { snprint_objid(buf, sizeof(buf), objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length); - php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Could not add variable: OID='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value, snmp_api_errstring(snmp_errno)); + php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Could not add variable: OID='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value, snmp_api_errstring(snmp_errno)); snmp_free_pdu(pdu); snmp_close(ss); RETVAL_FALSE; @@ -809,7 +809,7 @@ retry: } snprint_objid(buf, sizeof(buf), vars->name, vars->name_length); snprint_value(buf2, sizeof(buf2), vars->name, vars->name_length, vars); - php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, buf2); + php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, buf2); continue; } @@ -828,7 +828,7 @@ retry: } ZVAL_NULL(&snmpval); - php_snmp_getvalue(vars, &snmpval TSRMLS_CC, objid_query->valueretrieval); + php_snmp_getvalue(vars, &snmpval, objid_query->valueretrieval); if (objid_query->array_output) { if (Z_TYPE_P(return_value) == IS_TRUE || Z_TYPE_P(return_value) == IS_FALSE) { @@ -849,7 +849,7 @@ retry: add_assoc_zval(return_value, objid_query->vars[count].oid, &snmpval); } else { snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find original OID name for '%s'", buf2); + php_error_docref(NULL, E_WARNING, "Could not find original OID name for '%s'", buf2); } } else if (st & SNMP_USE_SUFFIX_AS_KEYS && st & SNMP_CMD_WALK) { snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length); @@ -877,7 +877,7 @@ retry: if (st & SNMP_CMD_WALK) { if (objid_query->oid_increasing_check == TRUE && snmp_oid_compare(objid_query->vars[0].name, objid_query->vars[0].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); + php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_OID_NOT_INCREASING, "Error: OID not increasing: %s", buf2); keepwalking = 0; } else { memmove((char *)(objid_query->vars[0].name), (char *)vars->name, vars->name_length * sizeof(oid)); @@ -910,9 +910,9 @@ retry: } if (vars) { snprint_objid(buf, sizeof(buf), vars->name, vars->name_length); - php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, snmp_errstring(response->errstat)); + php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, snmp_errstring(response->errstat)); } else { - php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at %u object_id: %s", response->errindex, snmp_errstring(response->errstat)); + php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at %u object_id: %s", response->errindex, snmp_errstring(response->errstat)); } if (st & (SNMP_CMD_GET | SNMP_CMD_GETNEXT)) { /* cut out bogus OID and retry */ if ((pdu = snmp_fix_pdu(response, ((st & SNMP_CMD_GET) ? SNMP_MSG_GET : SNMP_MSG_GETNEXT) )) != NULL) { @@ -930,7 +930,7 @@ retry: } } } else if (status == STAT_TIMEOUT) { - php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_TIMEOUT, "No response from %s", session->peername); + php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_TIMEOUT, "No response from %s", session->peername); if (objid_query->array_output) { zval_ptr_dtor(return_value); } @@ -939,7 +939,7 @@ retry: return; } else { /* status == STAT_ERROR */ snmp_error(ss, NULL, NULL, &err); - php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_GENERIC, "Fatal error: %s", err); + php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_GENERIC, "Fatal error: %s", err); free(err); if (objid_query->array_output) { zval_ptr_dtor(return_value); @@ -961,7 +961,7 @@ retry: * OID parser (and type, value for SNMP_SET command) */ -static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_query, zval *oid, zval *type, zval *value TSRMLS_DC) +static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_query, zval *oid, zval *type, zval *value) { char *pptr; HashPosition pos_oid, pos_type, pos_value; @@ -1007,7 +1007,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu if (Z_TYPE_P(oid) == IS_STRING) { objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg)); if (objid_query->vars == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed while parsing oid: %s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "emalloc() failed while parsing oid: %s", strerror(errno)); efree(objid_query->vars); return FALSE; } @@ -1015,7 +1015,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu if (st & SNMP_CMD_SET) { if (Z_TYPE_P(type) == IS_STRING && Z_TYPE_P(value) == IS_STRING) { if (Z_STRLEN_P(type) != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bogus type '%s', should be single char, got %u", Z_STRVAL_P(type), Z_STRLEN_P(type)); + php_error_docref(NULL, E_WARNING, "Bogus type '%s', should be single char, got %u", Z_STRVAL_P(type), Z_STRLEN_P(type)); efree(objid_query->vars); return FALSE; } @@ -1023,7 +1023,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu objid_query->vars[objid_query->count].type = *pptr; objid_query->vars[objid_query->count].value = Z_STRVAL_P(value); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Single objid and multiple type or values are not supported"); + php_error_docref(NULL, E_WARNING, "Single objid and multiple type or values are not supported"); efree(objid_query->vars); return FALSE; } @@ -1031,12 +1031,12 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu objid_query->count++; } else if (Z_TYPE_P(oid) == IS_ARRAY) { /* we got objid array */ if (zend_hash_num_elements(Z_ARRVAL_P(oid)) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got empty OID array"); + php_error_docref(NULL, E_WARNING, "Got empty OID array"); return FALSE; } objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg) * zend_hash_num_elements(Z_ARRVAL_P(oid))); if (objid_query->vars == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed while parsing oid array: %s", strerror(errno)); + php_error_docref(NULL, E_WARNING, "emalloc() failed while parsing oid array: %s", strerror(errno)); efree(objid_query->vars); return FALSE; } @@ -1055,7 +1055,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu if ((tmp_type = zend_hash_get_current_data_ex(Z_ARRVAL_P(type), &pos_type)) != NULL) { convert_to_string_ex(tmp_type); if (Z_STRLEN_P(tmp_type) != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s': bogus type '%s', should be single char, got %u", Z_STRVAL_P(tmp_oid), Z_STRVAL_P(tmp_type), Z_STRLEN_P(tmp_type)); + php_error_docref(NULL, E_WARNING, "'%s': bogus type '%s', should be single char, got %u", Z_STRVAL_P(tmp_oid), Z_STRVAL_P(tmp_type), Z_STRLEN_P(tmp_type)); efree(objid_query->vars); return FALSE; } @@ -1063,7 +1063,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu objid_query->vars[objid_query->count].type = *pptr; zend_hash_move_forward_ex(Z_ARRVAL_P(type), &pos_type); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s': no type set", Z_STRVAL_P(tmp_oid)); + php_error_docref(NULL, E_WARNING, "'%s': no type set", Z_STRVAL_P(tmp_oid)); efree(objid_query->vars); return FALSE; } @@ -1077,7 +1077,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu objid_query->vars[objid_query->count].value = Z_STRVAL_P(tmp_value); zend_hash_move_forward_ex(Z_ARRVAL_P(value), &pos_value); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s': no value set", Z_STRVAL_P(tmp_oid)); + php_error_docref(NULL, E_WARNING, "'%s': no value set", Z_STRVAL_P(tmp_oid)); efree(objid_query->vars); return FALSE; } @@ -1090,14 +1090,14 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu /* now parse all OIDs */ if (st & SNMP_CMD_WALK) { if (objid_query->count > 1) { - php_snmp_error(object, NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Multi OID walks are not supported!"); + php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Multi OID walks are not supported!"); efree(objid_query->vars); return FALSE; } objid_query->vars[0].name_length = MAX_NAME_LEN; if (strlen(objid_query->vars[0].oid)) { /* on a walk, an empty string means top of tree - no error */ if (!snmp_parse_oid(objid_query->vars[0].oid, objid_query->vars[0].name, &(objid_query->vars[0].name_length))) { - php_snmp_error(object, NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid); + php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid); efree(objid_query->vars); return FALSE; } @@ -1109,7 +1109,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu for (objid_query->offset = 0; objid_query->offset < objid_query->count; objid_query->offset++) { objid_query->vars[objid_query->offset].name_length = MAX_OID_LEN; if (!snmp_parse_oid(objid_query->vars[objid_query->offset].oid, objid_query->vars[objid_query->offset].name, &(objid_query->vars[objid_query->offset].name_length))) { - php_snmp_error(object, NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offset].oid); + php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offset].oid); efree(objid_query->vars); return FALSE; } @@ -1124,7 +1124,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu /* {{{ netsnmp_session_init allocates memory for session and session->peername, caller should free it manually using netsnmp_session_free() and efree() */ -static int netsnmp_session_init(php_snmp_session **session_p, int version, char *hostname, char *community, int timeout, int retries TSRMLS_DC) +static int netsnmp_session_init(php_snmp_session **session_p, int version, char *hostname, char *community, int timeout, int retries) { php_snmp_session *session; char *pptr, *host_ptr; @@ -1136,7 +1136,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char *session_p = (php_snmp_session *)emalloc(sizeof(php_snmp_session)); session = *session_p; if (session == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed allocating session"); + php_error_docref(NULL, E_WARNING, "emalloc() failed allocating session"); return (-1); } memset(session, 0, sizeof(php_snmp_session)); @@ -1148,7 +1148,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char session->peername = emalloc(MAX_NAME_LEN); if (session->peername == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed while copying hostname"); + php_error_docref(NULL, E_WARNING, "emalloc() failed while copying hostname"); return (-1); } /* we copy original hostname for further processing */ @@ -1165,7 +1165,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char } *pptr = '\0'; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "malformed IPv6 address, closing square bracket missing"); + php_error_docref(NULL, E_WARNING, "malformed IPv6 address, closing square bracket missing"); return (-1); } } else { /* IPv4 address */ @@ -1177,7 +1177,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char /* since Net-SNMP library requires 'udp6:' prefix for all IPv6 addresses (in FQDN form too) we need to perform possible name resolution before running any SNMP queries */ - if ((n = php_network_getaddresses(host_ptr, SOCK_DGRAM, &psal, NULL TSRMLS_CC)) == 0) { /* some resolver error */ + if ((n = php_network_getaddresses(host_ptr, SOCK_DGRAM, &psal, NULL)) == 0) { /* some resolver error */ /* warnings sent, bailing out */ return (-1); } @@ -1214,7 +1214,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char } if (strlen(session->peername) == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown failure while resolving '%s'", hostname); + php_error_docref(NULL, E_WARNING, "Unknown failure while resolving '%s'", hostname); return (-1); } /* XXX FIXME @@ -1264,7 +1264,7 @@ static int netsnmp_session_set_sec_level(struct snmp_session *s, char *level) /* {{{ int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot) Set the authentication protocol in the snmpv3 session */ -static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot TSRMLS_DC) +static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot) { if (!strcasecmp(prot, "MD5")) { s->securityAuthProto = usmHMACMD5AuthProtocol; @@ -1273,7 +1273,7 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot s->securityAuthProto = usmHMACSHA1AuthProtocol; s->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown authentication protocol '%s'", prot); + php_error_docref(NULL, E_WARNING, "Unknown authentication protocol '%s'", prot); return (-1); } return (0); @@ -1282,7 +1282,7 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot /* {{{ int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot) Set the security protocol in the snmpv3 session */ -static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot TSRMLS_DC) +static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot) { if (!strcasecmp(prot, "DES")) { s->securityPrivProto = usmDESPrivProtocol; @@ -1293,7 +1293,7 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T s->securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN; #endif } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown security protocol '%s'", prot); + php_error_docref(NULL, E_WARNING, "Unknown security protocol '%s'", prot); return (-1); } return (0); @@ -1302,14 +1302,14 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T /* {{{ int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass) Make key from pass phrase in the snmpv3 session */ -static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass TSRMLS_DC) +static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass) { int snmp_errno; s->securityAuthKeyLen = USM_AUTH_KU_LEN; if ((snmp_errno = generate_Ku(s->securityAuthProto, s->securityAuthProtoLen, (u_char *) pass, strlen(pass), s->securityAuthKey, &(s->securityAuthKeyLen)))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error generating a key for authentication pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno)); + php_error_docref(NULL, E_WARNING, "Error generating a key for authentication pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno)); return (-1); } return (0); @@ -1318,7 +1318,7 @@ static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass TSRML /* {{{ int netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass) Make key from pass phrase in the snmpv3 session */ -static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass TSRMLS_DC) +static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass) { int snmp_errno; @@ -1326,7 +1326,7 @@ static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass TSRMLS if ((snmp_errno = generate_Ku(s->securityAuthProto, s->securityAuthProtoLen, (u_char *)pass, strlen(pass), s->securityPrivKey, &(s->securityPrivKeyLen)))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error generating a key for privacy pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno)); + php_error_docref(NULL, E_WARNING, "Error generating a key for privacy pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno)); return (-2); } return (0); @@ -1335,17 +1335,17 @@ static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass TSRMLS /* {{{ in netsnmp_session_set_contextEngineID(struct snmp_session *s, u_char * contextEngineID) Set context Engine Id in the snmpv3 session */ -static int netsnmp_session_set_contextEngineID(struct snmp_session *s, char * contextEngineID TSRMLS_DC) +static int netsnmp_session_set_contextEngineID(struct snmp_session *s, char * contextEngineID) { size_t ebuf_len = 32, eout_len = 0; u_char *ebuf = (u_char *) emalloc(ebuf_len); if (ebuf == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "malloc failure setting contextEngineID"); + php_error_docref(NULL, E_WARNING, "malloc failure setting contextEngineID"); return (-1); } if (!snmp_hex_to_binary(&ebuf, &ebuf_len, &eout_len, 1, contextEngineID)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad engine ID value '%s'", contextEngineID); + php_error_docref(NULL, E_WARNING, "Bad engine ID value '%s'", contextEngineID); efree(ebuf); return (-1); } @@ -1362,38 +1362,38 @@ static int netsnmp_session_set_contextEngineID(struct snmp_session *s, char * co /* {{{ php_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID) Set all snmpv3-related security options */ -static int netsnmp_session_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID TSRMLS_DC) +static int netsnmp_session_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID) { /* Setting the security level. */ if (netsnmp_session_set_sec_level(session, sec_level)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security level '%s'", sec_level); + php_error_docref(NULL, E_WARNING, "Invalid security level '%s'", sec_level); return (-1); } if (session->securityLevel == SNMP_SEC_LEVEL_AUTHNOPRIV || session->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) { /* Setting the authentication protocol. */ - if (netsnmp_session_set_auth_protocol(session, auth_protocol TSRMLS_CC)) { + if (netsnmp_session_set_auth_protocol(session, auth_protocol)) { /* Warning message sent already, just bail out */ return (-1); } /* Setting the authentication passphrase. */ - if (netsnmp_session_gen_auth_key(session, auth_passphrase TSRMLS_CC)) { + if (netsnmp_session_gen_auth_key(session, auth_passphrase)) { /* Warning message sent already, just bail out */ return (-1); } if (session->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) { /* Setting the security protocol. */ - if (netsnmp_session_set_sec_protocol(session, priv_protocol TSRMLS_CC)) { + if (netsnmp_session_set_sec_protocol(session, priv_protocol)) { /* Warning message sent already, just bail out */ return (-1); } /* Setting the security protocol passphrase. */ - if (netsnmp_session_gen_sec_key(session, priv_passphrase TSRMLS_CC)) { + if (netsnmp_session_gen_sec_key(session, priv_passphrase)) { /* Warning message sent already, just bail out */ return (-1); } @@ -1407,7 +1407,7 @@ static int netsnmp_session_set_security(struct snmp_session *session, char *sec_ } /* Setting contextEngineIS if specified */ - if (contextEngineID && strlen(contextEngineID) && netsnmp_session_set_contextEngineID(session, contextEngineID TSRMLS_CC)) { + if (contextEngineID && strlen(contextEngineID) && netsnmp_session_set_contextEngineID(session, contextEngineID)) { /* Warning message sent already, just bail out */ return (-1); } @@ -1446,7 +1446,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) if (session_less_mode) { if (version == SNMP_VERSION_3) { if (st & SNMP_CMD_SET) { - if (zend_parse_parameters(argc TSRMLS_CC, "ssssssszzz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len, + if (zend_parse_parameters(argc, "ssssssszzz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len, &a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len, &oid, &type, &value, &timeout, &retries) == FAILURE) { RETURN_FALSE; } @@ -1455,14 +1455,14 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) * SNMP_CMD_GETNEXT * SNMP_CMD_WALK */ - if (zend_parse_parameters(argc TSRMLS_CC, "sssssssz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len, + if (zend_parse_parameters(argc, "sssssssz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len, &a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len, &oid, &timeout, &retries) == FAILURE) { RETURN_FALSE; } } } else { if (st & SNMP_CMD_SET) { - if (zend_parse_parameters(argc TSRMLS_CC, "sszzz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &type, &value, &timeout, &retries) == FAILURE) { + if (zend_parse_parameters(argc, "sszzz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &type, &value, &timeout, &retries) == FAILURE) { RETURN_FALSE; } } else { @@ -1470,25 +1470,25 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) * SNMP_CMD_GETNEXT * SNMP_CMD_WALK */ - if (zend_parse_parameters(argc TSRMLS_CC, "ssz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &timeout, &retries) == FAILURE) { + if (zend_parse_parameters(argc, "ssz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &timeout, &retries) == FAILURE) { RETURN_FALSE; } } } } else { if (st & SNMP_CMD_SET) { - if (zend_parse_parameters(argc TSRMLS_CC, "zzz", &oid, &type, &value) == FAILURE) { + if (zend_parse_parameters(argc, "zzz", &oid, &type, &value) == FAILURE) { RETURN_FALSE; } } else if (st & SNMP_CMD_WALK) { - if (zend_parse_parameters(argc TSRMLS_CC, "z|bll", &oid, &suffix_keys, &(objid_query.max_repetitions), &(objid_query.non_repeaters)) == FAILURE) { + if (zend_parse_parameters(argc, "z|bll", &oid, &suffix_keys, &(objid_query.max_repetitions), &(objid_query.non_repeaters)) == FAILURE) { RETURN_FALSE; } if (suffix_keys) { st |= SNMP_USE_SUFFIX_AS_KEYS; } } else if (st & SNMP_CMD_GET) { - if (zend_parse_parameters(argc TSRMLS_CC, "z|b", &oid, &use_orignames) == FAILURE) { + if (zend_parse_parameters(argc, "z|b", &oid, &use_orignames) == FAILURE) { RETURN_FALSE; } if (use_orignames) { @@ -1497,23 +1497,23 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) } else { /* SNMP_CMD_GETNEXT */ - if (zend_parse_parameters(argc TSRMLS_CC, "z", &oid) == FAILURE) { + if (zend_parse_parameters(argc, "z", &oid) == FAILURE) { RETURN_FALSE; } } } - if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid, type, value TSRMLS_CC)) { + if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid, type, value)) { RETURN_FALSE; } if (session_less_mode) { - if (netsnmp_session_init(&session, version, a1, a2, timeout, retries TSRMLS_CC)) { + if (netsnmp_session_init(&session, version, a1, a2, timeout, retries)) { efree(objid_query.vars); netsnmp_session_free(&session); RETURN_FALSE; } - if (version == SNMP_VERSION_3 && netsnmp_session_set_security(session, a3, a4, a5, a6, a7, NULL, NULL TSRMLS_CC)) { + if (version == SNMP_VERSION_3 && netsnmp_session_set_security(session, a3, a4, a5, a6, a7, NULL, NULL)) { efree(objid_query.vars); netsnmp_session_free(&session); /* Warning message sent already, just bail out */ @@ -1524,7 +1524,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) snmp_object = Z_SNMP_P(object); session = snmp_object->session; if (!session) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or uninitialized SNMP object"); + php_error_docref(NULL, E_WARNING, "Invalid or uninitialized SNMP object"); efree(objid_query.vars); RETURN_FALSE; } @@ -1621,7 +1621,7 @@ PHP_FUNCTION(snmp_set_quick_print) { zend_long a1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &a1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) { RETURN_FALSE; } @@ -1636,7 +1636,7 @@ PHP_FUNCTION(snmp_set_enum_print) { zend_long a1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &a1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) { RETURN_FALSE; } @@ -1651,7 +1651,7 @@ PHP_FUNCTION(snmp_set_oid_output_format) { zend_long a1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &a1) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) { RETURN_FALSE; } @@ -1666,7 +1666,7 @@ PHP_FUNCTION(snmp_set_oid_output_format) RETURN_TRUE; break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP output print format '%d'", (int) a1); + php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '%d'", (int) a1); RETURN_FALSE; break; } @@ -1759,7 +1759,7 @@ PHP_FUNCTION(snmp_set_valueretrieval) { zend_long method; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &method) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &method) == FAILURE) { RETURN_FALSE; } @@ -1767,7 +1767,7 @@ PHP_FUNCTION(snmp_set_valueretrieval) SNMP_G(valueretrieval) = method; RETURN_TRUE; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP value retrieval method '%pd'", method); + php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", method); RETURN_FALSE; } } @@ -1792,13 +1792,13 @@ PHP_FUNCTION(snmp_read_mib) char *filename; size_t filename_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { RETURN_FALSE; } if (!read_mib(filename)) { char *error = strerror(errno); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading MIB file '%s': %s", filename, error); + php_error_docref(NULL, E_WARNING, "Error while reading MIB file '%s': %s", filename, error); RETURN_FALSE; } RETURN_TRUE; @@ -1820,14 +1820,14 @@ PHP_METHOD(snmp, __construct) zend_error_handling error_handling; snmp_object = Z_SNMP_P(object); - zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, &error_handling); - if (zend_parse_parameters(argc TSRMLS_CC, "lss|ll", &version, &a1, &a1_len, &a2, &a2_len, &timeout, &retries) == FAILURE) { - zend_restore_error_handling(&error_handling TSRMLS_CC); + if (zend_parse_parameters(argc, "lss|ll", &version, &a1, &a1_len, &a2, &a2_len, &timeout, &retries) == FAILURE) { + zend_restore_error_handling(&error_handling); return; } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); switch(version) { case SNMP_VERSION_1: @@ -1835,7 +1835,7 @@ PHP_METHOD(snmp, __construct) case SNMP_VERSION_3: break; default: - zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unknown SNMP protocol version", 0 TSRMLS_CC); + zend_throw_exception(zend_exception_get_default(), "Unknown SNMP protocol version", 0); return; } @@ -1844,7 +1844,7 @@ PHP_METHOD(snmp, __construct) netsnmp_session_free(&(snmp_object->session)); } - if (netsnmp_session_init(&(snmp_object->session), version, a1, a2, timeout, retries TSRMLS_CC)) { + if (netsnmp_session_init(&(snmp_object->session), version, a1, a2, timeout, retries)) { return; } snmp_object->max_oids = 0; @@ -1920,12 +1920,12 @@ PHP_METHOD(snmp, setSecurity) snmp_object = Z_SNMP_P(object); - if (zend_parse_parameters(argc TSRMLS_CC, "s|ssssss", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len, + if (zend_parse_parameters(argc, "s|ssssss", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len, &a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len) == FAILURE) { RETURN_FALSE; } - if (netsnmp_session_set_security(snmp_object->session, a1, a2, a3, a4, a5, a6, a7 TSRMLS_CC)) { + if (netsnmp_session_set_security(snmp_object->session, a1, a2, a3, a4, a5, a6, a7)) { /* Warning message sent already, just bail out */ RETURN_FALSE; } @@ -1961,7 +1961,7 @@ PHP_METHOD(snmp, getError) /* }}} */ /* {{{ */ -void php_snmp_add_property(HashTable *h, const char *name, size_t name_length, php_snmp_read_t read_func, php_snmp_write_t write_func TSRMLS_DC) +void php_snmp_add_property(HashTable *h, const char *name, size_t name_length, php_snmp_read_t read_func, php_snmp_write_t write_func) { php_snmp_prop_handler p; @@ -1975,7 +1975,7 @@ void php_snmp_add_property(HashTable *h, const char *name, size_t name_length, p /* {{{ php_snmp_read_property(zval *object, zval *member, int type[, const zend_literal *key]) Generic object property reader */ -zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) +zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) { zval tmp_member; zval *retval; @@ -1994,7 +1994,7 @@ zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_ hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member)); if (hnd && hnd->read_func) { - ret = hnd->read_func(obj, rv TSRMLS_CC); + ret = hnd->read_func(obj, rv); if (ret == SUCCESS) { retval = rv; } else { @@ -2002,7 +2002,7 @@ zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_ } } else { zend_object_handlers * std_hnd = zend_get_std_object_handlers(); - retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC); + retval = std_hnd->read_property(object, member, type, cache_slot, rv); } if (member == &tmp_member) { @@ -2015,7 +2015,7 @@ zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_ /* {{{ php_snmp_write_property(zval *object, zval *member, zval *value[, const zend_literal *key]) Generic object property writer */ -void php_snmp_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) +void php_snmp_write_property(zval *object, zval *member, zval *value, void **cache_slot) { zval tmp_member; php_snmp_object *obj; @@ -2032,7 +2032,7 @@ void php_snmp_write_property(zval *object, zval *member, zval *value, void **cac hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member)); if (hnd && hnd->write_func) { - hnd->write_func(obj, value TSRMLS_CC); + hnd->write_func(obj, value); /* if (!PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) == 0) { Z_ADDREF_P(value); @@ -2041,7 +2041,7 @@ void php_snmp_write_property(zval *object, zval *member, zval *value, void **cac */ } else { zend_object_handlers * std_hnd = zend_get_std_object_handlers(); - std_hnd->write_property(object, member, value, cache_slot TSRMLS_CC); + std_hnd->write_property(object, member, value, cache_slot); } if (member == &tmp_member) { @@ -2052,7 +2052,7 @@ void php_snmp_write_property(zval *object, zval *member, zval *value, void **cac /* {{{ php_snmp_has_property(zval *object, zval *member, int has_set_exists[, const zend_literal *key]) Generic object property checker */ -static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC) +static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) { zval rv; php_snmp_prop_handler *hnd; @@ -2064,7 +2064,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, ret = 1; break; case 0: { - zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv TSRMLS_CC); + zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv); if (value != &EG(uninitialized_zval)) { ret = Z_TYPE_P(value) != IS_NULL? 1 : 0; zval_ptr_dtor(value); @@ -2072,7 +2072,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, break; } default: { - zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv TSRMLS_CC); + zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv); if (value != &EG(uninitialized_zval)) { convert_to_boolean(value); ret = Z_TYPE_P(value) == IS_TRUE? 1:0; @@ -2082,7 +2082,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, } } else { zend_object_handlers *std_hnd = zend_get_std_object_handlers(); - ret = std_hnd->has_property(object, member, has_set_exists, cache_slot TSRMLS_CC); + ret = std_hnd->has_property(object, member, has_set_exists, cache_slot); } return ret; } @@ -2090,7 +2090,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, /* {{{ php_snmp_get_properties(zval *object) Returns all object properties. Injects SNMP properties into object on first call */ -static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC) +static HashTable *php_snmp_get_properties(zval *object) { php_snmp_object *obj; php_snmp_prop_handler *hnd; @@ -2100,10 +2100,10 @@ static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC) zend_ulong num_key; obj = Z_SNMP_P(object); - props = zend_std_get_properties(object TSRMLS_CC); + props = zend_std_get_properties(object); ZEND_HASH_FOREACH_KEY_PTR(&php_snmp_properties, num_key, key, hnd) { - if (!hnd->read_func || hnd->read_func(obj, &rv TSRMLS_CC) != SUCCESS) { + if (!hnd->read_func || hnd->read_func(obj, &rv) != SUCCESS) { ZVAL_NULL(&rv); } zend_hash_update(props, key, &rv); @@ -2114,7 +2114,7 @@ static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC) /* }}} */ /* {{{ */ -static int php_snmp_read_info(php_snmp_object *snmp_object, zval *retval TSRMLS_DC) +static int php_snmp_read_info(php_snmp_object *snmp_object, zval *retval) { zval val; @@ -2141,7 +2141,7 @@ static int php_snmp_read_info(php_snmp_object *snmp_object, zval *retval TSRMLS_ /* }}} */ /* {{{ */ -static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval TSRMLS_DC) +static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval) { if (snmp_object->max_oids > 0) { ZVAL_LONG(retval, snmp_object->max_oids); @@ -2153,7 +2153,7 @@ static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval TSR /* }}} */ #define PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(name) \ - static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval TSRMLS_DC) \ + static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval) \ { \ ZVAL_BOOL(retval, snmp_object->name); \ return SUCCESS; \ @@ -2164,7 +2164,7 @@ PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(quick_print) PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(enum_print) #define PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(name) \ - static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval TSRMLS_DC) \ + static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval) \ { \ ZVAL_LONG(retval, snmp_object->name); \ return SUCCESS; \ @@ -2175,15 +2175,15 @@ PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(oid_output_format) PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(exceptions_enabled) /* {{{ */ -static int php_snmp_write_info(php_snmp_object *snmp_object, zval *newval TSRMLS_DC) +static int php_snmp_write_info(php_snmp_object *snmp_object, zval *newval) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "info property is read-only"); + php_error_docref(NULL, E_WARNING, "info property is read-only"); return FAILURE; } /* }}} */ /* {{{ */ -static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval TSRMLS_DC) +static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval) { zval ztmp; int ret = SUCCESS; @@ -2203,7 +2203,7 @@ static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval TS if (Z_LVAL_P(newval) > 0) { snmp_object->max_oids = Z_LVAL_P(newval); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "max_oids should be positive integer or NULL, got %pd", Z_LVAL_P(newval)); + php_error_docref(NULL, E_WARNING, "max_oids should be positive integer or NULL, got %pd", Z_LVAL_P(newval)); } if (newval == &ztmp) { @@ -2215,7 +2215,7 @@ static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval TS /* }}} */ /* {{{ */ -static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *newval TSRMLS_DC) +static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *newval) { zval ztmp; int ret = SUCCESS; @@ -2230,7 +2230,7 @@ static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *new if (Z_LVAL_P(newval) >= 0 && Z_LVAL_P(newval) <= (SNMP_VALUE_LIBRARY|SNMP_VALUE_PLAIN|SNMP_VALUE_OBJECT)) { snmp_object->valueretrieval = Z_LVAL_P(newval); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP value retrieval method '%pd'", Z_LVAL_P(newval)); + php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", Z_LVAL_P(newval)); ret = FAILURE; } @@ -2243,7 +2243,7 @@ static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *new /* }}} */ #define PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(name) \ -static int php_snmp_write_##name(php_snmp_object *snmp_object, zval *newval TSRMLS_DC) \ +static int php_snmp_write_##name(php_snmp_object *snmp_object, zval *newval) \ { \ zval ztmp; \ ZVAL_COPY(&ztmp, newval); \ @@ -2260,7 +2260,7 @@ PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(enum_print) 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) +static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *newval) { zval ztmp; int ret = SUCCESS; @@ -2280,7 +2280,7 @@ static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval * snmp_object->oid_output_format = Z_LVAL_P(newval); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP output print format '%pd'", Z_LVAL_P(newval)); + php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '%pd'", Z_LVAL_P(newval)); ret = FAILURE; break; } @@ -2293,7 +2293,7 @@ static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval * /* }}} */ /* {{{ */ -static int php_snmp_write_exceptions_enabled(php_snmp_object *snmp_object, zval *newval TSRMLS_DC) +static int php_snmp_write_exceptions_enabled(php_snmp_object *snmp_object, zval *newval) { zval ztmp; int ret = SUCCESS; @@ -2385,7 +2385,7 @@ PHP_MINIT_FUNCTION(snmp) php_snmp_object_handlers.offset = XtOffsetOf(php_snmp_object, zo); php_snmp_object_handlers.clone_obj = NULL; php_snmp_object_handlers.free_obj = php_snmp_object_free_storage; - php_snmp_ce = zend_register_internal_class(&ce TSRMLS_CC); + php_snmp_ce = zend_register_internal_class(&ce); /* Register SNMP Class properties */ zend_hash_init(&php_snmp_properties, 0, NULL, free_php_snmp_properties, 1); @@ -2432,9 +2432,9 @@ PHP_MINIT_FUNCTION(snmp) /* Register SNMPException class */ INIT_CLASS_ENTRY(cex, "SNMPException", NULL); #ifdef HAVE_SPL - php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException TSRMLS_CC); + php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException); #else - php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_exception_get_default(TSRMLS_C) TSRMLS_CC); + php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_exception_get_default()); #endif return SUCCESS; |