summaryrefslogtreecommitdiff
path: root/ext/snmp
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-09-28 15:33:27 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2019-09-28 15:47:00 +0200
commit03e92d4d48c6ef313d209a746a380282d8c34cdc (patch)
tree0dd761a05b4bcec0c714738e7f331c2ef7bf4d73 /ext/snmp
parentbf13d25f1ccfd0440fb001821d5b090a15e759f0 (diff)
downloadphp-git-03e92d4d48c6ef313d209a746a380282d8c34cdc.tar.gz
Add ext/snmp arginfo stubs
Diffstat (limited to 'ext/snmp')
-rw-r--r--ext/snmp/snmp.c248
-rw-r--r--ext/snmp/snmp.stub.php162
-rw-r--r--ext/snmp/snmp_arginfo.h146
-rw-r--r--ext/snmp/tests/reflection.phpt35
4 files changed, 338 insertions, 253 deletions
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 8790f214a9..95c6e210c7 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -30,6 +30,7 @@
#include "zend_exceptions.h"
#include "ext/spl/spl_exceptions.h"
+#include "snmp_arginfo.h"
#if HAVE_SNMP
@@ -123,229 +124,6 @@ zend_class_entry *php_snmp_exception_ce;
/* Class object properties */
static HashTable php_snmp_properties;
-/* {{{ arginfo */
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmpget, 0, 0, 3)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmpgetnext, 0, 0, 3)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmpwalk, 0, 0, 3)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmprealwalk, 0, 0, 3)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmpset, 0, 0, 5)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, value)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_get_quick_print, 0, 0, 1)
- ZEND_ARG_INFO(0, d)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set_quick_print, 0, 0, 1)
- ZEND_ARG_INFO(0, quick_print)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set_enum_print, 0, 0, 1)
- ZEND_ARG_INFO(0, enum_print)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set_oid_output_format, 0, 0, 1)
- ZEND_ARG_INFO(0, oid_format)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp2_get, 0, 0, 3)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp2_getnext, 0, 0, 3)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp2_walk, 0, 0, 3)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp2_real_walk, 0, 0, 3)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp2_set, 0, 0, 5)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, value)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_get, 0, 0, 8)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, sec_name)
- ZEND_ARG_INFO(0, sec_level)
- ZEND_ARG_INFO(0, auth_protocol)
- ZEND_ARG_INFO(0, auth_passphrase)
- ZEND_ARG_INFO(0, priv_protocol)
- ZEND_ARG_INFO(0, priv_passphrase)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_getnext, 0, 0, 8)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, sec_name)
- ZEND_ARG_INFO(0, sec_level)
- ZEND_ARG_INFO(0, auth_protocol)
- ZEND_ARG_INFO(0, auth_passphrase)
- ZEND_ARG_INFO(0, priv_protocol)
- ZEND_ARG_INFO(0, priv_passphrase)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_walk, 0, 0, 8)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, sec_name)
- ZEND_ARG_INFO(0, sec_level)
- ZEND_ARG_INFO(0, auth_protocol)
- ZEND_ARG_INFO(0, auth_passphrase)
- ZEND_ARG_INFO(0, priv_protocol)
- ZEND_ARG_INFO(0, priv_passphrase)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_real_walk, 0, 0, 8)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, sec_name)
- ZEND_ARG_INFO(0, sec_level)
- ZEND_ARG_INFO(0, auth_protocol)
- ZEND_ARG_INFO(0, auth_passphrase)
- ZEND_ARG_INFO(0, priv_protocol)
- ZEND_ARG_INFO(0, priv_passphrase)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_set, 0, 0, 10)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, sec_name)
- ZEND_ARG_INFO(0, sec_level)
- ZEND_ARG_INFO(0, auth_protocol)
- ZEND_ARG_INFO(0, auth_passphrase)
- ZEND_ARG_INFO(0, priv_protocol)
- ZEND_ARG_INFO(0, priv_passphrase)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, value)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set_valueretrieval, 0, 0, 1)
- ZEND_ARG_INFO(0, method)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_snmp_get_valueretrieval, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_read_mib, 0, 0, 1)
- ZEND_ARG_INFO(0, filename)
-ZEND_END_ARG_INFO()
-
-/* OO arginfo */
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_create, 0, 0, 3)
- ZEND_ARG_INFO(0, version)
- ZEND_ARG_INFO(0, host)
- ZEND_ARG_INFO(0, community)
- ZEND_ARG_INFO(0, timeout)
- ZEND_ARG_INFO(0, retries)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_snmp_void, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_setSecurity, 0, 0, 8)
- ZEND_ARG_INFO(0, sec_level)
- ZEND_ARG_INFO(0, auth_protocol)
- ZEND_ARG_INFO(0, auth_passphrase)
- ZEND_ARG_INFO(0, priv_protocol)
- ZEND_ARG_INFO(0, priv_passphrase)
- ZEND_ARG_INFO(0, contextName)
- ZEND_ARG_INFO(0, contextEngineID)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_get, 0, 0, 1)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, use_orignames)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_walk, 0, 0, 4)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, suffix_keys)
- ZEND_ARG_INFO(0, max_repetitions)
- ZEND_ARG_INFO(0, non_repeaters)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp_set, 0, 0, 3)
- ZEND_ARG_INFO(0, object_id)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, value)
-ZEND_END_ARG_INFO()
-/* }}} */
-
struct objid_query {
int count;
int offset;
@@ -365,13 +143,13 @@ static const zend_function_entry snmp_functions[] = {
PHP_FE(snmpgetnext, arginfo_snmpgetnext)
PHP_FE(snmpwalk, arginfo_snmpwalk)
PHP_FE(snmprealwalk, arginfo_snmprealwalk)
- PHP_FALIAS(snmpwalkoid, snmprealwalk, arginfo_snmprealwalk)
+ PHP_FALIAS(snmpwalkoid, snmprealwalk, arginfo_snmpwalkoid)
PHP_FE(snmpset, arginfo_snmpset)
PHP_FE(snmp_get_quick_print, arginfo_snmp_get_quick_print)
PHP_FE(snmp_set_quick_print, arginfo_snmp_set_quick_print)
PHP_FE(snmp_set_enum_print, arginfo_snmp_set_enum_print)
PHP_FE(snmp_set_oid_output_format, arginfo_snmp_set_oid_output_format)
- PHP_FALIAS(snmp_set_oid_numeric_print, snmp_set_oid_output_format, arginfo_snmp_set_oid_output_format)
+ PHP_FALIAS(snmp_set_oid_numeric_print, snmp_set_oid_output_format, arginfo_snmp_set_oid_numeric_print)
PHP_FE(snmp2_get, arginfo_snmp2_get)
PHP_FE(snmp2_getnext, arginfo_snmp2_getnext)
@@ -2203,16 +1981,16 @@ static void free_php_snmp_properties(zval *el) /* {{{ */
/* {{{ php_snmp_class_methods[] */
static const zend_function_entry php_snmp_class_methods[] = {
- PHP_ME(snmp, __construct, arginfo_snmp_create, ZEND_ACC_PUBLIC)
- PHP_ME(snmp, close, arginfo_snmp_void, ZEND_ACC_PUBLIC)
- PHP_ME(snmp, setSecurity, arginfo_snmp_setSecurity, ZEND_ACC_PUBLIC)
-
- PHP_ME(snmp, get, arginfo_snmp_get, ZEND_ACC_PUBLIC)
- PHP_ME(snmp, getnext, arginfo_snmp_get, ZEND_ACC_PUBLIC)
- PHP_ME(snmp, walk, arginfo_snmp_walk, ZEND_ACC_PUBLIC)
- PHP_ME(snmp, set, arginfo_snmp_set, ZEND_ACC_PUBLIC)
- PHP_ME(snmp, getErrno, arginfo_snmp_void, ZEND_ACC_PUBLIC)
- PHP_ME(snmp, getError, arginfo_snmp_void, ZEND_ACC_PUBLIC)
+ PHP_ME(snmp, __construct, arginfo_class_SNMP___construct, ZEND_ACC_PUBLIC)
+ PHP_ME(snmp, close, arginfo_class_SNMP_close, ZEND_ACC_PUBLIC)
+ PHP_ME(snmp, setSecurity, arginfo_class_SNMP_setSecurity, ZEND_ACC_PUBLIC)
+
+ PHP_ME(snmp, get, arginfo_class_SNMP_get, ZEND_ACC_PUBLIC)
+ PHP_ME(snmp, getnext, arginfo_class_SNMP_getnext, ZEND_ACC_PUBLIC)
+ PHP_ME(snmp, walk, arginfo_class_SNMP_walk, ZEND_ACC_PUBLIC)
+ PHP_ME(snmp, set, arginfo_class_SNMP_set, ZEND_ACC_PUBLIC)
+ PHP_ME(snmp, getErrno, arginfo_class_SNMP_getErrno, ZEND_ACC_PUBLIC)
+ PHP_ME(snmp, getError, arginfo_class_SNMP_getError, ZEND_ACC_PUBLIC)
PHP_FE_END
};
diff --git a/ext/snmp/snmp.stub.php b/ext/snmp/snmp.stub.php
new file mode 100644
index 0000000000..903ec81570
--- /dev/null
+++ b/ext/snmp/snmp.stub.php
@@ -0,0 +1,162 @@
+<?php
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmpget(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmpgetnext(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmpwalk(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmprealwalk(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmpwalkoid(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @param array|string $type
+ * @param array|string $value
+ * @return array|bool
+ */
+function snmpset(string $host, string $community, $object_id, $type, $value, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+function snmp_get_quick_print(): bool {}
+
+function snmp_set_quick_print(int $quick_print): bool {}
+
+function snmp_set_enum_print(int $enum_print): bool {}
+
+function snmp_set_oid_output_format(int $oid_format): bool {}
+
+function snmp_set_oid_numeric_print(int $oid_format): bool {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmp2_get(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmp2_getnext(string $host, string $community, $object_id, int $timeout = UNKOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmp2_walk(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmp2_real_walk(string $host, string $community, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @param array|string $type
+ * @param array|string $value
+ * @return array|bool
+ */
+function snmp2_set(string $host, string $community, $object_id, $type, $value, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmp3_get(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmp3_getnext(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, $object_id, int $timeout = UNKNOWN, int $retries = UNKOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmp3_walk(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+function snmp3_real_walk(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, $object_id, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+/**
+ * @param array|string $object_id
+ * @param array|string $type
+ * @param array|string $value
+ * @return array|bool
+ */
+function snmp3_set(string $host, string $sec_name, string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, $object_id, $type, $value, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+function snmp_set_valueretrieval(int $method): bool {}
+
+function snmp_get_valueretrieval(): int {}
+
+function snmp_read_mib(string $filename): bool {}
+
+class SNMP
+{
+ function __construct(int $version, string $host, string $community, int $timeout = UNKNOWN, int $retries = UNKNOWN) {}
+
+ /** @return bool */
+ function close() {}
+
+ /** @return bool */
+ function setSecurity(string $sec_level, string $auth_protocol = '', string $auth_passphrase = '', string $priv_protocol = '', string $priv_passphrase = '', string $contextName = '', string $contextEngineID = '') {}
+
+ /**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+ function get($object_id, bool $use_orignames = false) {}
+
+ /**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+ function getnext($object_id) {}
+
+ /**
+ * @param array|string $object_id
+ * @return array|bool
+ */
+ function walk($object_id, bool $suffix_keys = false, int $max_repetitions = UNKNOWN, int $non_repeaters = UNKNOWN) {}
+
+ /**
+ * @param array|string $object_id
+ * @param array|string $type
+ * @param array|string $value
+ * @return array|bool
+ */
+ function set($object_id, $type, $value) {}
+
+ /** @return int */
+ function getErrno() {}
+
+ /** @return string */
+ function getError() {}
+}
diff --git a/ext/snmp/snmp_arginfo.h b/ext/snmp/snmp_arginfo.h
new file mode 100644
index 0000000000..f4cbdbc182
--- /dev/null
+++ b/ext/snmp/snmp_arginfo.h
@@ -0,0 +1,146 @@
+/* This is a generated file, edit the .stub.php file instead. */
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_snmpget, 0, 0, 3)
+ ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0)
+ ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, retries, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_snmpgetnext arginfo_snmpget
+
+#define arginfo_snmpwalk arginfo_snmpget
+
+#define arginfo_snmprealwalk arginfo_snmpget
+
+#define arginfo_snmpwalkoid arginfo_snmpget
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_snmpset, 0, 0, 5)
+ ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0)
+ ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_INFO(0, type)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, retries, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_get_quick_print, 0, 0, _IS_BOOL, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_quick_print, 0, 1, _IS_BOOL, 0)
+ ZEND_ARG_TYPE_INFO(0, quick_print, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_enum_print, 0, 1, _IS_BOOL, 0)
+ ZEND_ARG_TYPE_INFO(0, enum_print, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_oid_output_format, 0, 1, _IS_BOOL, 0)
+ ZEND_ARG_TYPE_INFO(0, oid_format, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_snmp_set_oid_numeric_print arginfo_snmp_set_oid_output_format
+
+#define arginfo_snmp2_get arginfo_snmpget
+
+#define arginfo_snmp2_getnext arginfo_snmpget
+
+#define arginfo_snmp2_walk arginfo_snmpget
+
+#define arginfo_snmp2_real_walk arginfo_snmpget
+
+#define arginfo_snmp2_set arginfo_snmpset
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_get, 0, 0, 8)
+ ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, sec_name, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, auth_protocol, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, priv_protocol, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, priv_passphrase, IS_STRING, 0)
+ ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, retries, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_snmp3_getnext arginfo_snmp3_get
+
+#define arginfo_snmp3_walk arginfo_snmp3_get
+
+#define arginfo_snmp3_real_walk arginfo_snmp3_get
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_snmp3_set, 0, 0, 10)
+ ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, sec_name, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, auth_protocol, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, priv_protocol, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, priv_passphrase, IS_STRING, 0)
+ ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_INFO(0, type)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, retries, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_valueretrieval, 0, 1, _IS_BOOL, 0)
+ ZEND_ARG_TYPE_INFO(0, method, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_get_valueretrieval, 0, 0, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_read_mib, 0, 1, _IS_BOOL, 0)
+ ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP___construct, 0, 0, 3)
+ ZEND_ARG_TYPE_INFO(0, version, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, community, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, retries, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_close, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_setSecurity, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, auth_protocol, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, auth_passphrase, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, priv_protocol, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, priv_passphrase, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, contextName, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO(0, contextEngineID, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_get, 0, 0, 1)
+ ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_TYPE_INFO(0, use_orignames, _IS_BOOL, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_getnext, 0, 0, 1)
+ ZEND_ARG_INFO(0, object_id)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_walk, 0, 0, 1)
+ ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_TYPE_INFO(0, suffix_keys, _IS_BOOL, 0)
+ ZEND_ARG_TYPE_INFO(0, max_repetitions, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, non_repeaters, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_set, 0, 0, 3)
+ ZEND_ARG_INFO(0, object_id)
+ ZEND_ARG_INFO(0, type)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+#define arginfo_class_SNMP_getErrno arginfo_class_SNMP_close
+
+#define arginfo_class_SNMP_getError arginfo_class_SNMP_close
diff --git a/ext/snmp/tests/reflection.phpt b/ext/snmp/tests/reflection.phpt
index 7943dcf5be..d2823d8377 100644
--- a/ext/snmp/tests/reflection.phpt
+++ b/ext/snmp/tests/reflection.phpt
@@ -25,11 +25,11 @@ echo new reflectionmethod('snmp', 'getError');
Method [ <internal:snmp, ctor> public method __construct ] {
- Parameters [5] {
- Parameter #0 [ <required> $version ]
- Parameter #1 [ <required> $host ]
- Parameter #2 [ <required> $community ]
- Parameter #3 [ <optional> $timeout ]
- Parameter #4 [ <optional> $retries ]
+ Parameter #0 [ <required> int $version ]
+ Parameter #1 [ <required> string $host ]
+ Parameter #2 [ <required> string $community ]
+ Parameter #3 [ <optional> int $timeout ]
+ Parameter #4 [ <optional> int $retries ]
}
}
Method [ <internal:snmp> public method close ] {
@@ -40,36 +40,35 @@ Method [ <internal:snmp> public method close ] {
Method [ <internal:snmp> public method setSecurity ] {
- Parameters [7] {
- Parameter #0 [ <required> $sec_level ]
- Parameter #1 [ <required> $auth_protocol ]
- Parameter #2 [ <required> $auth_passphrase ]
- Parameter #3 [ <required> $priv_protocol ]
- Parameter #4 [ <required> $priv_passphrase ]
- Parameter #5 [ <required> $contextName ]
- Parameter #6 [ <required> $contextEngineID ]
+ Parameter #0 [ <required> string $sec_level ]
+ Parameter #1 [ <optional> string $auth_protocol ]
+ Parameter #2 [ <optional> string $auth_passphrase ]
+ Parameter #3 [ <optional> string $priv_protocol ]
+ Parameter #4 [ <optional> string $priv_passphrase ]
+ Parameter #5 [ <optional> string $contextName ]
+ Parameter #6 [ <optional> string $contextEngineID ]
}
}
Method [ <internal:snmp> public method get ] {
- Parameters [2] {
Parameter #0 [ <required> $object_id ]
- Parameter #1 [ <optional> $use_orignames ]
+ Parameter #1 [ <optional> bool $use_orignames ]
}
}
Method [ <internal:snmp> public method getnext ] {
- - Parameters [2] {
+ - Parameters [1] {
Parameter #0 [ <required> $object_id ]
- Parameter #1 [ <optional> $use_orignames ]
}
}
Method [ <internal:snmp> public method walk ] {
- Parameters [4] {
Parameter #0 [ <required> $object_id ]
- Parameter #1 [ <required> $suffix_keys ]
- Parameter #2 [ <required> $max_repetitions ]
- Parameter #3 [ <required> $non_repeaters ]
+ Parameter #1 [ <optional> bool $suffix_keys ]
+ Parameter #2 [ <optional> int $max_repetitions ]
+ Parameter #3 [ <optional> int $non_repeaters ]
}
}
Method [ <internal:snmp> public method set ] {