25#define PHP_SNMP_VERSION PHP_VERSION
34#define snmp_module_ptr &snmp_module_entry
40#include <net-snmp/net-snmp-config.h>
41#include <net-snmp/net-snmp-includes.h>
47typedef struct _php_snmp_object {
48 struct snmp_session *session;
53 int oid_output_format;
55 int oid_increasing_check;
56 int exceptions_enabled;
57 char snmp_errstr[256];
61static inline php_snmp_object *php_snmp_fetch_object(
zend_object *obj) {
62 return (php_snmp_object *)((
char*)(obj) -
XtOffsetOf(php_snmp_object, zo));
65#define Z_SNMP_P(zv) php_snmp_fetch_object(Z_OBJ_P((zv)))
67typedef int (*php_snmp_read_t)(php_snmp_object *snmp_object,
zval *
retval);
68typedef int (*php_snmp_write_t)(php_snmp_object *snmp_object,
zval *newval);
70typedef struct _ptp_snmp_prop_handler {
73 php_snmp_read_t read_func;
74 php_snmp_write_t write_func;
75} php_snmp_prop_handler;
77typedef struct _snmpobjarg {
81 oid
name[MAX_OID_LEN];
90#define SNMP_G(v) TSRMG(snmp_globals_id, zend_snmp_globals *, v)
92#define SNMP_G(v) (snmp_globals.v)
95#define SNMP_VALUE_LIBRARY (0 << 0)
96#define SNMP_VALUE_PLAIN (1 << 0)
97#define SNMP_VALUE_OBJECT (1 << 1)
99#define PHP_SNMP_ERRNO_NOERROR 0
100#define PHP_SNMP_ERRNO_GENERIC (1 << 1)
101#define PHP_SNMP_ERRNO_TIMEOUT (1 << 2)
102#define PHP_SNMP_ERRNO_ERROR_IN_REPLY (1 << 3)
103#define PHP_SNMP_ERRNO_OID_NOT_INCREASING (1 << 4)
104#define PHP_SNMP_ERRNO_OID_PARSING_ERROR (1 << 5)
105#define PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES (1 << 6)
106#define PHP_SNMP_ERRNO_ANY ( \
107 PHP_SNMP_ERRNO_GENERIC | \
108 PHP_SNMP_ERRNO_TIMEOUT | \
109 PHP_SNMP_ERRNO_ERROR_IN_REPLY | \
110 PHP_SNMP_ERRNO_OID_NOT_INCREASING | \
111 PHP_SNMP_ERRNO_OID_PARSING_ERROR | \
112 PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES | \
113 PHP_SNMP_ERRNO_NOERROR \
118#define snmp_module_ptr NULL
122#define phpext_snmp_ptr snmp_module_ptr
#define PHP_MSHUTDOWN_FUNCTION
#define PHP_MINIT_FUNCTION
#define PHP_MINFO_FUNCTION
#define ZEND_END_MODULE_GLOBALS(module_name)
#define ZEND_BEGIN_MODULE_GLOBALS(module_name)
struct _zend_module_entry zend_module_entry
#define XtOffsetOf(s_type, field)
struct _zend_object zend_object