summaryrefslogtreecommitdiff
path: root/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.c')
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.c591
1 files changed, 0 insertions, 591 deletions
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.c
deleted file mode 100644
index f1f6eee0d4..0000000000
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * Note: this file originally auto-generated by mib2c using
- * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
- */
-
-#include <net-snmp/net-snmp-config.h>
-#include <net-snmp/net-snmp-includes.h>
-#include <net-snmp/agent/net-snmp-agent-includes.h>
-#include "modEoCSoftwareUpgradeGroup.h"
-
-/** Initializes the modEoCSoftwareUpgradeGroup module */
-void
-init_modEoCSoftwareUpgradeGroup(void)
-{
- static oid modEoCSoftwaretUpgradeServerIP_oid[] =
- { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 4, 1 };
- static oid modEoCSoftwareUpgradeServerPort_oid[] =
- { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 4, 2 };
- static oid modEoCSoftwareUpgradeLogin_oid[] =
- { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 4, 3 };
- static oid modEoCSoftwareUpgradePassWord_oid[] =
- { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 4, 4 };
-
- DEBUGMSGTL(("modEoCSoftwareUpgradeGroup", "Initializing\n"));
-
- netsnmp_register_scalar(netsnmp_create_handler_registration
- ("modEoCSoftwaretUpgradeServerIP",
- handle_modEoCSoftwaretUpgradeServerIP,
- modEoCSoftwaretUpgradeServerIP_oid,
- OID_LENGTH
- (modEoCSoftwaretUpgradeServerIP_oid),
- HANDLER_CAN_RWRITE));
- netsnmp_register_scalar(netsnmp_create_handler_registration
- ("modEoCSoftwareUpgradeServerPort",
- handle_modEoCSoftwareUpgradeServerPort,
- modEoCSoftwareUpgradeServerPort_oid,
- OID_LENGTH
- (modEoCSoftwareUpgradeServerPort_oid),
- HANDLER_CAN_RWRITE));
- netsnmp_register_scalar(netsnmp_create_handler_registration
- ("modEoCSoftwareUpgradeLogin",
- handle_modEoCSoftwareUpgradeLogin,
- modEoCSoftwareUpgradeLogin_oid,
- OID_LENGTH(modEoCSoftwareUpgradeLogin_oid),
- HANDLER_CAN_RWRITE));
- netsnmp_register_scalar(netsnmp_create_handler_registration
- ("modEoCSoftwareUpgradePassWord",
- handle_modEoCSoftwareUpgradePassWord,
- modEoCSoftwareUpgradePassWord_oid,
- OID_LENGTH(modEoCSoftwareUpgradePassWord_oid),
- HANDLER_CAN_RWRITE));
-}
-
-int
-handle_modEoCSoftwaretUpgradeServerIP(netsnmp_mib_handler *handler,
- netsnmp_handler_registration
- *reginfo,
- netsnmp_agent_request_info *reqinfo,
- netsnmp_request_info *requests)
-{
- int ret;
- /* TEMP: const value for skeleton compilation */
- char ip_addr[4] = { 192, 168, 2, 122};
- char *ip_addr_save = NULL;
- u_char *value;
-
- /*
- * We are never called for a GETNEXT if it's registered as a
- * "instance", as it's "magically" handled for us.
- */
-
- /*
- * a instance handler also only hands us one request at a time, so
- * we don't need to loop over a list of requests; we'll only get one.
- */
-
- switch (reqinfo->mode) {
-
- case MODE_GET:
- snmp_set_var_typed_value(requests->requestvb, ASN_IPADDRESS,
- (u_char *) ip_addr /* a pointer to the scalar's data */
- , sizeof(ip_addr) /* the length of the data in bytes */ );
- break;
-
-
-
- /*
- * SET REQUEST
- *
- * multiple states in the transaction. See:
- * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
- */
- case MODE_SET_RESERVE1:
- /* TODO: some action needed before? */
- /*
- * or you could use netsnmp_check_vb_type_and_size instead
- */
- ret = netsnmp_check_vb_type(requests->requestvb, ASN_IPADDRESS);
- if (ret != SNMP_ERR_NOERROR) {
- netsnmp_set_request_error(reqinfo, requests, ret);
- }
- break;
-
- case MODE_SET_RESERVE2:
- /*
- * malloc "undo" storage buffer
- */
- memdup((u_char **) &ip_addr_save, (u_char *) ip_addr,
- sizeof(ip_addr));
-
- if ( NULL == ip_addr_save /* if malloc, or whatever, failed: */) {
- netsnmp_set_request_error(reqinfo, requests,
- SNMP_ERR_RESOURCEUNAVAILABLE);
- }
-
- else {
- netsnmp_request_add_list_data(requests,
- netsnmp_create_data_list
- ("upgradeserveripaddr", ip_addr_save,
- free));
- }
- break;
-
-
-
- case MODE_SET_FREE:
- /*
- * free resources allocated in RESERVE1 and/or
- * RESERVE2. Something failed somewhere, and the states
- * below won't be called.
- */
- free(ip_addr_save);
- break;
-
- case MODE_SET_ACTION:
- /*
- * perform the value change here
- */
- value = requests->requestvb->val.string;
- /* TODO: should call appropriate function for setting IP address to
- * value */
- ret = 0;
- if ( 0 != ret /* error? */ ) {
- netsnmp_set_request_error(reqinfo, requests, ret /* some error */);
- }
- break;
-
-
-
- case MODE_SET_COMMIT:
- /*
- * delete temporary storage
- */
- free(ip_addr_save);
- break;
-
- case MODE_SET_UNDO:
- /*
- * UNDO and return to previous value for the object
- */
- value =
- (u_char *) netsnmp_request_get_list_data(requests,
- "upgradeserveripaddr");
- /* TODO: should call appropriate function for setting IP address to
- * value - ret should be return value from that function */
- ret = 0;
-
- if ( 0 != ret /* error? */ ) {
- /*
- * try _really_really_ hard to never get to this point
- */
- netsnmp_set_request_error(reqinfo, requests,
- SNMP_ERR_UNDOFAILED);
- }
- break;
-
-
- default:
- /*
- * we should never get here, so this is a really bad error
- */
- snmp_log(LOG_ERR,
- "unknown mode (%d) in handle_modEoCSoftwaretUpgradeServerIP\n",
- reqinfo->mode);
- return SNMP_ERR_GENERR;
- }
-
- return SNMP_ERR_NOERROR;
-}
-
-int
-handle_modEoCSoftwareUpgradeServerPort(netsnmp_mib_handler *handler,
- netsnmp_handler_registration
- *reginfo,
- netsnmp_agent_request_info *reqinfo,
- netsnmp_request_info *requests)
-{
- int ret;
- /* TEMP: const value for skeleton compilation */
- int server_port = 21;
- int *server_port_save = NULL;
- u_long value;
-
-
- /*
- * We are never called for a GETNEXT if it's registered as a
- * "instance", as it's "magically" handled for us.
- */
-
- /*
- * a instance handler also only hands us one request at a time, so
- * we don't need to loop over a list of requests; we'll only get one.
- */
-
- switch (reqinfo->mode) {
-
- case MODE_GET:
- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
- (u_char *) &server_port /* a pointer to the scalar's data */
- , sizeof(server_port) /* the length of the data in bytes */ );
- break;
-
-
-
- /*
- * SET REQUEST
- *
- * multiple states in the transaction. See:
- * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
- */
- case MODE_SET_RESERVE1:
- /* TODO: some action needed before? */
- /*
- * or you could use netsnmp_check_vb_type_and_size instead
- */
- ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
- if (ret != SNMP_ERR_NOERROR) {
- netsnmp_set_request_error(reqinfo, requests, ret);
- }
- break;
-
- case MODE_SET_RESERVE2:
- /*
- * malloc "undo" storage buffer
- */
- memdup((u_char **) &server_port_save,
- (u_char *) &server_port, sizeof(server_port));
-
- if ( NULL == server_port_save /* if malloc, or whatever, failed: */ ) {
- netsnmp_set_request_error(reqinfo, requests,
- SNMP_ERR_RESOURCEUNAVAILABLE);
- } else {
- netsnmp_request_add_list_data(requests,
- netsnmp_create_data_list
- ("upgradeservport", server_port_save,
- free));
- }
- break;
-
-
- case MODE_SET_FREE:
- /*
- * free resources allocated in RESERVE1 and/or
- * RESERVE2. Something failed somewhere, and the states
- * below won't be called.
- */
- free(server_port_save);
- break;
-
-
- case MODE_SET_ACTION:
- /*
- * perform the value change here
- */
- value = *(requests->requestvb->val.integer);
- /* TODO: should call appropriate function for setting port to value
- ret should be return value from that function */
- ret = 0;
- if ( 0 != ret /* error? */ ) {
- netsnmp_set_request_error(reqinfo, requests, ret /* some error */);
- }
- break;
-
-
- case MODE_SET_COMMIT:
- /* delete temporary storage */
- free(server_port_save);
- break;
-
-
-
- case MODE_SET_UNDO:
- /* UNDO and return to previous value for the object */
- value =
- *((u_long *) netsnmp_request_get_list_data(requests,
- "upgradeservport"));
- /* TODO: should call appropriate function for setting port to
- * value - ret should be return value from that function */
- ret = 0;
- if ( 0 != ret /* error? */ ) {
- /*
- * try _really_really_ hard to never get to this point
- */
- netsnmp_set_request_error(reqinfo, requests,
- SNMP_ERR_UNDOFAILED);
- }
- break;
-
-
-
- default:
- /*
- * we should never get here, so this is a really bad error
- */
- snmp_log(LOG_ERR,
- "unknown mode (%d) in handle_modEoCSoftwareUpgradeServerPort\n",
- reqinfo->mode);
- return SNMP_ERR_GENERR;
- }
-
- return SNMP_ERR_NOERROR;
-}
-
-int
-handle_modEoCSoftwareUpgradeLogin(netsnmp_mib_handler *handler,
- netsnmp_handler_registration *reginfo,
- netsnmp_agent_request_info *reqinfo,
- netsnmp_request_info *requests)
-{
- int ret;
- /* TEMP: const value for skeleton compilation */
- char login[] = "login";
- char *login_save = NULL;
- u_char *value = NULL;
-
-
- /*
- * We are never called for a GETNEXT if it's registered as a
- * "instance", as it's "magically" handled for us.
- */
-
- /*
- * a instance handler also only hands us one request at a time, so
- * we don't need to loop over a list of requests; we'll only get one.
- */
-
- switch (reqinfo->mode) {
-
- case MODE_GET:
- snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
- (u_char *) login /* a pointer to the scalar's data */
- , sizeof(login) /* the length of the data in bytes */ );
- break;
-
- /*
- * SET REQUEST
- *
- * multiple states in the transaction. See:
- * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
- */
- case MODE_SET_RESERVE1:
- /* TODO: some action needed before? */
- /*
- * or you could use netsnmp_check_vb_type_and_size instead
- */
- ret = netsnmp_check_vb_type(requests->requestvb, ASN_OCTET_STR);
- if (ret != SNMP_ERR_NOERROR) {
- netsnmp_set_request_error(reqinfo, requests, ret);
- }
- break;
-
- case MODE_SET_RESERVE2:
- /*
- * malloc "undo" storage buffer
- */
- memdup((u_char **) &login_save,
- (u_char *) login, sizeof(login));
- if ( NULL == login_save /* if malloc, or whatever, failed: */ ) {
- netsnmp_set_request_error(reqinfo, requests,
- SNMP_ERR_RESOURCEUNAVAILABLE);
- } else {
- netsnmp_request_add_list_data(requests,
- netsnmp_create_data_list
- ("upgradelogin", login_save,
- free));
- }
- break;
-
-
-
- case MODE_SET_FREE:
- /*
- * free resources allocated in RESERVE1 and/or
- * RESERVE2. Something failed somewhere, and the states
- * below won't be called.
- */
- free(login_save);
- break;
-
-
- case MODE_SET_ACTION:
- /*
- * perform the value change here
- */
- value = requests->requestvb->val.string;
- /* TODO: should call appropriate function for setting login to value
- ret should be return value from that function */
- ret = 0;
- if ( 0 != ret /* error? */ ) {
- netsnmp_set_request_error(reqinfo, requests, ret /* some error */);
- }
- break;
-
-
- case MODE_SET_COMMIT:
- /* delete temporary storage */
- free(login_save);
- break;
-
-
- case MODE_SET_UNDO:
- /*
- * UNDO and return to previous value for the object
- */
- value =
- (u_char *) netsnmp_request_get_list_data(requests,
- "upgradelogin");
- /* TODO: should call appropriate function for setting login to
- * value - ret should be return value from that function */
- ret = 0;
- if ( 0 != ret /* error? */ ) {
- /*
- * try _really_really_ hard to never get to this point
- */
- netsnmp_set_request_error(reqinfo, requests,
- SNMP_ERR_UNDOFAILED);
- }
- break;
-
-
- default:
- /*
- * we should never get here, so this is a really bad error
- */
- snmp_log(LOG_ERR,
- "unknown mode (%d) in handle_modEoCSoftwareUpgradeLogin\n",
- reqinfo->mode);
- return SNMP_ERR_GENERR;
- }
-
- return SNMP_ERR_NOERROR;
-}
-
-int
-handle_modEoCSoftwareUpgradePassWord(netsnmp_mib_handler *handler,
- netsnmp_handler_registration *reginfo,
- netsnmp_agent_request_info *reqinfo,
- netsnmp_request_info *requests)
-{
- int ret;
- /* TEMP: const value for skeleton compilation */
- char password[] = "password";
- char *password_save = NULL;
- u_char *value = NULL;
-
-
- /*
- * We are never called for a GETNEXT if it's registered as a
- * "instance", as it's "magically" handled for us.
- */
-
- /*
- * a instance handler also only hands us one request at a time, so
- * we don't need to loop over a list of requests; we'll only get one.
- */
-
- switch (reqinfo->mode) {
-
- case MODE_GET:
- snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
- (u_char *) password /* a pointer to the scalar's data */
- , sizeof(password) /* the length of the data in bytes */ );
- break;
-
-
- /*
- * SET REQUEST
- *
- * multiple states in the transaction. See:
- * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
- */
- case MODE_SET_RESERVE1:
- /* TODO: some action needed before? */
- /*
- * or you could use netsnmp_check_vb_type_and_size instead
- */
- ret = netsnmp_check_vb_type(requests->requestvb, ASN_OCTET_STR);
- if (ret != SNMP_ERR_NOERROR) {
- netsnmp_set_request_error(reqinfo, requests, ret);
- }
- break;
-
- case MODE_SET_RESERVE2:
- /*
- * malloc "undo" storage buffer
- */
- memdup((u_char **) &password_save,
- (u_char *) password, sizeof(password));
- if ( NULL == password_save /* if malloc, or whatever, failed: */ ){
- netsnmp_set_request_error(reqinfo, requests,
- SNMP_ERR_RESOURCEUNAVAILABLE);
- } else {
- netsnmp_request_add_list_data(requests,
- netsnmp_create_data_list
- ("upgradepasswd", password_save,
- free));
- }
- break;
-
-
-
- case MODE_SET_FREE:
- /*
- * free resources allocated in RESERVE1 and/or
- * RESERVE2. Something failed somewhere, and the states
- * below won't be called.
- */
- free(password_save);
- break;
-
-
-
- case MODE_SET_ACTION:
- /*
- * perform the value change here
- */
- value = requests->requestvb->val.string;
- /* TODO: should call appropriate function for setting password to value
- ret should be return value from that function */
- ret = 0;
- if ( 0 != ret /* error? */ ) {
- netsnmp_set_request_error(reqinfo, requests, ret /* some error */);
- }
- break;
-
-
-
- case MODE_SET_COMMIT:
- /*
- * delete temporary storage
- */
- free(password_save);
- break;
-
-
-
- case MODE_SET_UNDO:
- /*
- * UNDO and return to previous value for the object
- */
- value =
- (u_char *) netsnmp_request_get_list_data(requests,
- "upgradepasswd");
- /* TODO: should call appropriate function for setting password to
- * value - ret should be return value from that function */
- ret = 0;
-
- if ( 0 != ret /* error? */ ) {
- /*
- * try _really_really_ hard to never get to this point
- */
- netsnmp_set_request_error(reqinfo, requests,
- SNMP_ERR_UNDOFAILED);
- }
- break;
-
-
-
-
- default:
- /*
- * we should never get here, so this is a really bad error
- */
- snmp_log(LOG_ERR,
- "unknown mode (%d) in handle_modEoCSoftwareUpgradePassWord\n",
- reqinfo->mode);
- return SNMP_ERR_GENERR;
- }
-
- return SNMP_ERR_NOERROR;
-}