xref: /php-src/ext/snmp/snmp.stub.php (revision 67ab2b7d)
1<?php
2
3/** @generate-class-entries */
4
5/**
6 * @var int
7 * @cvalue NETSNMP_OID_OUTPUT_SUFFIX
8 */
9const SNMP_OID_OUTPUT_SUFFIX = UNKNOWN;
10/**
11 * @var int
12 * @cvalue NETSNMP_OID_OUTPUT_MODULE
13 */
14const SNMP_OID_OUTPUT_MODULE = UNKNOWN;
15/**
16 * @var int
17 * @cvalue NETSNMP_OID_OUTPUT_FULL
18 */
19const SNMP_OID_OUTPUT_FULL = UNKNOWN;
20/**
21 * @var int
22 * @cvalue NETSNMP_OID_OUTPUT_NUMERIC
23 */
24const SNMP_OID_OUTPUT_NUMERIC = UNKNOWN;
25/**
26 * @var int
27 * @cvalue NETSNMP_OID_OUTPUT_UCD
28 */
29const SNMP_OID_OUTPUT_UCD = UNKNOWN;
30/**
31 * @var int
32 * @cvalue NETSNMP_OID_OUTPUT_NONE
33 */
34const SNMP_OID_OUTPUT_NONE = UNKNOWN;
35
36/**
37 * @var int
38 * @cvalue SNMP_VALUE_LIBRARY
39 */
40const SNMP_VALUE_LIBRARY = UNKNOWN;
41/**
42 * @var int
43 * @cvalue SNMP_VALUE_PLAIN
44 */
45const SNMP_VALUE_PLAIN = UNKNOWN;
46/**
47 * @var int
48 * @cvalue SNMP_VALUE_OBJECT
49 */
50const SNMP_VALUE_OBJECT = UNKNOWN;
51
52/**
53 * @var int
54 * @cvalue ASN_BIT_STR
55 */
56const SNMP_BIT_STR = UNKNOWN;
57/**
58 * @var int
59 * @cvalue ASN_OCTET_STR
60 */
61const SNMP_OCTET_STR = UNKNOWN;
62/**
63 * @var int
64 * @cvalue ASN_OPAQUE
65 */
66const SNMP_OPAQUE = UNKNOWN;
67/**
68 * @var int
69 * @cvalue ASN_NULL
70 */
71const SNMP_NULL = UNKNOWN;
72/**
73 * @var int
74 * @cvalue ASN_OBJECT_ID
75 */
76const SNMP_OBJECT_ID = UNKNOWN;
77/**
78 * @var int
79 * @cvalue ASN_IPADDRESS
80 */
81const SNMP_IPADDRESS = UNKNOWN;
82/**
83 * @var int
84 * @cvalue ASN_GAUGE
85 */
86const SNMP_COUNTER = UNKNOWN;
87/**
88 * @var int
89 * @cvalue ASN_UNSIGNED
90 */
91const SNMP_UNSIGNED = UNKNOWN;
92/**
93 * @var int
94 * @cvalue ASN_TIMETICKS
95 */
96const SNMP_TIMETICKS = UNKNOWN;
97/**
98 * @var int
99 * @cvalue ASN_UINTEGER
100 */
101const SNMP_UINTEGER = UNKNOWN;
102/**
103 * @var int
104 * @cvalue ASN_INTEGER
105 */
106const SNMP_INTEGER = UNKNOWN;
107/**
108 * @var int
109 * @cvalue ASN_COUNTER64
110 */
111const SNMP_COUNTER64 = UNKNOWN;
112
113function snmpget(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
114
115function snmpgetnext(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
116
117function snmpwalk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
118
119function snmprealwalk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
120
121/** @alias snmprealwalk */
122function snmpwalkoid(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
123
124function snmpset(string $hostname, string $community, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): bool {}
125
126function snmp_get_quick_print(): bool {}
127
128function snmp_set_quick_print(bool $enable): true {}
129
130function snmp_set_enum_print(bool $enable): true {}
131
132function snmp_set_oid_output_format(int $format): true {}
133
134/** @alias snmp_set_oid_output_format */
135function snmp_set_oid_numeric_print(int $format): true {}
136
137function snmp2_get(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
138
139function snmp2_getnext(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
140
141function snmp2_walk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
142
143function snmp2_real_walk(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
144
145function snmp2_set(string $hostname, string $community, array|string $object_id, array|string $type, array|string $value, int $timeout = -1, int $retries = -1): bool {}
146
147function snmp3_get(
148    string $hostname, string $security_name, string $security_level,
149    string $auth_protocol, string $auth_passphrase,
150    string $privacy_protocol, string $privacy_passphrase,
151    array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
152
153function snmp3_getnext(
154    string $hostname, string $security_name, string $security_level,
155    string $auth_protocol, string $auth_passphrase,
156    string $privacy_protocol, string $privacy_passphrase,
157    array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
158
159function snmp3_walk(
160    string $hostname, string $security_name, string $security_level,
161    string $auth_protocol, string $auth_passphrase,
162    string $privacy_protocol, string $privacy_passphrase,
163    array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
164
165function snmp3_real_walk(
166    string $hostname, string $security_name, string $security_level,
167    string $auth_protocol, string $auth_passphrase,
168    string $privacy_protocol, string $privacy_passphrase,
169    array|string $object_id, int $timeout = -1, int $retries = -1): array|false {}
170
171function snmp3_set(
172    string $hostname, string $security_name, string $security_level,
173    string $auth_protocol, string $auth_passphrase,
174    string $privacy_protocol, string $privacy_passphrase,
175    array|string $object_id, array|string $type, array|string $value,
176    int $timeout = -1, int $retries = -1): bool {}
177
178function snmp_set_valueretrieval(int $method): true {}
179
180function snmp_get_valueretrieval(): int {}
181
182function snmp_read_mib(string $filename): bool {}
183
184class SNMP
185{
186    /**
187     * @cvalue SNMP_VERSION_1
188     * @link snmp.class.constants.version-1
189     */
190    public const int VERSION_1 = UNKNOWN;
191    /**
192     * @cvalue SNMP_VERSION_2c
193     * @link snmp.class.constants.version-2c
194     */
195    public const int VERSION_2c = UNKNOWN;
196    /**
197     * @cvalue SNMP_VERSION_2c
198     * @link snmp.class.constants.version-2c
199     */
200    public const int VERSION_2C = UNKNOWN;
201    /**
202     * @cvalue SNMP_VERSION_3
203     * @link snmp.class.constants.version-3
204     */
205    public const int VERSION_3 = UNKNOWN;
206
207    /**
208     * @cvalue PHP_SNMP_ERRNO_NOERROR
209     * @link snmp.class.constants.errno-noerror
210     */
211    public const int ERRNO_NOERROR = UNKNOWN;
212    /**
213     * @cvalue PHP_SNMP_ERRNO_ANY
214     * @link snmp.class.constants.errno-any
215     */
216    public const int ERRNO_ANY = UNKNOWN;
217    /**
218     * @cvalue PHP_SNMP_ERRNO_GENERIC
219     * @link snmp.class.constants.errno-generic
220     */
221    public const int ERRNO_GENERIC = UNKNOWN;
222    /**
223     * @cvalue PHP_SNMP_ERRNO_TIMEOUT
224     * @link snmp.class.constants.errno-timeout
225     */
226    public const int ERRNO_TIMEOUT = UNKNOWN;
227    /**
228     * @cvalue PHP_SNMP_ERRNO_ERROR_IN_REPLY
229     * @link snmp.class.constants.errno-error-in-reply
230     */
231    public const int ERRNO_ERROR_IN_REPLY = UNKNOWN;
232    /**
233     * @cvalue PHP_SNMP_ERRNO_OID_NOT_INCREASING
234     * @link snmp.class.constants.errno-oid-not-increasing
235     */
236    public const int ERRNO_OID_NOT_INCREASING = UNKNOWN;
237    /**
238     * @cvalue PHP_SNMP_ERRNO_OID_PARSING_ERROR
239     * @link snmp.class.constants.errno-oid-parsing-error
240     */
241    public const int ERRNO_OID_PARSING_ERROR = UNKNOWN;
242    /**
243     * @cvalue PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES
244     * @link snmp.class.constants.errno-multiple-set-queries
245     */
246    public const int ERRNO_MULTIPLE_SET_QUERIES = UNKNOWN;
247
248    /** @readonly */
249    public array $info;
250    public ?int $max_oids;
251    public int $valueretrieval;
252    public bool $quick_print;
253    public bool $enum_print;
254    public int $oid_output_format;
255    public bool $oid_increasing_check;
256    public int $exceptions_enabled;
257
258    public function __construct(int $version, string $hostname, string $community, int $timeout = -1, int $retries = -1) {}
259
260    /** @tentative-return-type */
261    public function close(): bool {}
262
263    /** @tentative-return-type */
264    public function setSecurity(
265        string $securityLevel, string $authProtocol = "", string $authPassphrase = "",
266        string $privacyProtocol = "", string $privacyPassphrase = "",
267        string $contextName = "", string $contextEngineId = ""): bool {}
268
269    /** @tentative-return-type */
270    public function get(array|string $objectId, bool $preserveKeys = false): mixed {}
271
272    /** @tentative-return-type */
273    public function getnext(array|string $objectId): mixed {}
274
275    /** @tentative-return-type */
276    public function walk(array|string $objectId, bool $suffixAsKey = false, int $maxRepetitions = -1, int $nonRepeaters = -1): array|false {}
277
278    /** @tentative-return-type */
279    public function set(array|string $objectId, array|string $type, array|string $value): bool {}
280
281    /** @tentative-return-type */
282    public function getErrno(): int {}
283
284    /** @tentative-return-type */
285    public function getError(): string {}
286}
287
288class SNMPException extends RuntimeException
289{
290}
291