diff options
Diffstat (limited to 'ext/snmp')
| -rw-r--r-- | ext/snmp/snmp.c | 28 | ||||
| -rw-r--r-- | ext/snmp/winsnmp.c | 26 |
2 files changed, 41 insertions, 13 deletions
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index f6a361f982..35155ef851 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -79,6 +79,8 @@ void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st); /* constant - can be shared among threads */ static oid objid_mib[] = {1, 3, 6, 1, 2, 1}; +/* {{{ snmp_functions[] + */ function_entry snmp_functions[] = { PHP_FE(snmpget, NULL) PHP_FE(snmpwalk, NULL) @@ -89,7 +91,10 @@ function_entry snmp_functions[] = { PHP_FE(snmpset, NULL) {NULL,NULL,NULL} }; +/* }}} */ +/* {{{ snmp_module_entry + */ zend_module_entry snmp_module_entry = { "snmp", snmp_functions, @@ -100,6 +105,7 @@ zend_module_entry snmp_module_entry = { PHP_MINFO(snmp), STANDARD_MODULE_PROPERTIES }; +/* }}} */ #ifdef COMPILE_DL_SNMP ZEND_GET_MODULE(snmp) @@ -107,12 +113,17 @@ ZEND_GET_MODULE(snmp) /* THREAD_LS snmp_module php_snmp_module; - may need one of these at some point */ +/* {{{ PHP_MINIT_FUNCTION + */ PHP_MINIT_FUNCTION(snmp) { init_mib(); return SUCCESS; } +/* }}} */ +/* {{{ PHP_MINFO_FUNCTION + */ PHP_MINFO_FUNCTION(snmp) { php_info_print_table_start(); @@ -120,9 +131,10 @@ PHP_MINFO_FUNCTION(snmp) php_info_print_table_row(2, "UCD-SNMP Version", VersionInfo); php_info_print_table_end(); } +/* }}} */ - -/* +/* {{{ php_snmp +* * Generic SNMP object fetcher * * st=1 snmpget() - query an agent and return a single value. @@ -342,6 +354,7 @@ retry: } /* keepwalking */ snmp_close(ss); } +/* }}} */ /* {{{ proto string snmpget(string host, string community, string object_id [, int timeout [, int retries]]) Fetch a SNMP object */ @@ -393,8 +406,9 @@ PHP_FUNCTION(snmpset) { #endif /* -* Local variables: -* tab-width: 4 -* c-basic-offset: 4 -* End: -*/ + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim: sw=4 ts=4 tw=78 fdm=marker + */ diff --git a/ext/snmp/winsnmp.c b/ext/snmp/winsnmp.c index 45bda9fa9b..6e01354acf 100644 --- a/ext/snmp/winsnmp.c +++ b/ext/snmp/winsnmp.c @@ -21,16 +21,21 @@ Created from the snmputil sample in the Microsoft SDK for NT #include <snmp.h> #include <mgmtapi.h> - +/* {{{ snmp_functions[] + */ function_entry snmp_functions[] = { {"snmpget", php3_snmpget, NULL}, {"snmpwalk", php3_snmpwalk, NULL}, {NULL,NULL,NULL} }; +/* }}} */ +/* {{{ snmp_module_entry + */ zend_module_entry snmp_module_entry = { "SNMP",snmp_functions,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL }; +/* }}} */ #if COMPILE_DL DLEXPORT zend_module_entry *get_module() { return &snmp_module_entry; } @@ -43,8 +48,9 @@ DLEXPORT zend_module_entry *get_module() { return &snmp_module_entry; } #define TIMEOUT 6000 /* milliseconds */ #define RETRIES 3 - -void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) { +/* {{{ _php_snmp + */ +void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) { pval *a1, *a2, *a3; INT operation; LPSTR agent; @@ -209,20 +215,28 @@ void _php3_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) { php_error(E_WARNING,"error on SnmpMgrClose %d\n", GetLastError()); } } +/* }}} */ +/* {{{ php3_snmpget + */ DLEXPORT void php3_snmpget(INTERNAL_FUNCTION_PARAMETERS) { - _php3_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); + _php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); } +/* }}} */ +/* {{{ php3_snmpwalk + */ DLEXPORT void php3_snmpwalk(INTERNAL_FUNCTION_PARAMETERS) { - _php3_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,2); + _php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,2); } - +/* }}} */ #endif + /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: + * vim: sw=4 ts=4 tw=78 fdm=marker */ |
