summaryrefslogtreecommitdiff
path: root/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup')
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.c610
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.c901
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.h23
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.c1053
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.h19
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.c392
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.h16
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunity.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityPermission.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityRowStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/table-eocCBATAdminSNMPCommunityTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-eocCBATAdminSNMPCommunityTable.txt692
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c273
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.h219
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.c764
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.h66
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.c318
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.h61
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.c1589
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.h65
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_enums.h77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.c1910
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.h89
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_oids.h54
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.c96
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.h18
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.c73
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.h14
39 files changed, 9845 insertions, 0 deletions
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup.h
new file mode 100644
index 0000000000..ecaafc90e9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.c
new file mode 100644
index 0000000000..8ebbbe8c35
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.c
@@ -0,0 +1,610 @@
+/*
+ * 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 "eocCBATDevInfoGroup.h"
+
+/** Initializes the eocCBATDevInfoGroup module */
+void
+init_eocCBATDevInfoGroup(void)
+{
+ static oid eocCBATAdminLogicalID_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,1 };
+ static oid eocCBATAdminTechProject_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,2 };
+ static oid eocCBATAdminManufactoryInfo_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,3 };
+ static oid eocCBATAdminModelNumber_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,4 };
+ static oid eocCBATAdminSerialNumber_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,5 };
+ static oid eocCBATAdminSoftwareVersion_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,6 };
+ static oid eocCBATAdminHardwareVersion_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,7 };
+ static oid eocCBATAdminVendorSpecialInfo_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,8 };
+
+ DEBUGMSGTL(("eocCBATDevInfoGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminLogicalID", handle_eocCBATAdminLogicalID,
+ eocCBATAdminLogicalID_oid, OID_LENGTH(eocCBATAdminLogicalID_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminTechProject", handle_eocCBATAdminTechProject,
+ eocCBATAdminTechProject_oid, OID_LENGTH(eocCBATAdminTechProject_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminManufactoryInfo", handle_eocCBATAdminManufactoryInfo,
+ eocCBATAdminManufactoryInfo_oid, OID_LENGTH(eocCBATAdminManufactoryInfo_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminModelNumber", handle_eocCBATAdminModelNumber,
+ eocCBATAdminModelNumber_oid, OID_LENGTH(eocCBATAdminModelNumber_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminSerialNumber", handle_eocCBATAdminSerialNumber,
+ eocCBATAdminSerialNumber_oid, OID_LENGTH(eocCBATAdminSerialNumber_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminSoftwareVersion", handle_eocCBATAdminSoftwareVersion,
+ eocCBATAdminSoftwareVersion_oid, OID_LENGTH(eocCBATAdminSoftwareVersion_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminHardwareVersion", handle_eocCBATAdminHardwareVersion,
+ eocCBATAdminHardwareVersion_oid, OID_LENGTH(eocCBATAdminHardwareVersion_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminVendorSpecialInfo", handle_eocCBATAdminVendorSpecialInfo,
+ eocCBATAdminVendorSpecialInfo_oid, OID_LENGTH(eocCBATAdminVendorSpecialInfo_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocCBATAdminLogicalID(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char logical_id[ADMIN_LOGICAL_ID_MAX_LEN];
+ char *logical_id_save = NULL;
+ u_char *value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ /* 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:
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_GET\n"));
+ /* read buffer for logical ID from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* Logical ID set to empty string to permit walk requests */
+ strcpy (logical_id, "");
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than
+ * maximum value, copy only maximum permitted number
+ * of bytes */
+ strncpy (logical_id, buffer, ADMIN_LOGICAL_ID_MAX_LEN-1);
+ logical_id[ADMIN_LOGICAL_ID_MAX_LEN-1]='\0';
+ }
+ /* set the buffer for GET request */
+ snmp_set_var_typed_value (requests->requestvb,
+ ASN_OCTET_STR,
+ (u_char *) logical_id,
+ strlen (logical_id));
+ 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:
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_RESERVE1\n"));
+ /*
+ * check type and maximal size of variable given in SET request
+ */
+ ret = netsnmp_check_vb_type_and_max_size (
+ requests->requestvb,
+ ASN_OCTET_STR, ADMIN_LOGICAL_ID_MAX_LEN-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_RESERVE2\n"));
+
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ strncpy (logical_id, buffer, ADMIN_LOGICAL_ID_MAX_LEN-1);
+ logical_id[ADMIN_LOGICAL_ID_MAX_LEN - 1] = '\0';
+
+ memdup ((u_char **) &logical_id_save,
+ (u_char *) logical_id,
+ sizeof (logical_id));
+
+ if ( NULL == logical_id_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 (
+ "logid", logical_id_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. */
+
+ /* called in case SET_RESERVE1 or SET_RESERVE2 fail */
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_FREE\n"));
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_ACTION\n"));
+ value = requests->requestvb->val.string;
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID",
+ "val_len of MODE_SET_ACTION value to set: %d\n",
+ requests->requestvb->val_len));
+
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy (logical_id, value, requests->requestvb->val_len);
+ logical_id[requests->requestvb->val_len]='\0';
+
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID",
+ "logical ID: |%s|\n", logical_id));
+
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID,
+ logical_id);
+
+ if ( LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_COMMIT\n"));
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ /* called only in case SET_ACTION failed */
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_UNDO\n"));
+
+ value = (u_char *)netsnmp_request_get_list_data (requests,
+ "logid");
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ )
+ {
+ 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_eocCBATAdminLogicalID\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminTechProject(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ libspid_error_t ret;
+ char tech_project[LIBSPID_CONFIG_KEY_MAX_LEN];
+ /* 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:
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminTechProject called",
+ "MODE_GET\n"));
+ /* read buffer for tech project from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_TECHPROJECT,
+ tech_project, LIBSPID_CONFIG_KEY_MAX_LEN);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* Tech Project set to empty string to permit walk requests */
+ strcpy (tech_project, "");
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) tech_project,
+ strlen (tech_project));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminTechProject\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminManufactoryInfo(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char manufactory_info[DEFAULT_SNMP_STRING_MAX_LENGTH];
+
+ /*
+ * 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:
+ /* read NVRAM contents */
+ ret = libspid_get_manufactory_info (manufactory_info, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Manufactory info is set to empty string to
+ * permit walk requests */
+ strcpy (manufactory_info, "");
+ }
+
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminManufactoryInfo",
+ "manufactory info: |%s|\n",
+ manufactory_info));
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) manufactory_info,
+ strlen (manufactory_info));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminManufactoryInfo\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCBATAdminModelNumber(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char model_number[DEFAULT_SNMP_STRING_MAX_LENGTH];
+
+ /*
+ * 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:
+ /* read NVRAM contents */
+ ret = libspid_get_product_name (model_number, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Model number is set to empty string to permit walk requests */
+ strcpy (model_number, "");
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) model_number,
+ strlen (model_number));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminModelNumber\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminSerialNumber(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char serial_number[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ /* 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:
+ /* read NVRAM contents */
+ ret = libspid_get_serial_number (serial_number, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Serial number set to empty string to permit walk requests */
+ strcpy (serial_number, "");
+ }
+
+ DEBUGMSGTL (("eocCBATDevInfoGroup: handle_eocCBATAdminSerialNumber",
+ "serial number: |%s|\n", serial_number));
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) serial_number,
+ strlen (serial_number));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminSerialNumber\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminSoftwareVersion(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char sw_version[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ char mtd_name[64];
+ spidcom_image_desc_t desc;
+ /* 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:
+ ret = libspid_image_get_desc (
+ LIBSPID_IMAGE_DESC_TYPE_CURRENT,
+ &desc, mtd_name);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_image_get_desc error\n");
+ /* SW version set to empty string to permit walk requests */
+ strcpy (sw_version, "");
+ }
+ else
+ {
+ memset (sw_version, 0, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (sizeof (desc.version) <= DEFAULT_SNMP_STRING_MAX_LENGTH)
+ {
+ strncpy (sw_version, desc.version, sizeof (desc.version));
+ }
+ else
+ {
+ /* if the buffer read from image description is larger
+ * than maximum value, copy only maximum permitted number
+ * of bytes */
+ strncpy (sw_version,
+ desc.version,
+ DEFAULT_SNMP_STRING_MAX_LENGTH - 1);
+ sw_version[DEFAULT_SNMP_STRING_MAX_LENGTH - 1] = '\0';
+ }
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) sw_version,
+ strlen (sw_version));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminSoftwareVersion\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminHardwareVersion(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char hw_version[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ /* 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:
+ /* read NVRAM contents */
+ ret = libspid_get_product_partnb (hw_version, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* HW version set to empty string to permit walk requests */
+ strcpy (hw_version, "");
+ }
+
+ DEBUGMSGTL (("eocCBATDevInfoGroup: handle_eocCBATAdminHardwareVersion",
+ "hw version: |%s|\n", hw_version));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) hw_version,
+ strlen (hw_version));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminHardwareVersion\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminVendorSpecialInfo(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char vendor_spec_info[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ /* 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:
+ /* read NVRAM contents */
+ ret = libspid_get_oem_info (vendor_spec_info, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Vendor spec. info set to empty string to permit
+ * walk requests */
+ strcpy (vendor_spec_info, "");
+ }
+
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminVendorSpecialInfo",
+ "vendor spec info: |%s|\n", vendor_spec_info));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) vendor_spec_info,
+ strlen (vendor_spec_info));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminVendorSpecialInfo\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.h
new file mode 100644
index 0000000000..dfae2a9856
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.h
@@ -0,0 +1,22 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATDEVINFOGROUP_H
+#define EOCCBATDEVINFOGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCBATDevInfoGroup(void);
+Netsnmp_Node_Handler handle_eocCBATAdminLogicalID;
+Netsnmp_Node_Handler handle_eocCBATAdminTechProject;
+Netsnmp_Node_Handler handle_eocCBATAdminManufactoryInfo;
+Netsnmp_Node_Handler handle_eocCBATAdminModelNumber;
+Netsnmp_Node_Handler handle_eocCBATAdminSerialNumber;
+Netsnmp_Node_Handler handle_eocCBATAdminSoftwareVersion;
+Netsnmp_Node_Handler handle_eocCBATAdminHardwareVersion;
+Netsnmp_Node_Handler handle_eocCBATAdminVendorSpecialInfo;
+
+#endif /* EOCCBATDEVINFOGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup.h
new file mode 100644
index 0000000000..9f6c0feebf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.c
new file mode 100644
index 0000000000..8a3f461100
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.c
@@ -0,0 +1,901 @@
+/*
+ * 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 "eocCBATDevStatusGroup.h"
+#include <time.h>
+static int admin_conf_save_result = 0;
+
+/** Initializes the eocCBATDevStatusGroup module */
+void
+init_eocCBATDevStatusGroup(void)
+{
+ static oid eocCBATAdminAlarmDetectionControl_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,1 };
+ static oid eocCBATAdminStatus_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,2 };
+ static oid eocCBATAdminInternalTemperature_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,3 };
+ static oid eocCBATAdminTamperStatus_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,4 };
+ static oid eocCBATAdminDateAndTime_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,5 };
+ static oid eocCBATAdminReset_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,6 };
+ static oid eocCBATAdminResetCause_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,7 };
+ static oid eocCBATAdminConfigurationSaving_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,8 };
+ static oid eocCBATAdminConfigurationResult_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,9 };
+
+ DEBUGMSGTL (("eocCBATDevStatusGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminAlarmDetectionControl", handle_eocCBATAdminAlarmDetectionControl,
+ eocCBATAdminAlarmDetectionControl_oid, OID_LENGTH(eocCBATAdminAlarmDetectionControl_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminStatus", handle_eocCBATAdminStatus,
+ eocCBATAdminStatus_oid, OID_LENGTH(eocCBATAdminStatus_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminInternalTemperature", handle_eocCBATAdminInternalTemperature,
+ eocCBATAdminInternalTemperature_oid, OID_LENGTH(eocCBATAdminInternalTemperature_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminTamperStatus", handle_eocCBATAdminTamperStatus,
+ eocCBATAdminTamperStatus_oid, OID_LENGTH(eocCBATAdminTamperStatus_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminDateAndTime", handle_eocCBATAdminDateAndTime,
+ eocCBATAdminDateAndTime_oid, OID_LENGTH(eocCBATAdminDateAndTime_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminReset", handle_eocCBATAdminReset,
+ eocCBATAdminReset_oid, OID_LENGTH(eocCBATAdminReset_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminResetCause", handle_eocCBATAdminResetCause,
+ eocCBATAdminResetCause_oid, OID_LENGTH(eocCBATAdminResetCause_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminConfigurationSaving", handle_eocCBATAdminConfigurationSaving,
+ eocCBATAdminConfigurationSaving_oid, OID_LENGTH(eocCBATAdminConfigurationSaving_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminConfigurationResult", handle_eocCBATAdminConfigurationResult,
+ eocCBATAdminConfigurationResult_oid, OID_LENGTH(eocCBATAdminConfigurationResult_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocCBATAdminAlarmDetectionControl(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ admin_alarm_detect_t alarm_detect;
+ int *alarm_detect_save = NULL;
+ u_long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ /* 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:
+ /* read buffer for detection control from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ buffer, LIBSPID_LINE_MAX_LEN);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* AlarmDetection set to disabled to permit walk requests */
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+ else
+ {
+ /* parse alarm detection settings from buffer */
+ if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_YES,
+ strlen (LIBSPID_SNMP_CONF_VALUE_YES)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_ENABLED;
+ }
+ else if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_REGENERATE,
+ strlen (LIBSPID_SNMP_CONF_VALUE_REGENERATE)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_REGENERATE;
+ }
+ else
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *)&alarm_detect,
+ sizeof (alarm_detect));
+ 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:
+ /* 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 );
+ }
+ ret = netsnmp_check_vb_range (
+ requests->requestvb,
+ ADMIN_ALARM_DETECT_DISABLED,
+ ADMIN_ALARM_DETECT_REGENERATE);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ /* read buffer for detection control from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ /* parse alarm detection settings from buffer */
+ if (!strncmp (buffer,
+ LIBSPID_SNMP_CONF_VALUE_YES,
+ strlen (LIBSPID_SNMP_CONF_VALUE_YES)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_ENABLED;
+ }
+ else if (!strncmp (buffer,
+ LIBSPID_SNMP_CONF_VALUE_REGENERATE,
+ strlen (LIBSPID_SNMP_CONF_VALUE_REGENERATE)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_REGENERATE;
+ }
+ else
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+
+ memdup ((u_char **) &alarm_detect_save,
+ (u_char *) &alarm_detect, sizeof (alarm_detect));
+
+ if ( NULL == alarm_detect_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("alarmdet", alarm_detect_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. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ value = *(requests->requestvb->val.integer);
+ switch (value)
+ {
+ case ADMIN_ALARM_DETECT_DISABLED:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret )
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_ENABLED:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_REGENERATE:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_REGENERATE);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ /* clear contents of current alarm and traps
+ * files and alarm log */
+ if (0 != clearCurrentAlarms ())
+ {
+ snmp_log (LOG_ERR,
+ "handle_eocCBATAdminAlarmDetectionControl: "
+ "error clearing current alarm file!\n");
+ }
+ if (0 != clearCurrentTraps ())
+ {
+ snmp_log (LOG_ERR,
+ "handle_eocCBATAdminAlarmDetectionControl: "
+ "error clearing current traps file!\n");
+ }
+
+ clearAlarmLogList ();
+ break;
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in "
+ "handle_eocCBATAdminAlarmDetectionControl\n",
+ value);
+ return SNMP_ERR_GENERR;
+ }
+
+ case MODE_SET_COMMIT:
+ break;
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value = *((u_long *) netsnmp_request_get_list_data (
+ requests,
+ "alarmdet"));
+
+ switch (value)
+ {
+ case ADMIN_ALARM_DETECT_DISABLED:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_NO);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_ENABLED:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_YES);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_REGENERATE:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_REGENERATE);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ 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 UNDO value (%d) in "
+ "handle_eocCBATAdminAlarmDetectionControl\n",
+ value);
+ return SNMP_ERR_GENERR;
+ }
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminAlarmDetectionControl\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminStatus(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char admin_status;
+ u_long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ /* 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:
+ /* read buffer for Admin Status from info file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_INFO_PATH,
+ LIBSPID_SNMP_INFO_LABEL_TRAP_STATUS,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* AdminStatus set to empty char to permit walk requests */
+ admin_status = ' ';
+ }
+ else
+ {
+ /* parse Admin Status from buffer */
+ if (1 != sscanf (buffer, "%x", &value))
+ {
+ admin_status = ' ';
+ }
+ else
+ {
+ admin_status = (char) value;
+ }
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) &admin_status,
+ sizeof (admin_status));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in handle_eocCBATAdminStatus\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminInternalTemperature(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int internal_temp;
+ /* 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:
+ ret = libspid_hardware_get_temperature (&internal_temp);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "libspid_hardware_get_temperature error\n");
+ /* default temperature value set to 0 to permit walk requests */
+ internal_temp = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &internal_temp,
+ sizeof (internal_temp));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminInternalTemperature\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminTamperStatus(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ admin_tamper_status_t admin_tamper_status;
+ libspid_eoc_tamper_status_t tamper_status = 0;
+
+ /* TEMP: const value for skeleton compilation */
+ /* 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:
+ ret = libspid_hardware_get_tamper (&tamper_status);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_hardware_get_tamper error\n");
+
+ admin_tamper_status = ADMIN_TAMPER_STATUS_INTACT;
+ }
+ else
+ {
+ if (LIBSPID_TAMPER_STATUS_INTACT == tamper_status)
+ {
+ admin_tamper_status = ADMIN_TAMPER_STATUS_INTACT;
+ }
+ else
+ {
+ admin_tamper_status = ADMIN_TAMPER_STATUS_COMPROMISED;
+ }
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &admin_tamper_status,
+ sizeof (admin_tamper_status));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminTamperStatus\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminDateAndTime(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ u_char *value;
+ size_t val_size;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ time_t t1;
+ static time_t oldtime=0;
+
+ struct tm tm_set;
+
+ memset (buffer, 0, sizeof (buffer));
+
+ /* 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:
+ /* obtain current time in seconds */
+ t1 = time (NULL);
+ /* convert time in seconds to binary string representation */
+ value = date_n_time(&t1, &val_size);
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ value, val_size);
+ 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:
+ /* allowed size for DateAndTime binary string is 11 or 8 */
+ if ( (netsnmp_check_vb_type_and_size (requests->requestvb, ASN_OCTET_STR, 11)
+ != SNMP_ERR_NOERROR)
+ && (netsnmp_check_vb_type_and_size (requests->requestvb, ASN_OCTET_STR, 8)
+ != SNMP_ERR_NOERROR))
+ {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_WRONGVALUE);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* store current time in seconds for potential UNDO */
+ oldtime = time (NULL);
+ if (oldtime == -1)
+ {
+ snmp_log (LOG_ERR, "error getting current time\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ strncpy (buffer, requests->requestvb->val.string, requests->requestvb->val_len);
+
+ tm_set.tm_year = buffer[0] * 256 + buffer[1] - 1900;
+ tm_set.tm_mon = buffer[2] - 1;
+ tm_set.tm_mday = buffer[3];
+ tm_set.tm_hour = buffer[4];
+ tm_set.tm_min = buffer[5];
+ tm_set.tm_sec = buffer[6];
+ tm_set.tm_isdst = 0;
+ t1 = mktime (&tm_set);
+ if (t1 == -1)
+ {
+ snmp_log (LOG_ERR, "mktime error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ else if (stime (&t1) == -1)
+ {
+ snmp_log (LOG_ERR, "stime error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* use stored time in seconds to undo system time */
+ if (oldtime == 0)
+ {
+ snmp_log(LOG_ERR, "cannot retrieve undo time\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ else
+ {
+ ret = stime (&oldtime);
+ oldtime = 0;
+ if (ret != 0)
+ {
+ snmp_log(LOG_ERR, "stime error\n");
+ 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_eocCBATAdminDateAndTime\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminReset(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int reset = 0;
+ /* 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 *) &reset,
+ sizeof (reset));
+ 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:
+ /* 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 );
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb, ADMIN_RESET,
+ ADMIN_RESET);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ libspid_system_reboot ();
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminReset\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminResetCause(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ unsigned int ret;
+ unsigned int admin_reset_cause = ADMIN_RESET_NONE;
+ char sys_reset_cause[SPC300_RESET_CAUSE_STR_MAX_LEN];
+ /* 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:
+
+ ret = libspid_config_read_item (
+ LIBSPID_WEB_RESET_INFO_PATH,
+ LIBSPID_WEB_RESET_INFO_LABEL_RESET_BY_WEB,
+ sys_reset_cause, LIBSPID_LINE_MAX_LEN);
+
+ if (LIBSPID_SUCCESS == ret &&
+ 0 != strstr (sys_reset_cause,
+ LIBSPID_WEB_RESET_INFO_RESET_BY_WEB_YES))
+ {
+ admin_reset_cause = ADMIN_RESET_WEB;
+ snmp_set_var_typed_value (requests->requestvb,
+ ASN_INTEGER,
+ (u_char *) &admin_reset_cause,
+ sizeof (admin_reset_cause));
+ break;
+ }
+
+ ret = libspid_system_get_reset_cause (sys_reset_cause,
+ sizeof (sys_reset_cause));
+ if (ret == LIBSPID_SUCCESS)
+ {
+ if (0 == strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_POWER_ON))
+ {
+ admin_reset_cause = ADMIN_RESET_POWER_UP;
+ }
+ else if ( 0 == strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_WATCHDOG))
+ {
+ admin_reset_cause = ADMIN_RESET_WATCHDOG;
+ }
+ else if (0 == strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_SOFTWARE))
+ {
+ admin_reset_cause = ADMIN_RESET_COMMAND;
+ }
+ else if (0 == strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_EXTERNAL) ||
+ 0 == strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_VOLTAGE_DETECTOR))
+ {
+ admin_reset_cause = ADMIN_RESET_CRAFT;
+ }
+ else
+ {
+ admin_reset_cause = ADMIN_RESET_OTHER;
+ }
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &admin_reset_cause,
+ sizeof (admin_reset_cause));
+ break;
+
+ default:
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminResetCause\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminConfigurationSaving(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int config_saving = 0;
+ /* 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 *) &config_saving,
+ sizeof (config_saving));
+ 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:
+ /* 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);
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ ADMIN_SAVE, ADMIN_SAVE);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* call function for saving system configuration files to flash */
+ admin_conf_save_result = ADMIN_CONF_RESULT_SAVING;
+ ret = libspid_system_save ();
+
+ /* set value of save result variable */
+ admin_conf_save_result = ret ?
+ ADMIN_CONF_RESULT_SAVE_FAILED :
+ ADMIN_CONF_RESULT_SAVE_SUC;
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminConfigurationSaving\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminConfigurationResult(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ admin_conf_cbat_result_t config_result;
+
+ /* 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:
+ /* get value from save result variable */
+ config_result = admin_conf_save_result;
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &config_result,
+ sizeof (config_result));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminConfigurationResult\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.h
new file mode 100644
index 0000000000..e021bd7868
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.h
@@ -0,0 +1,23 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATDEVSTATUSGROUP_H
+#define EOCCBATDEVSTATUSGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCBATDevStatusGroup(void);
+Netsnmp_Node_Handler handle_eocCBATAdminAlarmDetectionControl;
+Netsnmp_Node_Handler handle_eocCBATAdminStatus;
+Netsnmp_Node_Handler handle_eocCBATAdminInternalTemperature;
+Netsnmp_Node_Handler handle_eocCBATAdminTamperStatus;
+Netsnmp_Node_Handler handle_eocCBATAdminDateAndTime;
+Netsnmp_Node_Handler handle_eocCBATAdminReset;
+Netsnmp_Node_Handler handle_eocCBATAdminResetCause;
+Netsnmp_Node_Handler handle_eocCBATAdminConfigurationSaving;
+Netsnmp_Node_Handler handle_eocCBATAdminConfigurationResult;
+
+#endif /* EOCCBATDEVSTATUSGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup.h
new file mode 100644
index 0000000000..edd1b1fa76
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.c
new file mode 100644
index 0000000000..a8ea6dc673
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.c
@@ -0,0 +1,1053 @@
+/*
+ * 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 "eocCBATNetworkAttrGroup.h"
+
+/** Initializes the eocCBATNetworkAttrGroup module */
+void
+init_eocCBATNetworkAttrGroup(void)
+{
+ static oid eocCBATAdminMACAddress_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,1 };
+ static oid eocCBATAdminIPMode_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,2 };
+ static oid eocCBATAdminIPAddress_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,3 };
+ static oid eocCBATAdminIPMask_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,4 };
+ static oid eocCBATAdminIPGateway_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,5 };
+ static oid eocCBATAdminVLANID_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,6 };
+
+ DEBUGMSGTL(("eocCBATNetworkAttrGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminMACAddress", handle_eocCBATAdminMACAddress,
+ eocCBATAdminMACAddress_oid, OID_LENGTH(eocCBATAdminMACAddress_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminIPMode", handle_eocCBATAdminIPMode,
+ eocCBATAdminIPMode_oid, OID_LENGTH(eocCBATAdminIPMode_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminIPAddress", handle_eocCBATAdminIPAddress,
+ eocCBATAdminIPAddress_oid, OID_LENGTH(eocCBATAdminIPAddress_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminIPMask", handle_eocCBATAdminIPMask,
+ eocCBATAdminIPMask_oid, OID_LENGTH(eocCBATAdminIPMask_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminIPGateway", handle_eocCBATAdminIPGateway,
+ eocCBATAdminIPGateway_oid, OID_LENGTH(eocCBATAdminIPGateway_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminVLANID", handle_eocCBATAdminVLANID,
+ eocCBATAdminVLANID_oid, OID_LENGTH(eocCBATAdminVLANID_oid),
+ HANDLER_CAN_RWRITE
+ ));
+}
+
+int
+handle_eocCBATAdminMACAddress(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char admin_mac_addr[LIBSPID_MAC_BIN_LEN];
+ /* 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:
+ /* read NVRAM contents */
+ ret = libspid_get_plc_address (admin_mac_addr, LIBSPID_MAC_BIN_LEN);
+ if (ret)
+ {
+ memset (admin_mac_addr, 0, LIBSPID_MAC_BIN_LEN);
+ }
+
+ DEBUGMSGTL (("ocCBATNetworkAttrGroup: handle_eocCBATAdminMACAddress",
+ "MAC address copied to admin MAC addr: "
+ "%x %x %x %x %x %x \n",
+ admin_mac_addr[0], admin_mac_addr[1],
+ admin_mac_addr[2], admin_mac_addr[3],
+ admin_mac_addr[4], admin_mac_addr[5]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) admin_mac_addr,
+ sizeof (admin_mac_addr));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminMACAddress\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCBATAdminIPMode(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ admin_ip_mode_t ip_mode;
+ admin_ip_mode_t *ip_mode_save = NULL;
+ u_long value;
+ libspid_ip_t ip;
+ /* 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:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* default IP mode set as static to permit walk requests */
+ ip_mode = ADMIN_IP_MODE_STATIC;
+ }
+ else if (ip.mode == LIBSPID_IP_MODE_DHCP)
+ {
+ ip_mode = ADMIN_IP_MODE_DHCP;
+ snmp_log (LOG_ERR,
+ "handle_eocCBATAdminIPMode ADMIN_IP_MODE_DHCP\n");
+ }
+ else
+ {
+ /* static mode is presumed as default */
+ ip_mode = ADMIN_IP_MODE_STATIC;
+ snmp_log (LOG_ERR,
+ "handle_eocCBATAdminIPMode ADMIN_IP_MODE_STATIC\n");
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &ip_mode,
+ sizeof (ip_mode));
+ 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:
+ /* 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);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ ADMIN_IP_MODE_STATIC,
+ ADMIN_IP_MODE_DHCP);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else if (ip.mode == LIBSPID_IP_MODE_DHCP)
+ {
+ ip_mode = ADMIN_IP_MODE_DHCP;
+ }
+ else
+ {
+ /* static mode is presumed as default */
+ ip_mode = ADMIN_IP_MODE_STATIC;
+ }
+
+ memdup ((u_char **) &ip_mode_save,
+ (u_char *) &ip_mode, sizeof (ip));
+
+ if ( NULL == ip_mode_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "ipmode",
+ ip_mode_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. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ value = *(requests->requestvb->val.integer);
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* change IP mode to value given in SET request */
+ if (value == ADMIN_IP_MODE_DHCP)
+ {
+ ip.mode = LIBSPID_IP_MODE_DHCP;
+ snmp_log (LOG_ERR,
+ "libspid_network_set_ip LIBSPID_IP_MODE_DHCP\n");
+ }
+ else
+ {
+ ip.mode = LIBSPID_IP_MODE_STATIC;
+ snmp_log (LOG_ERR,
+ "libspid_network_set_ip LIBSPID_IP_MODE_STATIC\n");
+ }
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP mode */
+ value = *((u_long *) netsnmp_request_get_list_data (requests,
+ "ipmode"));
+ if (value == ADMIN_IP_MODE_DHCP)
+ {
+ ip.mode = LIBSPID_IP_MODE_DHCP;
+ }
+ else
+ {
+ ip.mode = LIBSPID_IP_MODE_STATIC;
+ }
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ 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_eocCBATAdminIPMode\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminIPAddress(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char ip_addr[LIBSPID_IP_BIN_LEN];
+ char *ip_addr_save = NULL;
+ u_char *value;
+ libspid_ip_t ip;
+
+ memset (&ip, 0, sizeof (ip));
+ /* 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:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* IP address string set to "0.0.0.0" to permit walk requests*/
+ strcpy (ip.address, "0.0.0.0");
+ }
+ else
+ {
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.address, ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_addr, 0, LIBSPID_IP_BIN_LEN);
+ }
+ }
+
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: "
+ "handle_eocCBATAdminIPAddress",
+ "GET IP address converted to bin: %d %d %d %d \n",
+ ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_addr,
+ sizeof (ip_addr));
+ 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:
+ /* 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 */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.address, ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_addr, 0, LIBSPID_IP_BIN_LEN);
+ }
+
+ memdup ((u_char **) &ip_addr_save,
+ (u_char *) ip_addr,
+ sizeof (ip_addr));
+
+ if ( NULL == ip_addr_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "adminipaddr",
+ 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. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ value = requests->requestvb->val.string;
+ /* convert IP address given in SET request from array of bytes
+ * to string and change it in IP structure */
+ ret = libspid_ip_bin_to_str (value, ip.address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: "
+ "handle_eocCBATAdminIPAddress",
+ "SET IP address converted to string: %s \n",
+ ip.address));
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error ( reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP address */
+
+ value = (u_char *) netsnmp_request_get_list_data (
+ requests,
+ "adminipaddr");
+
+ /* convert IP address from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ip.address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ 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_eocCBATAdminIPAddress\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCBATAdminIPMask(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char ip_mask[LIBSPID_IP_BIN_LEN];
+ char *ip_mask_save = NULL;
+ u_char *value;
+ libspid_ip_t ip;
+ memset (&ip, 0, sizeof (ip));
+ /* 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:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* IP mask string set to "0.0.0.0" to permit walk requests */
+ strcpy (ip.netmask, "0.0.0.0");
+ }
+ else
+ {
+ /* convert IP mask from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.netmask, ip_mask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_mask, 0, LIBSPID_IP_BIN_LEN);
+ }
+ }
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: handle_eocCBATAdminIPMask",
+ "GET IP mask converted to bin: %d %d %d %d \n",
+ ip_mask[0], ip_mask[1], ip_mask[2], ip_mask[3]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_mask,
+ sizeof (ip_mask));
+ 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:
+ /* 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 */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* convert IP mask from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.netmask, ip_mask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_mask, 0, LIBSPID_IP_BIN_LEN);
+ }
+
+ memdup ((u_char **) &ip_mask_save, (u_char *) ip_mask,
+ sizeof (ip_mask));
+
+ if ( NULL == ip_mask_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("ipmask", ip_mask_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. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ value = requests->requestvb->val.string;
+
+ /* convert IP mask given in SET request from array of bytes to
+ * string and change it in IP structure */
+ ret = libspid_ip_bin_to_str (value, ip.netmask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: handle_eocCBATAdminIPMask",
+ "SET IP mask converted to string: %s \n", ip.netmask));
+
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP mask */
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "ipmask");
+
+ /* convert IP mask from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ip.netmask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ 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_eocCBATAdminIPMask\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminIPGateway(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char ip_gateway[LIBSPID_IP_BIN_LEN];
+ char *ip_gateway_save = NULL;
+ u_char *value;
+ libspid_ip_t ip;
+
+
+ memset (&ip, 0, sizeof (ip));
+ /* 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:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* IP gateway string set to "0.0.0.0" to permit walk requests */
+ strcpy (ip.gateway, "0.0.0.0");
+ }
+ else
+ {
+ /* convert IP gateway from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.gateway, ip_gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_gateway, 0, sizeof (ip_gateway));
+ }
+ }
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: handle_eocCBATAdminIPGateway",
+ "GET IP gateway converted to bin: %d %d %d %d \n",
+ ip_gateway[0], ip_gateway[1],
+ ip_gateway[2], ip_gateway[3]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_gateway,
+ sizeof (ip_gateway));
+ 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:
+ /* 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
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* convert IP gateway from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.gateway, ip_gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_gateway, 0, LIBSPID_IP_BIN_LEN);
+ }
+
+ memdup ((u_char **) &ip_gateway_save, (u_char *) ip_gateway,
+ sizeof (ip_gateway));
+
+ if (NULL == ip_gateway_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "ipgateway",
+ ip_gateway_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.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ value = requests->requestvb->val.string;
+
+ /* convert IP gateway given in SET request from array of bytes to
+ * string and change it in IP structure */
+ ret = libspid_ip_bin_to_str (value, ip.gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: handle_eocCBATAdminIPGateway",
+ "SET IP gateway converted to string: %s \n", ip.gateway));
+
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object*/
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP gateway */
+ value = (u_char *) netsnmp_request_get_list_data (
+ requests,
+ "ipgateway");
+
+ /* convert IP gateway from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ip.gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ 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_eocCBATAdminIPGateway\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminVLANID(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ unsigned int *vlan_id_save = NULL;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ unsigned int vlan_id;
+
+ int 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:
+ /* read buffer for EMS IP address from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* VLAN ID set to 0 to permit walk requests */
+ vlan_id = 0;
+ }
+ else
+ {
+ /* parse VLAN ID from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ vlan_id = 0;
+ else if ((0 <= value) && (EOCCBATADMIN_VLANID_MAX >= value))
+ vlan_id = value;
+ else
+ vlan_id = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &vlan_id , sizeof (vlan_id));
+ 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:
+ /* 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 );
+ }
+ vlan_id = *requests->requestvb->val.integer;
+ if (vlan_id < 0 || vlan_id > EOCCBATADMIN_VLANID_MAX)
+ {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_WRONGVALUE);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ ret = libspid_config_read_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ break;
+ }
+ /* parse VLAN ID from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ vlan_id = 0;
+ else if ((0 <= value) && (EOCCBATADMIN_VLANID_MAX >= value))
+ vlan_id = value;
+ else
+ vlan_id = 0;
+
+ memdup ((u_char **) &vlan_id_save,
+ (u_char *) &vlan_id, sizeof (vlan_id));
+
+
+ if ( NULL == vlan_id_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "vlan_id",
+ vlan_id_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. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ vlan_id = *requests->requestvb->val.integer;
+ sprintf (buffer, "%d", vlan_id);
+
+ ret = libspid_config_write_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID,
+ buffer);
+ if ( LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data
+ (requests, "vlan_id"));
+
+ sprintf (buffer, "%d", value);
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID,
+ buffer);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ break;
+ }
+
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminVLANID\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.h
new file mode 100644
index 0000000000..7a33ac030d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.h
@@ -0,0 +1,19 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATNETWORKATTRGROUP_H
+#define EOCCBATNETWORKATTRGROUP_H
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCBATNetworkAttrGroup(void);
+Netsnmp_Node_Handler handle_eocCBATAdminMACAddress;
+Netsnmp_Node_Handler handle_eocCBATAdminIPMode;
+Netsnmp_Node_Handler handle_eocCBATAdminIPAddress;
+Netsnmp_Node_Handler handle_eocCBATAdminIPMask;
+Netsnmp_Node_Handler handle_eocCBATAdminIPGateway;
+Netsnmp_Node_Handler handle_eocCBATAdminVLANID;
+
+#endif /* EOCCBATNETWORKATTRGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup.h
new file mode 100644
index 0000000000..e8dce27374
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.c
new file mode 100644
index 0000000000..c9a3ae95d2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.c
@@ -0,0 +1,392 @@
+/*
+ * 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 "eocCBATOtherAdminGroup.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+/** Initializes the eocCBATOtherAdminGroup module */
+void
+init_eocCBATOtherAdminGroup(void)
+{
+ static oid eocCBATAdminLinkTopoChange_oid[] = { 1,3,6,1,4,1,17409,2,4,1,5,1 };
+ static oid eocCBATAdminAppropriativeOID_oid[] = { 1,3,6,1,4,1,17409,2,4,1,5,2 };
+ static oid eocCBATCardUpLinkBroadcastFrameSendManner_oid[] = { 1,3,6,1,4,1,17409,2,4,1,5,3 };
+
+
+ /* initialize default value of eocCBATCardUpLinkBroadcastFrameSendManner */
+ libspid_config_write_item(LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+
+ DEBUGMSGTL(("eocCBATOtherAdminGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminLinkTopoChange", handle_eocCBATAdminLinkTopoChange,
+ eocCBATAdminLinkTopoChange_oid, OID_LENGTH(eocCBATAdminLinkTopoChange_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminAppropriativeOID", handle_eocCBATAdminAppropriativeOID,
+ eocCBATAdminAppropriativeOID_oid, OID_LENGTH(eocCBATAdminAppropriativeOID_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATCardUpLinkBroadcastFrameSendManner", handle_eocCBATCardUpLinkBroadcastFrameSendManner,
+ eocCBATCardUpLinkBroadcastFrameSendManner_oid, OID_LENGTH(eocCBATCardUpLinkBroadcastFrameSendManner_oid),
+ HANDLER_CAN_RWRITE
+ ));
+}
+
+int
+handle_eocCBATAdminLinkTopoChange(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ admin_link_topo_change_t topo_change = ADMIN_LINK_TOPO_NO_CHANGE;
+ libspid_error_t ret;
+
+ /* list of MAC addresses currently online */
+ mac_t mac_address_list_new[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+ /* list of MAC addresses previously online */
+ static mac_t mac_address_list_old[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+
+ /* number of currently online stations */
+ int mac_count_new = 0;
+ /* number of previously online stations */
+ static int mac_count_old;
+ int i, j;
+ int found = 0;
+ /* 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:
+ /* get current network topology state */
+ ret = libspid_eoc_get_topo (mac_address_list_new[0], &mac_count_new);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_get_topo error\n");
+ /* state set to 'no change' in order to permit WALK requests */
+ topo_change = ADMIN_LINK_TOPO_NO_CHANGE;
+ }
+ else
+ {
+ /* check for change in number of online stations */
+ if (mac_count_new != mac_count_old)
+ {
+ topo_change = ADMIN_LINK_TOPO_CHANGE;
+ }
+ else
+ {
+ topo_change = ADMIN_LINK_TOPO_NO_CHANGE;
+ /* check for difference in previous and current MAC address list */
+ for (i = 0; i < mac_count_new; i++)
+ {
+ found = 0;
+ for (j = 0; j < mac_count_new; j++)
+ {
+ if (!memcmp (mac_address_list_new[i],
+ mac_address_list_old[j],
+ sizeof (mac_t)))
+ {
+ found = 1;
+ break;
+ }
+ }
+
+ if (0 == found)
+ {
+ topo_change = ADMIN_LINK_TOPO_CHANGE;
+ break;
+ }
+ }
+ }
+ }
+
+ /* store current values for next GET request */
+ mac_count_old = mac_count_new;
+ memcpy (mac_address_list_old, mac_address_list_new,
+ sizeof (mac_address_list_new));
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &topo_change,
+ sizeof (topo_change));
+ 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:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminLinkTopoChange\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminAppropriativeOID(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ oid app_oid[MAX_OID_LEN];
+ size_t app_oid_len;
+ 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:
+ memset (app_oid, 0, sizeof (app_oid));
+ app_oid_len = MAX_OID_LEN;
+
+ /* parse Appropriative OID from hard-coded string value */
+ if (!snmp_parse_oid (ADMIN_APPROPRIATIVE_OID, app_oid, &app_oid_len))
+ {
+ snmp_log (LOG_ERR,
+ "error parsing OID from %s\n",
+ ADMIN_APPROPRIATIVE_OID);
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OBJECT_ID,
+ (u_char *) app_oid,
+ app_oid_len * sizeof (oid));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminAppropriativeOID\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATCardUpLinkBroadcastFrameSendManner(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int interval = 0;
+ int* interval_save = NULL;
+ int value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /* 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:
+
+ ret = libspid_config_read_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ buffer, sizeof (buffer));
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,"eocCBATCardUpLinkBroadcastFrameSendManner: "
+ "libspid_config_read_item error: %d\n", ret);
+ /*interval set to default value T1 to permit walk requests */
+ interval = atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+ break;
+ }
+
+ /* parse interval from buffer */
+ if (1 != sscanf(buffer, "%d", &value))
+ interval = atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+ else if (value == atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2))
+ interval = value;
+ else
+ interval = atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &interval,
+ sizeof (interval));
+ 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:
+ /* 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 );
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (
+ requests->requestvb,
+ atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1),
+ atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2));
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ ret = libspid_config_read_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ buffer, sizeof (buffer));
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,"eocCBATCardUpLinkBroadcastFrameSendManner: "
+ "libspid_config_read_item error: %d\n", ret);
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ break;
+ }
+
+ /* parse interval from buffer */
+ if (1 != sscanf(buffer, "%d", &value))
+ interval = atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+ else if (value == atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2))
+ interval = value;
+ else
+ interval = atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+
+
+ memdup ((u_char **) &interval_save, (u_char *) &interval,
+ sizeof (interval));
+
+
+ if ( NULL == interval_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "interval",
+ interval_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ interval = *(requests->requestvb->val.integer);
+ if (interval ==
+ atoi (LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2))
+ {
+ libspid_config_write_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2);
+ }
+ else
+ {
+ libspid_config_write_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+
+ interval = *((int *)netsnmp_request_get_list_data (
+ requests,
+ "interval"));
+ if (interval ==
+ atoi (LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2))
+ {
+ libspid_config_write_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2);
+ }
+ else
+ {
+ libspid_config_write_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATCardUpLinkBroadcastFrameSendManner\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.h
new file mode 100644
index 0000000000..b3992f8f6d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.h
@@ -0,0 +1,16 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATOTHERADMINGROUP_H
+#define EOCCBATOTHERADMINGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+/* function declarations */
+void init_eocCBATOtherAdminGroup(void);
+Netsnmp_Node_Handler handle_eocCBATAdminLinkTopoChange;
+Netsnmp_Node_Handler handle_eocCBATAdminAppropriativeOID;
+Netsnmp_Node_Handler handle_eocCBATCardUpLinkBroadcastFrameSendManner;
+
+#endif /* EOCCBATOTHERADMINGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup.h
new file mode 100644
index 0000000000..22e5a36672
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup.h
@@ -0,0 +1,2 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable.h
new file mode 100644
index 0000000000..30b417dea4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunity.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunity.m2d
new file mode 100644
index 0000000000..975460706a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunity.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATAdminSNMPCommunity
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityIndex.m2d
new file mode 100644
index 0000000000..81ac78f609
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATAdminSNMPCommunityIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityPermission.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityPermission.m2d
new file mode 100644
index 0000000000..92cf40074b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityPermission.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATAdminSNMPCommunityPermission
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityRowStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityRowStatus.m2d
new file mode 100644
index 0000000000..a42b19ff13
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityRowStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATAdminSNMPCommunityRowStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/table-eocCBATAdminSNMPCommunityTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/table-eocCBATAdminSNMPCommunityTable.m2d
new file mode 100644
index 0000000000..04d74b2009
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/table-eocCBATAdminSNMPCommunityTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCBATAdminSNMPCommunityTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 1@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 1@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-FIRST.txt
new file mode 100644
index 0000000000..7da575faf1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCBATAdminSNMPCommunityTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCBATAdminSNMPCommunityTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCBATAdminSNMPCommunityTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCBATAdminSNMPCommunityTable_Makefile
+
+
+ File : eocCBATAdminSNMPCommunityTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCBATAdminSNMPCommunityTable-README-eocCBATAdminSNMPCommunityTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCBATAdminSNMPCommunityTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCBATAdminSNMPCommunityTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCBATAdminSNMPCommunityTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCBATAdminSNMPCommunityTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-eocCBATAdminSNMPCommunityTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-eocCBATAdminSNMPCommunityTable.txt
new file mode 100644
index 0000000000..20b4fcd19c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-eocCBATAdminSNMPCommunityTable.txt
@@ -0,0 +1,692 @@
+************************************************************************
+eocCBATAdminSNMPCommunityTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCBATAdminSNMPCommunityTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCBATAdminSNMPCommunityTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCBATAdminSNMPCommunityTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCBATAdminSNMPCommunityTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCBATAdminSNMPCommunityTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCBATAdminSNMPCommunityTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCBATAdminSNMPCommunityTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCBATAdminSNMPCommunityTable_allocate_data
+ eocCBATAdminSNMPCommunityTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx_init
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCBATAdminSNMPCommunityTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCBATAdminSNMPCommunityTable table are:
+
+ eocCBATAdminSNMPCommunityIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCBATAdminSNMPCommunityTable_data.
+
+
+************************************************************************
+eocCBATAdminSNMPCommunityTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCBATAdminSNMPCommunityTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCBATAdminSNMPCommunityTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCBATAdminSNMPCommunityTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCBATAdminSNMPCommunityTable_indexes_set
+ WHERE: eocCBATAdminSNMPCommunityTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCBATAdminSNMPCommunityTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCBATAdminSNMPCommunityTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATAdminSNMPCommunity_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATAdminSNMPCommunityPermission_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATAdminSNMPCommunityRowStatus_get
+
+
+
+File: eocCBATAdminSNMPCommunityTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCBATAdminSNMPCommunityTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table supports ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+ To support row creation, the index component of an incoming set request must
+ be validated. A funciton is generated for each individual index component,
+ and another for validating all the index components together.
+
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : eocCBATAdminSNMPCommunityIndex_check_index
+
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : eocCBATAdminSNMPCommunityTable_validate_index
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCBATAdminSNMPCommunityTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATAdminSNMPCommunity_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATAdminSNMPCommunity_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATAdminSNMPCommunity_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATAdminSNMPCommunity_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATAdminSNMPCommunityPermission_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATAdminSNMPCommunityPermission_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATAdminSNMPCommunityPermission_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATAdminSNMPCommunityPermission_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATAdminSNMPCommunityRowStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATAdminSNMPCommunityRowStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATAdminSNMPCommunityRowStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATAdminSNMPCommunityRowStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCBATAdminSNMPCommunityTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCBATAdminSNMPCommunityTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCBATAdminSNMPCommunityTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCBATAdminSNMPCommunityTable table.
+
+To watch the flow of the eocCBATAdminSNMPCommunityTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCBATAdminSNMPCommunityTable
+ verbose:eocCBATAdminSNMPCommunityTable
+ internal:eocCBATAdminSNMPCommunityTable
+
+e.g.
+ snmpd -f -Le -DeocCBATAdminSNMPCommunityTable,verbose:eocCBATAdminSNMPCommunityTable,internal:eocCBATAdminSNMPCommunityTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityIndex
+ * eocCBATAdminSNMPCommunityIndex is subid 1 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.1
+ * Description:
+SNMP¹²Í¬Ìå¹ÜÀí±íË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocCBATAdminSNMPCommunityIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunity
+ * eocCBATAdminSNMPCommunity is subid 2 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.2
+ * Description:
+SNMP¹²Í¬Ìå´®£¬×Ϊ16λ×Ö·û´®¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 16;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 16)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityPermission
+ * eocCBATAdminSNMPCommunityPermission is subid 3 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.3
+ * Description:
+SNMP¹²Í¬ÌåȨÏÞ£¬Ö»¶ÁȨÏÞΪro(1)£¬¶ÁдȨÏÞΪrw(2)
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: rw(1), ro(2), wo(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityRowStatus
+ * eocCBATAdminSNMPCommunityRowStatus is subid 4 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.4
+ * Description:
+ÐÐ״̬¡£Ö»Ê¹ÓÃÁ½Ïî
+ 4-createAndGo
+ 6-distory
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c
new file mode 100644
index 0000000000..941eed5437
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c
@@ -0,0 +1,273 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCBATAdminSNMPCommunityTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCBATAdminSNMPCommunityTable_interface.h"
+
+oid eocCBATAdminSNMPCommunityTable_oid[] = { EOCCBATADMINSNMPCOMMUNITYTABLE_OID };
+int eocCBATAdminSNMPCommunityTable_oid_size = OID_LENGTH(eocCBATAdminSNMPCommunityTable_oid);
+
+ eocCBATAdminSNMPCommunityTable_registration eocCBATAdminSNMPCommunityTable_user_context;
+
+void initialize_table_eocCBATAdminSNMPCommunityTable(void);
+void shutdown_table_eocCBATAdminSNMPCommunityTable(void);
+
+/* declaration of handle for scalar added to table */
+int
+handle_eocCBATAdminSNMPCommunityTableNextIndex(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+/**
+ * Initializes the eocCBATAdminSNMPCommunityTable module
+ */
+void
+init_eocCBATAdminSNMPCommunityTable(void)
+{
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:"
+ "init_eocCBATAdminSNMPCommunityTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCBATAdminSNMPCommunityTable one-time
+ * module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init ("eocCBATAdminSNMPCommunityTable"))
+ initialize_table_eocCBATAdminSNMPCommunityTable ();
+
+ /*
+ * register scalar for eocCBATAdminSNMPCommunityTableNextIndex
+ */
+ static oid eocCBATAdminSNMPCommunityTableNextIndex_oid[] =
+ { EOCCBATADMINSNMPCOMMUNITYTABLENEXTINDEX_OID };
+
+ netsnmp_register_scalar (
+ netsnmp_create_handler_registration (
+ "eocCBATAdminSNMPCommunityTableNextIndex",
+ handle_eocCBATAdminSNMPCommunityTableNextIndex,
+ eocCBATAdminSNMPCommunityTableNextIndex_oid,
+ OID_LENGTH(eocCBATAdminSNMPCommunityTableNextIndex_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+/**
+ * Shut-down the eocCBATAdminSNMPCommunityTable module (agent is exiting)
+ */
+void
+shutdown_eocCBATAdminSNMPCommunityTable(void)
+{
+ if (should_init("eocCBATAdminSNMPCommunityTable"))
+ shutdown_table_eocCBATAdminSNMPCommunityTable();
+
+}
+
+/**
+ * Initialize the table eocCBATAdminSNMPCommunityTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCBATAdminSNMPCommunityTable(void)
+{
+ eocCBATAdminSNMPCommunityTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:initialize_table_eocCBATAdminSNMPCommunityTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCBATAdminSNMPCommunityTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCBATAdminSNMPCommunityTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocCBATAdminSNMPCommunityTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCBATAdminSNMPCommunityTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocCBATAdminSNMPCommunityTable */
+
+/**
+ * Shutdown the table eocCBATAdminSNMPCommunityTable
+ */
+void
+shutdown_table_eocCBATAdminSNMPCommunityTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCBATAdminSNMPCommunityTable_shutdown_interface(&eocCBATAdminSNMPCommunityTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCBATAdminSNMPCommunityTable_rowreq_ctx_init(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCBATAdminSNMPCommunityTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCBATAdminSNMPCommunityTable rowreq cleanup.
+ */
+} /* eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCBATAdminSNMPCommunityTable_pre_request(eocCBATAdminSNMPCommunityTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCBATAdminSNMPCommunityTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCBATAdminSNMPCommunityTable_post_request(eocCBATAdminSNMPCommunityTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCBATAdminSNMPCommunityTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCBATAdminSNMPCommunityTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCBATAdminSNMPCommunityTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_post_request */
+
+/* implementation of handle for scalar added to table */
+int
+handle_eocCBATAdminSNMPCommunityTableNextIndex(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /* 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. */
+ int next_index;
+
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ next_index = eocCBATAdminSNMPCommunityTable_Nextindex_get ();
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & next_index,
+ sizeof (next_index));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminSNMPCommunityTableNextIndex\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.h
new file mode 100644
index 0000000000..197f5e5557
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.h
@@ -0,0 +1,219 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+
+/* OID and column number definitions for eocCBATAdminSNMPCommunityTable */
+#include "eocCBATAdminSNMPCommunityTable_oids.h"
+
+/* enum definions */
+#include "eocCBATAdminSNMPCommunityTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCBATAdminSNMPCommunityTable(void);
+void shutdown_eocCBATAdminSNMPCommunityTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCBATAdminSNMPCommunityTable registration context.
+ */
+typedef netsnmp_data_list eocCBATAdminSNMPCommunityTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCBATAdminSNMPCommunityTable data context structure.
+ * This structure is used to represent the data for eocCBATAdminSNMPCommunityTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCBATAdminSNMPCommunityTable.
+ */
+typedef struct eocCBATAdminSNMPCommunityTable_data_s {
+
+ /* fields added to use for container iteration */
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid st_index; /* arbitrary index */
+
+ /* field added for community index */
+ long eocCBATAdminSNMPCommunityIndex;
+
+
+
+ /*
+ * eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocCBATAdminSNMPCommunity[EOCCBATADMIN_COMMUNITY_MAX_LEN];
+ size_t eocCBATAdminSNMPCommunity_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCBATAdminSNMPCommunityPermission;
+
+ /*
+ * eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCBATAdminSNMPCommunityRowStatus;
+
+} eocCBATAdminSNMPCommunityTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCBATAdminSNMPCommunityTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCBATAdminSNMPCommunityTable_data eocCBATAdminSNMPCommunityTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCBATAdminSNMPCommunityTable mib index.
+ * This structure is used to represent the index for eocCBATAdminSNMPCommunityTable.
+ */
+typedef struct eocCBATAdminSNMPCommunityTable_mib_index_s {
+
+ /*
+ * eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocCBATAdminSNMPCommunityIndex;
+
+
+} eocCBATAdminSNMPCommunityTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCBATAdminSNMPCommunityTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCBATAdminSNMPCommunityTable_IDX_LEN 1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCBATAdminSNMPCommunityTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCBATAdminSNMPCommunityTable_rowreq_ctx pointer.
+ */
+typedef struct eocCBATAdminSNMPCommunityTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCBATAdminSNMPCommunityTable_IDX_LEN];
+
+ eocCBATAdminSNMPCommunityTable_mib_index tbl_idx;
+
+ eocCBATAdminSNMPCommunityTable_data * data;
+ unsigned int column_exists_flags; /* flags for existence */
+ eocCBATAdminSNMPCommunityTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCBATAdminSNMPCommunityTable rowreq context.
+ */
+ u_char undo_ref_count;
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCBATAdminSNMPCommunityTable_data_list;
+
+} eocCBATAdminSNMPCommunityTable_rowreq_ctx;
+
+typedef struct eocCBATAdminSNMPCommunityTable_ref_rowreq_ctx_s {
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx;
+} eocCBATAdminSNMPCommunityTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCBATAdminSNMPCommunityTable_pre_request(eocCBATAdminSNMPCommunityTable_registration * user_context);
+ int eocCBATAdminSNMPCommunityTable_post_request(eocCBATAdminSNMPCommunityTable_registration * user_context,
+ int rc);
+
+ int eocCBATAdminSNMPCommunityTable_rowreq_ctx_init(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCBATAdminSNMPCommunityTable_commit(eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx);
+
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *
+ eocCBATAdminSNMPCommunityTable_row_find_by_mib_index(eocCBATAdminSNMPCommunityTable_mib_index *mib_idx);
+
+extern oid eocCBATAdminSNMPCommunityTable_oid[];
+extern int eocCBATAdminSNMPCommunityTable_oid_size;
+
+extern int adding_snmpcommunity;
+extern int curr_comm_num;
+
+
+
+#include "eocCBATAdminSNMPCommunityTable_interface.h"
+#include "eocCBATAdminSNMPCommunityTable_data_access.h"
+#include "eocCBATAdminSNMPCommunityTable_data_get.h"
+#include "eocCBATAdminSNMPCommunityTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.c
new file mode 100644
index 0000000000..61c6bea809
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.c
@@ -0,0 +1,764 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+
+#include "eocCBATAdminSNMPCommunityTable_data_access.h"
+
+
+int adding_snmpcommunity;
+int curr_comm_num = 0;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+
+/**
+ * initialization for eocCBATAdminSNMPCommunityTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCBATAdminSNMPCommunityTable_reg
+ * Pointer to eocCBATAdminSNMPCommunityTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCBATAdminSNMPCommunityTable_init_data(eocCBATAdminSNMPCommunityTable_registration * eocCBATAdminSNMPCommunityTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCBATAdminSNMPCommunityTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCBATAdminSNMPCommunityTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCBATAdminSNMPCommunityTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCBATAdminSNMPCommunityTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCBATAdminSNMPCommunityTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCBATADMINSNMPCOMMUNITYTABLE_CACHE_TIMEOUT; /* seconds */
+
+ /* initialize row adding indication */
+ adding_snmpcommunity = 0;
+} /* eocCBATAdminSNMPCommunityTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCBATAdminSNMPCommunityTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCBATAdminSNMPCommunityTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCBATAdminSNMPCommunityTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCBATAdminSNMPCommunityTable_container_shutdown */
+
+
+void
+_adminsnmpcommunity_update_entry (eocCBATAdminSNMPCommunityTable_data * lhs,
+ eocCBATAdminSNMPCommunityTable_data * rhs)
+{
+ if (lhs->eocCBATAdminSNMPCommunity_len !=
+ rhs->eocCBATAdminSNMPCommunity_len)
+ {
+ lhs->eocCBATAdminSNMPCommunity_len =
+ rhs->eocCBATAdminSNMPCommunity_len;
+ memcpy (lhs->eocCBATAdminSNMPCommunity,
+ rhs->eocCBATAdminSNMPCommunity,
+ rhs->eocCBATAdminSNMPCommunity_len);
+ }
+ else if (memcmp
+ (lhs->eocCBATAdminSNMPCommunity, rhs->eocCBATAdminSNMPCommunity,
+ rhs->eocCBATAdminSNMPCommunity_len) != 0)
+ {
+ memcpy (lhs->eocCBATAdminSNMPCommunity,
+ rhs->eocCBATAdminSNMPCommunity,
+ rhs->eocCBATAdminSNMPCommunity_len);
+ }
+
+ if (lhs->eocCBATAdminSNMPCommunityPermission !=
+ rhs->eocCBATAdminSNMPCommunityPermission)
+ {
+ lhs->eocCBATAdminSNMPCommunityPermission =
+ rhs->eocCBATAdminSNMPCommunityPermission;
+ }
+}
+
+int
+_adminsnmpcommunity_container_load (netsnmp_container * container)
+{
+ int i, j;
+ int tmp;
+
+ /* initial row status is set to active by default */
+ int init_row_status = ROWSTATUS_ACTIVE;
+ int rc = MFD_SUCCESS;
+
+
+ eocCBATAdminSNMPCommunityTable_data *entry;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx;
+ int line_num_comm = LIBSPID_SNMPD_COMMUNITY_MAX_NB;
+ int line_num_sec = LIBSPID_SNMPD_COMMUNITY_MAX_NB;
+ libspid_snmp_comm_t comm_entry[LIBSPID_SNMPD_COMMUNITY_MAX_NB];
+
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable:access",
+ "_adminsnmpcommunity_container_load called \n"));
+
+ if (NULL == container)
+ {
+ snmp_log (LOG_ERR, "no container specified/found for _eoccnu"
+ "_vlan_container_load\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_read_community_list (comm_entry, &line_num_comm))
+ {
+ snmp_log (LOG_ERR,
+ "eocCommunityTable_data_access.c:"
+ "eocCommunityTable_container_load read config error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_read_security_list (comm_entry, &line_num_sec))
+ {
+ snmp_log (LOG_ERR,
+ "eocCommunityTable_data_access.c:"
+ "eocCommunityTable_container_load read config error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /*For some comm_names using a same sec , we will map it for every comm */
+ if (line_num_comm > line_num_sec)
+ {
+
+ for (i = line_num_sec; i < line_num_comm; i++)
+ {
+ for (j = 0; j < line_num_sec; j++)
+ {
+ if (strcmp (comm_entry[i].sec_name, comm_entry[j].sec_name)
+ == 0)
+ comm_entry[i].comm_permission =
+ comm_entry[j].comm_permission;
+ }
+
+ if (comm_entry[i].comm_permission == 0)
+ {
+ snmp_log (LOG_ERR,
+ "eocCommunityTable_data_access.c:"
+ "eocCommunityTable_container_load read permission "
+ "config error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ }
+ }
+ else if (line_num_comm < line_num_sec)
+ {
+ /*This case is terrible . the line_num_comm must bigger or same than line_num_sec */
+ snmp_log (LOG_ERR,
+ "eocCommunityTable_data_access.c-"
+ "eocCommunityTable_container_load read config error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ for (i = 0; i < line_num_comm; i++)
+ {
+ /*
+ * TODO:352:M: | |-> set indexes in new eocCBATAdminSNMPCommunityTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+
+ /* call interface function for allocating community table data */
+ if (NULL == (entry = eocCBATAdminSNMPCommunityTable_allocate_data ()))
+ {
+ snmp_log (LOG_ERR, "community entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* set row status to initial value */
+ entry->eocCBATAdminSNMPCommunityRowStatus = init_row_status;
+
+
+ entry->eocCBATAdminSNMPCommunityIndex = i;
+
+ /* parse community name from community entry */
+ if ((NULL == comm_entry[i].comm_name) || (!strcmp(comm_entry[i].comm_name, "")))
+ {
+ snmp_log(LOG_ERR, "empty community name field\n");
+ entry->eocCBATAdminSNMPCommunity[0] = '\0';
+ entry->eocCBATAdminSNMPCommunity_len = 0;
+ }
+ else
+ {
+ strncpy(entry->eocCBATAdminSNMPCommunity,
+ comm_entry[i].comm_name,
+ EOCCBATADMIN_COMMUNITY_MAX_LEN-1);
+ entry->eocCBATAdminSNMPCommunity[EOCCBATADMIN_COMMUNITY_MAX_LEN-1]
+ = '\0';
+ entry->eocCBATAdminSNMPCommunity_len
+ = strlen(comm_entry[i].comm_name);
+ }
+
+
+ if (ROWSTATUS_ACTIVE == entry->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* for valid row, add comm name string to internal
+ * storage list (if not already present in there) */
+ tmp =
+ se_find_value_in_slist ("eoc_comm_list",
+ entry->eocCBATAdminSNMPCommunity);
+ if (tmp == SE_DNE)
+ {
+ se_add_pair_to_slist ("eoc_comm_list",
+ strdup (entry->
+ eocCBATAdminSNMPCommunity),
+ i + 1);
+ }
+ }
+
+ entry->eocCBATAdminSNMPCommunityPermission =
+ comm_entry[i].comm_permission;
+
+ /* set entry index for container comparison */
+ entry->st_index = i + 1;
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT (container, entry);
+ }
+ curr_comm_num = i;
+ return rc;
+}
+
+/**
+ * check entry for update
+ */
+
+static void
+_adminsnmpcommunity_check_entry_for_updates
+ (eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx, void **magic)
+{
+ netsnmp_container *comm_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable:access",
+ "checking entry for updates\n"));
+
+ netsnmp_assert (NULL != comm_container);
+ netsnmp_assert (NULL != rowreq_ctx);
+ netsnmp_assert (NULL != rowreq_ctx->data);
+ /*
+ * check for matching entries to be deleted
+ */
+ eocCBATAdminSNMPCommunityTable_data *adminsnmpcommunity_entry =
+ CONTAINER_FIND (comm_container, rowreq_ctx->data);
+ if (NULL == adminsnmpcommunity_entry)
+ {
+
+ if (NULL == to_delete)
+ {
+ magic[1] = to_delete = netsnmp_container_find ("lifo");
+ if (NULL == to_delete)
+ snmp_log (LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT (to_delete, rowreq_ctx);
+ }
+ else
+ {
+ /* check for updates for editable columns from community table */
+ _adminsnmpcommunity_update_entry (rowreq_ctx->data,
+ adminsnmpcommunity_entry);
+
+ /*
+ * remove entry from temporary community container
+ */
+ CONTAINER_REMOVE (comm_container, adminsnmpcommunity_entry);
+ free (adminsnmpcommunity_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_adminsnmpcommunity_add_new_entry (eocCBATAdminSNMPCommunityTable_data *
+ adminsnmpcommunity_entry,
+ netsnmp_container * container)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable:access",
+ "creating new entry\n"));
+
+ netsnmp_assert (NULL != adminsnmpcommunity_entry);
+ netsnmp_assert (NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx =
+ eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx
+ (adminsnmpcommunity_entry, NULL);
+
+ if ((NULL != rowreq_ctx) && (MFD_SUCCESS ==
+ eocCBATAdminSNMPCommunityTable_indexes_set
+ (rowreq_ctx,
+ adminsnmpcommunity_entry->eocCBATAdminSNMPCommunityIndex)))
+ {
+ if (CONTAINER_INSERT (container, rowreq_ctx) < 0)
+ {
+ snmp_log (LOG_ERR,
+ "eocCBATAdminSNMPCommunityTable container insert failed for"
+ " new entry\n");
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx (rowreq_ctx);
+ return;
+ }
+ ++count;
+ }
+ else
+ {
+ if (NULL != rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocCBATAdminSNMPCommunityTable cache.\n");
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx (rowreq_ctx);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "memory allocation failed while loading "
+ "eocCBATAdminSNMPCommunityTable cache.\n");
+ free (adminsnmpcommunity_entry);
+ }
+
+ return;
+ }
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus =
+ adminsnmpcommunity_entry->eocCBATAdminSNMPCommunityRowStatus;
+}
+
+
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCBATAdminSNMPCommunityTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCBATAdminSNMPCommunityTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCBATAdminSNMPCommunityTable_container_load(netsnmp_container *container)
+{
+ int rc = MFD_SUCCESS;
+ netsnmp_container *adminsnmpcommunity_container;
+ void *tmp_ptr[2];
+ /*
+ * TODO:351:M: |-> Load/update data in the eocVLANTable container.
+ * loop over your eocCBATAdminSNMPCommunityTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* create temporary container for fresh community data */
+ adminsnmpcommunity_container =
+ netsnmp_container_find ("adminsnmpcommunity_temp:table_container");
+
+
+ if (NULL == adminsnmpcommunity_container)
+ {
+ snmp_log (LOG_ERR, "adminsnmpcommunity temp container not found\n");
+ return MFD_ERROR;
+ }
+
+ /* load fresh community data into temp container */
+ rc = _adminsnmpcommunity_container_load (adminsnmpcommunity_container);
+ if (MFD_ERROR == rc)
+ {
+ snmp_log (LOG_ERR, "adminsnmpcommunity container load error\n");
+ return MFD_ERROR;
+ }
+
+ tmp_ptr[0] = adminsnmpcommunity_container;
+ tmp_ptr[1] = NULL;
+
+ /* check if eocCBATAdminSNMPCommunityTable container needs updates */
+ /* (this is not called if table container is empty) */
+ CONTAINER_FOR_EACH (container, (netsnmp_container_obj_func *)
+ _adminsnmpcommunity_check_entry_for_updates, tmp_ptr);
+ /*
+ * add new entries to eocCBATAdminSNMPCommunityTable container
+ */
+ CONTAINER_FOR_EACH (adminsnmpcommunity_container,
+ (netsnmp_container_obj_func *)
+ _adminsnmpcommunity_add_new_entry, container);
+
+ /*
+ * free temporary container. we've either claimed each entry, or released it,
+ * so we don't need to call CONTAINER_CLEAR to clear the container.
+ */
+ CONTAINER_FREE (adminsnmpcommunity_container);
+
+ /*
+ * remove deleted items from eocCBATAdminSNMPCommunityTable container
+ */
+ if (NULL != tmp_ptr[1])
+ {
+ netsnmp_container *tmp_container = (netsnmp_container *) tmp_ptr[1];
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE (tmp_container))
+ {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST (tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE (container, tmp_ctx);
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx (tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE (tmp_container, NULL);
+ }
+ }
+
+ DEBUGMSGT (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_container_load", "inserted %d records\n", CONTAINER_SIZE (container)));
+ return MFD_SUCCESS;
+
+} /* eocCBATAdminSNMPCommunityTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCBATAdminSNMPCommunityTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCBATAdminSNMPCommunityTable container data.
+ */
+} /* eocCBATAdminSNMPCommunityTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCBATAdminSNMPCommunityTable_row_prep( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_row_prep */
+
+/*
+ * TODO:420:r: Implement eocCBATAdminSNMPCommunityTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityIndex
+ * eocCBATAdminSNMPCommunityIndex is subid 1 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.1
+ * Description:
+SNMP¹²Í¬Ìå¹ÜÀí±íË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocCBATAdminSNMPCommunityIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of eocCBATAdminSNMPCommunityIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * eocCBATAdminSNMPCommunityTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+eocCBATAdminSNMPCommunityIndex_check_index( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx )
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityIndex_check_index","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check eocCBATAdminSNMPCommunityTable index eocCBATAdminSNMPCommunityIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.eocCBATAdminSNMPCommunityIndex)
+ */
+
+ return MFD_SUCCESS; /* eocCBATAdminSNMPCommunityIndex index ok */
+} /* eocCBATAdminSNMPCommunityIndex_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param eocCBATAdminSNMPCommunityTable_reg
+ * Pointer to the user registration data
+ * @param eocCBATAdminSNMPCommunityTable_rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+eocCBATAdminSNMPCommunityTable_validate_index( eocCBATAdminSNMPCommunityTable_registration * eocCBATAdminSNMPCommunityTable_reg,
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_validate_index","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:430:M: |-> Validate potential eocCBATAdminSNMPCommunityTable index.
+ */
+ if (0)
+ {
+ snmp_log (LOG_WARNING, "invalid index for a new row in the "
+ "eocCBATAdminSNMPCommunityTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0)
+ {
+ return MFD_CANNOT_CREATE_EVER;
+ }
+ else
+ {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ }
+ else
+ {
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityIndex =
+ rowreq_ctx->tbl_idx.eocCBATAdminSNMPCommunityIndex;
+ }
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.h
new file mode 100644
index 0000000000..08b9054ad6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.h
@@ -0,0 +1,66 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_ACCESS_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+
+
+ int eocCBATAdminSNMPCommunityTable_init_data(eocCBATAdminSNMPCommunityTable_registration * eocCBATAdminSNMPCommunityTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCBATAdminSNMPCommunityTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_CACHE_TIMEOUT 60
+
+void eocCBATAdminSNMPCommunityTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCBATAdminSNMPCommunityTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCBATAdminSNMPCommunityTable_container_load(netsnmp_container *container);
+void eocCBATAdminSNMPCommunityTable_container_free(netsnmp_container *container);
+
+int eocCBATAdminSNMPCommunityTable_cache_load(netsnmp_container *container);
+void eocCBATAdminSNMPCommunityTable_cache_free(netsnmp_container *container);
+
+ int eocCBATAdminSNMPCommunityTable_row_prep( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+
+int eocCBATAdminSNMPCommunityTable_validate_index( eocCBATAdminSNMPCommunityTable_registration * eocCBATAdminSNMPCommunityTable_reg,
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+int eocCBATAdminSNMPCommunityIndex_check_index( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx ); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.c
new file mode 100644
index 0000000000..b1e5c604e3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.c
@@ -0,0 +1,318 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCBATAdminSNMPCommunityTable get routines.
+ * TODO:240:M: Implement eocCBATAdminSNMPCommunityTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCBATAdminSNMPCommunityTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCBATAdminSNMPCommunityIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCBATAdminSNMPCommunityTable_indexes_set_tbl_idx(eocCBATAdminSNMPCommunityTable_mib_index *tbl_idx, long eocCBATAdminSNMPCommunityIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ tbl_idx->eocCBATAdminSNMPCommunityIndex = eocCBATAdminSNMPCommunityIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCBATAdminSNMPCommunityTable_indexes_set(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, long eocCBATAdminSNMPCommunityIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCBATAdminSNMPCommunityTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCBATAdminSNMPCommunityIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCBATAdminSNMPCommunityTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunity
+ * eocCBATAdminSNMPCommunity is subid 2 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.2
+ * Description:
+SNMP¹²Í¬Ìå´®£¬×Ϊ16λ×Ö·û´®¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 16;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 16)
+ */
+/**
+ * Extract the current value of the eocCBATAdminSNMPCommunity data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunity_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATAdminSNMPCommunity_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATAdminSNMPCommunity.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATAdminSNMPCommunity_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATAdminSNMPCommunity_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATAdminSNMPCommunity_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char **eocCBATAdminSNMPCommunity_val_ptr_ptr, size_t *eocCBATAdminSNMPCommunity_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATAdminSNMPCommunity_val_ptr_ptr) && (NULL != *eocCBATAdminSNMPCommunity_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATAdminSNMPCommunity_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunity_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATAdminSNMPCommunity data.
+ * copy (* eocCBATAdminSNMPCommunity_val_ptr_ptr ) data and (* eocCBATAdminSNMPCommunity_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATAdminSNMPCommunity data
+ */
+ if ((NULL == (* eocCBATAdminSNMPCommunity_val_ptr_ptr )) ||
+ ((* eocCBATAdminSNMPCommunity_val_ptr_len_ptr ) <
+ (rowreq_ctx->data->eocCBATAdminSNMPCommunity_len* sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity[0])))) {
+ /*
+ * allocate space for eocCBATAdminSNMPCommunity data
+ */
+ (* eocCBATAdminSNMPCommunity_val_ptr_ptr ) = malloc(rowreq_ctx->data->eocCBATAdminSNMPCommunity_len* sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity[0]));
+ if(NULL == (* eocCBATAdminSNMPCommunity_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATAdminSNMPCommunity_val_ptr_len_ptr ) = rowreq_ctx->data->eocCBATAdminSNMPCommunity_len* sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity[0]);
+ memcpy( (* eocCBATAdminSNMPCommunity_val_ptr_ptr ), rowreq_ctx->data->eocCBATAdminSNMPCommunity, rowreq_ctx->data->eocCBATAdminSNMPCommunity_len* sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunity_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityPermission
+ * eocCBATAdminSNMPCommunityPermission is subid 3 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.3
+ * Description:
+SNMP¹²Í¬ÌåȨÏÞ£¬Ö»¶ÁȨÏÞΪro(1)£¬¶ÁдȨÏÞΪrw(2)
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: rw(1), ro(2), wo(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCBATAdminSNMPCommunityPermission data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunityPermission_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATAdminSNMPCommunityPermission_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATAdminSNMPCommunityPermission_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATAdminSNMPCommunityPermission_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityPermission_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATAdminSNMPCommunityPermission data.
+ * copy (* eocCBATAdminSNMPCommunityPermission_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATAdminSNMPCommunityPermission_val_ptr ) = rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission;
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityPermission_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityRowStatus
+ * eocCBATAdminSNMPCommunityRowStatus is subid 4 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.4
+ * Description:
+ÐÐ״̬¡£Ö»Ê¹ÓÃÁ½Ïî
+ 4-createAndGo
+ 6-distory
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCBATAdminSNMPCommunityRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunityRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATAdminSNMPCommunityRowStatus_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATAdminSNMPCommunityRowStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATAdminSNMPCommunityRowStatus_val_ptr );
+
+ (* eocCBATAdminSNMPCommunityRowStatus_val_ptr ) = rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus;
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityRowStatus_get */
+
+
+int
+eocCBATAdminSNMPCommunityTable_Nextindex_get(void)
+{
+ netsnmp_container * adminsnmpcommunity_container;
+ int rc;
+ int next_index = 0;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_Nextindex_get", "called!\n"));
+
+ adminsnmpcommunity_container =
+ netsnmp_container_find("eocCBATAdminSNMPCommunityTable:table_container");
+ if (NULL == adminsnmpcommunity_container) {
+ snmp_log(LOG_ERR, "AdminSNMPCommunity container not found\n");
+ return -1;
+ }
+
+ rc = eocCBATAdminSNMPCommunityTable_container_load(adminsnmpcommunity_container);
+ if (MFD_ERROR == rc) {
+ snmp_log(LOG_ERR, "AdminSNMPCommunity container load error\n");
+ return -1;
+ }
+
+
+ next_index = curr_comm_num;
+
+
+ return next_index;
+}
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.h
new file mode 100644
index 0000000000..f64c5c5190
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.h
@@ -0,0 +1,61 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCBATAdminSNMPCommunityTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_GET_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+ /*
+ * indexes
+ */
+
+ int eocCBATAdminSNMPCommunity_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char **eocCBATAdminSNMPCommunity_val_ptr_ptr, size_t *eocCBATAdminSNMPCommunity_val_ptr_len_ptr );
+ int eocCBATAdminSNMPCommunityPermission_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATAdminSNMPCommunityPermission_val_ptr );
+ int eocCBATAdminSNMPCommunityRowStatus_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATAdminSNMPCommunityRowStatus_val_ptr );
+
+
+int eocCBATAdminSNMPCommunityTable_indexes_set_tbl_idx(eocCBATAdminSNMPCommunityTable_mib_index *tbl_idx, long eocCBATAdminSNMPCommunityIndex_val);
+int eocCBATAdminSNMPCommunityTable_indexes_set(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, long eocCBATAdminSNMPCommunityIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.c
new file mode 100644
index 0000000000..576cf4cd1c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.c
@@ -0,0 +1,1589 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCBATAdminSNMPCommunityTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCBATAdminSNMPCommunityTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCBATAdminSNMPCommunityTable_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCBATAdminSNMPCommunityTable undo.
+ * set up eocCBATAdminSNMPCommunityTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCBATAdminSNMPCommunityRowStatus_val_ptr )*
+ */
+
+ /* copy data context to undo context */
+ memcpy (rowreq_ctx->undo, rowreq_ctx->data,
+ sizeof (eocCBATAdminSNMPCommunityTable_data));
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCBATAdminSNMPCommunityTable_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCBATAdminSNMPCommunityTable undo.
+ * eocCBATAdminSNMPCommunityTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCBATAdminSNMPCommunityRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATAdminSNMPCommunityTable_undo_cleanup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCBATAdminSNMPCommunityTable undo.
+ * Undo storage is in (* eocCBATAdminSNMPCommunityRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCBATAdminSNMPCommunityTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCBATAdminSNMPCommunityTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATAdminSNMPCommunityTable_commit( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+ char old_comm_name[32], old_sec_name[32];
+ char new_comm_name[32];
+ int new_access = 0;
+ int tmp;
+ int ret;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ if (NULL == rowreq_ctx->data->eocCBATAdminSNMPCommunity)
+ return MFD_ERROR;
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCBATAdminSNMPCommunityTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags)
+ {
+ DEBUGMSGTL (("eocVLANTable:eocVLANTable_commit", "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG; /* clear eocCBATAdminSNMPCommunity */
+ /*
+ * TODO:482:o: |-> commit column eocCBATAdminSNMPCommunity.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATAdminSNMPCommunity
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG; /* clear eocCBATAdminSNMPCommunityPermission */
+ /*
+ * TODO:482:o: |-> commit column eocCBATAdminSNMPCommunityPermission.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATAdminSNMPCommunityPermission
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG; /* clear eocCBATAdminSNMPCommunityRowStatus */
+ /*
+ * TODO:482:o: |-> commit column eocCBATAdminSNMPCommunityRowStatus.
+ */
+ /*
+ * set flag, in case we need to undo eocCBATAdminSNMPCommunityRowStatus
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG;
+ }
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("verbose:eocVLANTable:eocVLANTable_commit",
+ "new row created!\n"));
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* check if deleting unvalidated row */
+ /* a row can be unvalidated either before being added to
+ * configuration file, or to mark invalid line in
+ * configuration file */
+ if ((rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_commit", "deleting unvalidated row!\n"));
+ /* convert index to string to serve as key for possible
+ * removing of invalid line */
+
+ strcpy (old_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ strcpy (old_sec_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_community_line (old_comm_name,
+ old_sec_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_remove_community_line error\n");
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_security_line (old_sec_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_remove_security_line error\n");
+ }
+ return MFD_SUCCESS;
+ }
+
+ strcpy (old_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ strcpy (old_sec_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+
+ /* remove comm name from internal storage list */
+ if (NULL != se_find_slist ("eoc_comm_list"))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit:",
+ "trying to remove comm name from slist: %s\n",
+ old_comm_name));
+
+ ret = se_remove_label_from_slist ("eoc_comm_list",
+ old_comm_name);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR,
+ "Error! comm name not found in the table!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Trying to delete from empty comm name list!\n");
+ return MFD_ERROR;
+ }
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_community_line (old_comm_name,
+ old_sec_name,
+ curr_comm_num + 1))
+ {
+ snmp_log (LOG_ERR,
+ "libspid_eoc_remove_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_security_line (old_sec_name,
+ curr_comm_num + 1))
+ {
+ snmp_log (LOG_ERR,
+ "libspid_eoc_remove_security_line error\n");
+ return MFD_ERROR;
+ }
+ curr_comm_num--;
+
+
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* this case covers modifying row status to active - ie.
+ * validating the row */
+ /* row can be either newly added from the agent,
+ * or having row status notInService to mark invalid line
+ * in configuration file */
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_commit", "validating row\n"));
+
+ strcpy (old_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission;
+
+ /* add comm name of validated row to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_comm_list");
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_comm_list",
+ strdup (new_comm_name), tmp);
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_community_line (old_comm_name, old_sec_name,
+ new_comm_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_security_line (old_sec_name, new_comm_name,
+ new_access, curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_security_line error\n");
+ return MFD_ERROR;
+ }
+ curr_comm_num++;
+ adding_snmpcommunity = 0;
+
+ }
+ }
+ else
+ {
+ /* this case covers modifying columns without modifying row status */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit",
+ "trying to change data for "
+ "community table community name:%s \n",
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity));
+ /* convert index to string to serve as key for line in
+ * configuration file */
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit",
+ "eocCBATAdminSNMPCommunity read from "
+ "rowreq context: %s\n",
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity));
+
+ /* copy community name to community entry */
+ strcpy (old_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission;
+
+ /* remove community name from internal storage list */
+ if (NULL != se_find_slist ("eoc_comm_list"))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit:",
+ "trying to remove comm name from slist: %s\n",
+ old_comm_name));
+
+ ret = se_remove_label_from_slist ("eoc_comm_list",
+ old_comm_name);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! comm name not found"
+ " in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty"
+ " comm name internal storage list!\n");
+ return MFD_ERROR;
+ }
+
+ /* add new community name to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_comm_list");
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:",
+ "eocCBATAdminSNMPCommunityTable_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_comm_list",
+ strdup (new_comm_name), tmp);
+ }
+
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit",
+ "eocCBATAdminSNMPCommunityPermission "
+ "read from rowreq context: %ld\n",
+ rowreq_ctx->data->
+ eocCBATAdminSNMPCommunityPermission));
+ /* copy community name to community entry */
+ strcpy (old_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission;
+ }
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_community_line (old_comm_name, old_sec_name,
+ new_comm_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_security_line (old_sec_name, new_comm_name,
+ new_access, curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_security_line error\n");
+ return MFD_ERROR;
+ }
+
+ }
+ }
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags)
+ {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCBATAdminSNMPCommunityTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCBATAdminSNMPCommunityTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATAdminSNMPCommunityTable_undo_commit( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ char old_comm_name[32], old_sec_name[32];
+ char new_comm_name[32];
+ int new_access = 0;
+ int tmp;
+ int ret;
+
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo eocCBATAdminSNMPCommunityTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* when row is created and not validated, there is nothing to do */
+ if ((rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_commit", "removing unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* if a row was deleted, restore it */
+ /* if restoring unvalidated row, there is nothing to do */
+ if ((rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_commit", "restoring unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_undo_commit",
+ "service table index to undo: %s \n",
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity));
+
+ strcpy (old_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission;
+ /* clear flag for deletion */
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DELETED;
+
+ /* add comm name of validated row to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_comm_list");
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_comm_list",
+ strdup (new_comm_name), tmp);
+
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_community_line (old_comm_name, old_sec_name,
+ new_comm_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_security_line (old_sec_name, new_comm_name,
+ new_access, curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_security_line error\n");
+ return MFD_ERROR;
+ }
+
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_undo_commit", "removing newly validated row!\n"));
+ /* if a row was validated (its status set to active) revert
+ * its status to notInService */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus =
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus;
+ /* also remove row data from config file */
+ /* convert index to string to serve as key for removing line */
+
+ /* if a new row was added, remove line with given index from
+ * service configuration file */
+ if (1 == adding_snmpcommunity)
+ {
+
+ strcpy (old_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ strcpy (old_sec_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+
+ /* remove comm name from internal storage list */
+ if (NULL != se_find_slist ("eoc_comm_list"))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_undo_commit:", "trying to remove comm name from slist: %s\n", old_comm_name));
+
+ ret = se_remove_label_from_slist ("eoc_comm_list",
+ old_comm_name);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR,
+ "Error! comm name not found in the table!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Trying to delete from empty comm name list!\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_community_line (old_comm_name,
+ old_sec_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_remove_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_security_line (old_sec_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_remove_security_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* if undo has successfully passed, clear service adding
+ * indication */
+ adding_snmpcommunity = 0;
+ }
+ }
+ }
+ else
+ {
+ /* this case covers restoring modified columns
+ * (without row status modified) */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_undo_commit",
+ "undoing data for " "index: %ld \n",
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityIndex));
+
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_undo_commit",
+ "AdminSNMPCommunity name to "
+ "be restored: %s\n",
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity));
+ strcpy (old_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission;
+
+ /* remove comm name from internal storage list */
+ if (NULL != se_find_slist ("eoc_comm_list"))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit:",
+ "trying to remove comm name from slist: %s\n",
+ old_comm_name));
+
+ ret = se_remove_label_from_slist ("eoc_comm_list",
+ old_comm_name);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! comm name not found"
+ " in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty"
+ " comm name internal storage list!\n");
+ return MFD_ERROR;
+ }
+
+ /* add new IP address to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_comm_list");
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:",
+ "eocCBATAdminSNMPCommunityTable_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_comm_list",
+ strdup (new_comm_name), tmp);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_undo_commit",
+ "community permission to be restored: %ld\n",
+ rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityPermission));
+ /* copy service type to service entry */
+ strcpy (old_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission;
+ }
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_community_line (old_comm_name, old_sec_name,
+ new_comm_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_security_line (old_sec_name, new_comm_name,
+ new_access, curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_security_line error\n");
+ return MFD_ERROR;
+ }
+
+ }
+ }
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCBATAdminSNMPCommunityTable node value checks.
+ * TODO:450:M: Implement eocCBATAdminSNMPCommunityTable undo functions.
+ * TODO:460:M: Implement eocCBATAdminSNMPCommunityTable set functions.
+ * TODO:480:M: Implement eocCBATAdminSNMPCommunityTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunity
+ * eocCBATAdminSNMPCommunity is subid 2 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.2
+ * Description:
+SNMP¹²Í¬Ìå´®£¬×Ϊ16λ×Ö·û´®¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 16;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 16)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunity_val_ptr
+ * A char containing the new value.
+ * @param eocCBATAdminSNMPCommunity_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCBATAdminSNMPCommunity_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATAdminSNMPCommunityTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocCBATAdminSNMPCommunity).
+ * The length is in (one of) the range set(s): 1 - 16
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+
+char *Trim (char *str)
+{
+ char *head = str;
+ char *tail = str + strlen( str );
+
+ while(*head++ == ' ')
+ /* nothing here*/;
+
+ --head;
+
+ while(*(--tail) == ' ');
+ *(tail+1) = '\0';
+
+ return head;
+}
+
+int
+eocCBATAdminSNMPCommunity_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char *eocCBATAdminSNMPCommunity_val_ptr, size_t eocCBATAdminSNMPCommunity_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunity_check_value","called\n"));
+ int tmp;
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCBATAdminSNMPCommunity_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATAdminSNMPCommunity value.
+ */
+ eocCBATAdminSNMPCommunity_val_ptr[eocCBATAdminSNMPCommunity_val_ptr_len]
+ = '\0';
+ eocCBATAdminSNMPCommunity_val_ptr =
+ Trim (eocCBATAdminSNMPCommunity_val_ptr);
+ if (eocCBATAdminSNMPCommunity_val_ptr_len !=
+ strlen (eocCBATAdminSNMPCommunity_val_ptr))
+ return MFD_NOT_VALID_EVER;
+
+ /* check if proposed comm name already exists in internal storage list */
+ tmp =
+ se_find_value_in_slist ("eoc_comm_list",
+ eocCBATAdminSNMPCommunity_val_ptr);
+ if (tmp != SE_DNE)
+ {
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:",
+ "eocCBATAdminSNMPCommunity_check_value",
+ "comm name already exists!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* eocCBATAdminSNMPCommunity value not illegal */
+} /* eocCBATAdminSNMPCommunity_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATAdminSNMPCommunityTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATAdminSNMPCommunity_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunity_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATAdminSNMPCommunity undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunity and eocCBATAdminSNMPCommunity_len data
+ * set rowreq_ctx->undo->eocCBATAdminSNMPCommunity from rowreq_ctx->data.eocCBATAdminSNMPCommunity
+ */
+ memcpy( rowreq_ctx->undo->eocCBATAdminSNMPCommunity, rowreq_ctx->data->eocCBATAdminSNMPCommunity,
+ (rowreq_ctx->data->eocCBATAdminSNMPCommunity_len * sizeof(rowreq_ctx->undo->eocCBATAdminSNMPCommunity[0])));
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity_len = rowreq_ctx->data->eocCBATAdminSNMPCommunity_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunity_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATAdminSNMPCommunity_val_ptr
+ * A char containing the new value.
+ * @param eocCBATAdminSNMPCommunity_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCBATAdminSNMPCommunity_val_ptr
+ */
+int
+eocCBATAdminSNMPCommunity_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char *eocCBATAdminSNMPCommunity_val_ptr, size_t eocCBATAdminSNMPCommunity_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunity_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCBATAdminSNMPCommunity_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATAdminSNMPCommunity value.
+ * set eocCBATAdminSNMPCommunity value in rowreq_ctx->data
+ */
+ memset (rowreq_ctx->data->eocCBATAdminSNMPCommunity, 0, sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity));
+ memcpy (rowreq_ctx->data->eocCBATAdminSNMPCommunity, eocCBATAdminSNMPCommunity_val_ptr, eocCBATAdminSNMPCommunity_val_ptr_len );
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity_len = eocCBATAdminSNMPCommunity_val_ptr_len / sizeof(eocCBATAdminSNMPCommunity_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunity_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATAdminSNMPCommunity_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunity_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATAdminSNMPCommunity undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunity and eocCBATAdminSNMPCommunity_len data
+ * set rowreq_ctx->data.eocCBATAdminSNMPCommunity from rowreq_ctx->undo->eocCBATAdminSNMPCommunity
+ */
+ memcpy( rowreq_ctx->data->eocCBATAdminSNMPCommunity, rowreq_ctx->undo->eocCBATAdminSNMPCommunity,
+ (rowreq_ctx->undo->eocCBATAdminSNMPCommunity_len * sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity[0])));
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity_len = rowreq_ctx->undo->eocCBATAdminSNMPCommunity_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunity_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityPermission
+ * eocCBATAdminSNMPCommunityPermission is subid 3 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.3
+ * Description:
+SNMP¹²Í¬ÌåȨÏÞ£¬Ö»¶ÁȨÏÞΪro(1)£¬¶ÁдȨÏÞΪrw(2)
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: rw(1), ro(2), wo(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunityPermission_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATAdminSNMPCommunityTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of rw(1), ro(2), wo(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATAdminSNMPCommunityPermission_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityPermission_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityPermission_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATAdminSNMPCommunityPermission value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATAdminSNMPCommunityPermission value not illegal */
+} /* eocCBATAdminSNMPCommunityPermission_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATAdminSNMPCommunityTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATAdminSNMPCommunityPermission_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityPermission_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATAdminSNMPCommunityPermission undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunityPermission data
+ * set rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission from rowreq_ctx->data.eocCBATAdminSNMPCommunityPermission
+ */
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission = rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityPermission_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATAdminSNMPCommunityPermission_val
+ * A long containing the new value.
+ */
+int
+eocCBATAdminSNMPCommunityPermission_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityPermission_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityPermission_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATAdminSNMPCommunityPermission value.
+ * set eocCBATAdminSNMPCommunityPermission value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission = eocCBATAdminSNMPCommunityPermission_val;
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityPermission_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATAdminSNMPCommunityPermission_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityPermission_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATAdminSNMPCommunityPermission undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunityPermission data
+ * set rowreq_ctx->data.eocCBATAdminSNMPCommunityPermission from rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission
+ */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission = rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityPermission_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityRowStatus
+ * eocCBATAdminSNMPCommunityRowStatus is subid 4 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.4
+ * Description:
+ÐÐ״̬¡£Ö»Ê¹ÓÃÁ½Ïî
+ 4-createAndGo
+ 6-distory
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunityRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATAdminSNMPCommunityTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATAdminSNMPCommunityRowStatus_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityRowStatus_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATAdminSNMPCommunityRowStatus value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATAdminSNMPCommunityRowStatus value not illegal */
+} /* eocCBATAdminSNMPCommunityRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATAdminSNMPCommunityTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATAdminSNMPCommunityRowStatus_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityRowStatus_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATAdminSNMPCommunityRowStatus undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunityRowStatus data
+ * set rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus from rowreq_ctx->data.eocCBATAdminSNMPCommunityRowStatus
+ */
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus = rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATAdminSNMPCommunityRowStatus_val
+ * A long containing the new value.
+ */
+int
+eocCBATAdminSNMPCommunityRowStatus_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityRowStatus_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityRowStatus_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (eocCBATAdminSNMPCommunityRowStatus_val == ROWSTATUS_CREATEANDWAIT &&
+ rowreq_ctx->tbl_idx.eocCBATAdminSNMPCommunityIndex != curr_comm_num)
+ return MFD_NOT_VALID_EVER;
+
+ /*
+ * TODO:461:M: |-> Set eocCBATAdminSNMPCommunityRowStatus value.
+ * set eocCBATAdminSNMPCommunityRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus = eocCBATAdminSNMPCommunityRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATAdminSNMPCommunityRowStatus_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityRowStatus_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATAdminSNMPCommunityRowStatus undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunityRowStatus data
+ * set rowreq_ctx->data.eocCBATAdminSNMPCommunityRowStatus from rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus
+ */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus = rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityRowStatus_undo */
+
+/** @} */
+
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocVLANTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-eocVLANTable if you don't have dependencies)
+ */
+int
+eocCBATAdminSNMPCommunityTable_check_dependencies (
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check eocVLANTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+ {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition (rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityRowStatus,
+ rowreq_ctx->data->
+ eocCBATAdminSNMPCommunityRowStatus);
+
+ if (MFD_SUCCESS != rc)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable",
+ "row status transition from %d to " "%d\n",
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus,
+ rowreq_ctx->data->
+ eocCBATAdminSNMPCommunityRowStatus));
+ return rc;
+ }
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* this case permits creating row with rowstatus 'destroy' -
+ * row is created and immediately deleted */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ }
+ else if (ROWSTATUS_CREATEANDWAIT ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* set row adding indication */
+ adding_snmpcommunity = 1;
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ } /* row creation */
+ else
+ {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ if (rowreq_ctx->column_set_flags &
+ ~COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable",
+ "destroy must be only "
+ "varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ else if (ROWSTATUS_NOTINSERVICE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* do not permit invalidating once validated row */
+ if (rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityRowStatus & ROWSTATUS_ACTIVE)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable",
+ "Row status can't be changed "
+ "from Active to Not In Service!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* before setting row to active, check that all columns are filled */
+ if ((rowreq_ctx->column_exists_flags &
+ EOCCBATADMINSNMPCOMMUNITYTABLE_REQUIRED_COLS) !=
+ EOCCBATADMINSNMPCOMMUNITYTABLE_REQUIRED_COLS)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable",
+ "required columns from "
+ "modEoCCNU table missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_exists_flags,
+ EOCCBATADMINSNMPCOMMUNITYTABLE_REQUIRED_COLS));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus =
+ ROWSTATUS_ACTIVE;
+ }
+ } /* row change */
+ }
+ else
+ {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* eocVLANTable_check_dependencies */
+
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.h
new file mode 100644
index 0000000000..5e2b5a2fe4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.h
@@ -0,0 +1,65 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_SET_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+
+
+int eocCBATAdminSNMPCommunityTable_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+int eocCBATAdminSNMPCommunityTable_undo_cleanup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+int eocCBATAdminSNMPCommunityTable_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+int eocCBATAdminSNMPCommunityTable_commit( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+int eocCBATAdminSNMPCommunityTable_undo_commit( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCBATAdminSNMPCommunity_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char *eocCBATAdminSNMPCommunity_val_ptr, size_t eocCBATAdminSNMPCommunity_val_ptr_len);
+int eocCBATAdminSNMPCommunity_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+int eocCBATAdminSNMPCommunity_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char *eocCBATAdminSNMPCommunity_val_ptr, size_t eocCBATAdminSNMPCommunity_val_ptr_len );
+int eocCBATAdminSNMPCommunity_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATAdminSNMPCommunityPermission_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityPermission_val);
+int eocCBATAdminSNMPCommunityPermission_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+int eocCBATAdminSNMPCommunityPermission_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityPermission_val );
+int eocCBATAdminSNMPCommunityPermission_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATAdminSNMPCommunityRowStatus_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityRowStatus_val);
+int eocCBATAdminSNMPCommunityRowStatus_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+int eocCBATAdminSNMPCommunityRowStatus_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityRowStatus_val );
+int eocCBATAdminSNMPCommunityRowStatus_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCBATAdminSNMPCommunityTable_check_dependencies(eocCBATAdminSNMPCommunityTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_enums.h
new file mode 100644
index 0000000000..234c68272a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_enums.h
@@ -0,0 +1,77 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_ENUMS_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCBATAdminSNMPCommunityTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCBATAdminSNMPCommunityPermission (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYPERMISSION_ENUMS
+#define EOCCBATADMINSNMPCOMMUNITYPERMISSION_ENUMS
+
+#define EOCCBATADMINSNMPCOMMUNITYPERMISSION_RW 1
+#define EOCCBATADMINSNMPCOMMUNITYPERMISSION_RO 2
+#define EOCCBATADMINSNMPCOMMUNITYPERMISSION_WO 3
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYPERMISSION_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCBATAdminSNMPCommunityRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.c
new file mode 100644
index 0000000000..50f59512ef
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.c
@@ -0,0 +1,1910 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCBATAdminSNMPCommunityTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+typedef struct eocCBATAdminSNMPCommunityTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCBATAdminSNMPCommunityTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCBATAdminSNMPCommunityTable_interface_ctx;
+
+static eocCBATAdminSNMPCommunityTable_interface_ctx eocCBATAdminSNMPCommunityTable_if_ctx;
+
+static void _eocCBATAdminSNMPCommunityTable_container_init(
+ eocCBATAdminSNMPCommunityTable_interface_ctx *if_ctx);
+static void _eocCBATAdminSNMPCommunityTable_container_shutdown(
+ eocCBATAdminSNMPCommunityTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCBATAdminSNMPCommunityTable_container_get( void )
+{
+ return eocCBATAdminSNMPCommunityTable_if_ctx.container;
+}
+
+eocCBATAdminSNMPCommunityTable_registration *
+eocCBATAdminSNMPCommunityTable_registration_get( void )
+{
+ return eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx;
+}
+
+eocCBATAdminSNMPCommunityTable_registration *
+eocCBATAdminSNMPCommunityTable_registration_set( eocCBATAdminSNMPCommunityTable_registration * newreg )
+{
+ eocCBATAdminSNMPCommunityTable_registration * old = eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx;
+ eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCBATAdminSNMPCommunityTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCBATAdminSNMPCommunityTable_if_ctx.container);
+}
+
+u_int
+eocCBATAdminSNMPCommunityTable_dirty_get( void )
+{
+ return eocCBATAdminSNMPCommunityTable_if_ctx.table_dirty;
+}
+
+void
+eocCBATAdminSNMPCommunityTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCBATAdminSNMPCommunityTable_if_ctx.table_dirty, status));
+ eocCBATAdminSNMPCommunityTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_irreversible_commit;
+static Netsnmp_Node_Handler
+ _mfd_eocCBATAdminSNMPCommunityTable_check_dependencies;
+
+
+NETSNMP_STATIC_INLINE int _eocCBATAdminSNMPCommunityTable_undo_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+NETSNMP_STATIC_INLINE int _eocCBATAdminSNMPCommunityTable_check_indexes(eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx);
+
+
+/**
+ * @internal
+ * Initialize the table eocCBATAdminSNMPCommunityTable
+ * (Define its contents and how it's structured)
+ */
+
+void
+adminsnmpcommunity_container_init (void)
+{
+ static int done = 0;
+
+ if (done)
+ return;
+
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:"
+ "adminsnmpcommunity_container_init", "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container
+ */
+ _eocCBATAdminSNMPCommunityTable_container_init (
+ &eocCBATAdminSNMPCommunityTable_if_ctx);
+}
+
+
+void
+_eocCBATAdminSNMPCommunityTable_initialize_interface(eocCBATAdminSNMPCommunityTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCBATAdminSNMPCommunityTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCBATAdminSNMPCommunityTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_initialize_interface","called\n"));
+
+ (void) adminsnmpcommunity_container_init ();
+ if (NULL == eocCBATAdminSNMPCommunityTable_if_ctx.container)
+ return; /* msg already logged */
+
+ /*************************************************
+ *
+ * save interface context for eocCBATAdminSNMPCommunityTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCBATAdminSNMPCommunityIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCBATADMINSNMPCOMMUNITYTABLE_MIN_COL;
+ tbl_info->max_column = EOCCBATADMINSNMPCOMMUNITYTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCBATAdminSNMPCommunityTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCBATAdminSNMPCommunityTable_container_init(&eocCBATAdminSNMPCommunityTable_if_ctx);
+ if (NULL == eocCBATAdminSNMPCommunityTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCBATAdminSNMPCommunityTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCBATAdminSNMPCommunityTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCBATAdminSNMPCommunityTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCBATAdminSNMPCommunityTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCBATAdminSNMPCommunityTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocCBATAdminSNMPCommunityTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCBATAdminSNMPCommunityTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCBATAdminSNMPCommunityTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCBATAdminSNMPCommunityTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCBATAdminSNMPCommunityTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCBATAdminSNMPCommunityTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCBATAdminSNMPCommunityTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCBATAdminSNMPCommunityTable_irreversible_commit;
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_eocCBATAdminSNMPCommunityTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:init_eocCBATAdminSNMPCommunityTable",
+ "Registering eocCBATAdminSNMPCommunityTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCBATAdminSNMPCommunityTable", handler,
+ eocCBATAdminSNMPCommunityTable_oid,
+ eocCBATAdminSNMPCommunityTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCBATAdminSNMPCommunityTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCBATAdminSNMPCommunityTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCBATAdminSNMPCommunityTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCBATAdminSNMPCommunityTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCBATAdminSNMPCommunityTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCBATAdminSNMPCommunityTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCBATAdminSNMPCommunityTable
+ */
+void
+_eocCBATAdminSNMPCommunityTable_shutdown_interface(eocCBATAdminSNMPCommunityTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCBATAdminSNMPCommunityTable_container_shutdown(&eocCBATAdminSNMPCommunityTable_if_ctx);
+}
+
+void
+eocCBATAdminSNMPCommunityTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCBATAdminSNMPCommunityTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCBATAdminSNMPCommunityTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCBATAdminSNMPCommunityTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCBATAdminSNMPCommunityTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCBATAdminSNMPCommunityIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCBATAdminSNMPCommunityIndex, 0x00, sizeof(var_eocCBATAdminSNMPCommunityIndex) );
+ var_eocCBATAdminSNMPCommunityIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCBATAdminSNMPCommunityIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_index_to_oid","called\n"));
+
+ /* eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCBATAdminSNMPCommunityIndex, (u_char*)&mib_idx->eocCBATAdminSNMPCommunityIndex,
+ sizeof(mib_idx->eocCBATAdminSNMPCommunityIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCBATAdminSNMPCommunityIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCBATAdminSNMPCommunityIndex );
+
+ return err;
+} /* eocCBATAdminSNMPCommunityTable_index_to_oid */
+
+/**
+ * extract eocCBATAdminSNMPCommunityTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCBATAdminSNMPCommunityTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCBATAdminSNMPCommunityTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCBATAdminSNMPCommunityIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCBATAdminSNMPCommunityIndex, 0x00, sizeof(var_eocCBATAdminSNMPCommunityIndex) );
+ var_eocCBATAdminSNMPCommunityIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCBATAdminSNMPCommunityIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCBATAdminSNMPCommunityIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocCBATAdminSNMPCommunityIndex = *((long *)var_eocCBATAdminSNMPCommunityIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCBATAdminSNMPCommunityIndex );
+
+ return err;
+} /* eocCBATAdminSNMPCommunityTable_index_from_oid */
+
+
+/*
+ * eocCBATAdminSNMPCommunityTable_allocate_data
+ *
+ * Purpose: create new eocCBATAdminSNMPCommunityTable_data.
+ */
+eocCBATAdminSNMPCommunityTable_data *
+eocCBATAdminSNMPCommunityTable_allocate_data(void)
+{
+ eocCBATAdminSNMPCommunityTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCBATAdminSNMPCommunityTable_data);
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocCBATAdminSNMPCommunityTable_data.\n");
+ }
+ else
+ {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->st_index;
+ }
+ return rtn;
+} /* eocCBATAdminSNMPCommunityTable_allocate_data */
+
+/*
+ * eocCBATAdminSNMPCommunityTable_release_data
+ *
+ * Purpose: release eocCBATAdminSNMPCommunityTable data.
+ */
+void
+eocCBATAdminSNMPCommunityTable_release_data(eocCBATAdminSNMPCommunityTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_release_data","called\n"));
+
+ if (NULL == data)
+ return;
+ free(data);
+} /* eocCBATAdminSNMPCommunityTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCBATAdminSNMPCommunityTable_rowreq_ctx
+ */
+eocCBATAdminSNMPCommunityTable_rowreq_ctx *
+eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx (
+ eocCBATAdminSNMPCommunityTable_data * data,
+ void *user_init_ctx)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCBATAdminSNMPCommunityTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocCBATAdminSNMPCommunityTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ else
+ {
+ if (NULL != data)
+ {
+ /*
+ * track if we got data from user
+ */
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:"
+ "eocCBATAdminSNMPCommunityTable_allocate"
+ "_rowreq_ctx", "data got from user\n"));
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+
+ /* TEMP: maybe set column_exists_flags somewhere else? */
+ /* TODO: check if index flag can be set here? */
+
+ if (NULL == rowreq_ctx->data->eocCBATAdminSNMPCommunity)
+ {
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_allocate"
+ "_rowreq_ctx", "config file index invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG;
+ }
+
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG;
+
+ /* Row Status flag set to existing for allocation purposes */
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG;
+ }
+ else if (NULL == (rowreq_ctx->data = eocCBATAdminSNMPCommunityTable_allocate_data ()))
+ {
+ SNMP_FREE (rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCBATAdminSNMPCommunityTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCBATAdminSNMPCommunityTable_rowreq_ctx
+ */
+void
+eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if ((rowreq_ctx->data) && !(rowreq_ctx->rowreq_flags
+ & MFD_ROW_DATA_FROM_USER))
+ {
+ eocCBATAdminSNMPCommunityTable_release_data (rowreq_ctx->data);
+ }
+
+ if(rowreq_ctx->undo)
+ eocCBATAdminSNMPCommunityTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCBATAdminSNMPCommunityTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATAdminSNMPCommunityTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCBATAdminSNMPCommunityTable_pre_request(eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable","error %d from "
+ "eocCBATAdminSNMPCommunityTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATAdminSNMPCommunityTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCBATAdminSNMPCommunityTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCBATAdminSNMPCommunityTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCBATAdminSNMPCommunityTable_post_request(eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable","error %d from "
+ "eocCBATAdminSNMPCommunityTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static eocCBATAdminSNMPCommunityTable_rowreq_ctx *
+_mfd_eocCBATAdminSNMPCommunityTable_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx;
+ eocCBATAdminSNMPCommunityTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_rowreq_from_index",
+ "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = eocCBATAdminSNMPCommunityTable_index_from_oid(oid_idx, &mib_idx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("eocCBATAdminSNMPCommunityTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx (NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _eocCBATAdminSNMPCommunityTable_check_indexes(rowreq_ctx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids, oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATAdminSNMPCommunityTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCBATAdminSNMPCommunityTable_interface_ctx *if_ctx =
+ * (eocCBATAdminSNMPCommunityTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if(NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx = _mfd_eocCBATAdminSNMPCommunityTable_rowreq_from_index(&oid_idx, &rc);
+ if(MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index*)rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCBATAdminSNMPCommunityTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCBATAdminSNMPCommunityTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_get_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITY:
+ if (! (COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_column",
+ "column %d (eocCBATAdminSNMPCommunity) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+rc = eocCBATAdminSNMPCommunity_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION:
+ if (! (COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_column",
+ "column %d (eocCBATAdminSNMPCommunityPermission) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCBATAdminSNMPCommunityPermission_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS:
+ if (! (COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_column",
+ "column %d (eocCBATAdminSNMPCommunityRowStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCBATAdminSNMPCommunityRowStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCBATADMINSNMPCOMMUNITYTABLE_MIN_COL <= column && column <= EOCCBATADMINSNMPCOMMUNITYTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCBATAdminSNMPCommunityTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCBATAdminSNMPCommunityTable_get_column */
+
+int
+_mfd_eocCBATAdminSNMPCommunityTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_values",
+ "exists %p\n", (void*)rowreq_ctx->column_exists_flags));
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATAdminSNMPCommunityTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_check_indexes(eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_check_indexes","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /* (INDEX) eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = eocCBATAdminSNMPCommunityIndex_check_index( rowreq_ctx );
+ if(MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return eocCBATAdminSNMPCommunityTable_validate_index( eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx, rowreq_ctx );
+} /* _eocCBATAdminSNMPCommunityTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_check_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITY:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data->eocCBATAdminSNMPCommunity ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 1) || (var->val_len > 16))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_check_column:eocCBATAdminSNMPCommunity",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATAdminSNMPCommunity_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATAdminSNMPCommunity_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCBATADMINSNMPCOMMUNITYPERMISSION_RW )
+ && ( *var->val.integer != EOCCBATADMINSNMPCOMMUNITYPERMISSION_RO )
+ && ( *var->val.integer != EOCCBATADMINSNMPCOMMUNITYPERMISSION_WO )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_check_column:eocCBATAdminSNMPCommunityPermission",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATAdminSNMPCommunityPermission_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATAdminSNMPCommunityPermission_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS:
+rc = netsnmp_check_vb_rowstatus_value(var);
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_check_column:eocCBATAdminSNMPCommunityRowStatus",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATAdminSNMPCommunityRowStatus_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATAdminSNMPCommunityRowStatus_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCBATAdminSNMPCommunityTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCBATAdminSNMPCommunityTable_check_column */
+
+int
+_mfd_eocCBATAdminSNMPCommunityTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATAdminSNMPCommunityTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_check_objects */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_eocCBATAdminSNMPCommunityTable_check_dependencies (
+ netsnmp_mib_handler * handler,
+ netsnmp_handler_registration * reginfo,
+ netsnmp_agent_request_info *
+ agtreq_info,
+ netsnmp_request_info * requests)
+{
+ int rc;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract (requests);
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:"
+ "mfd_eocCBATAdminSNMPCommunityTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ rc = eocCBATAdminSNMPCommunityTable_check_dependencies (rowreq_ctx);
+ if (rc)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable:mfd", "error %d from "
+ "eocCBATAdminSNMPCommunityTable_check_dependencies\n",
+ rc));
+ netsnmp_request_set_error_all (requests, SNMP_VALIDATE_ERR (rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_check_dependencies */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_undo_setup_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITY:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG;
+ rc = eocCBATAdminSNMPCommunity_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG;
+ rc = eocCBATAdminSNMPCommunityPermission_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG;
+ rc = eocCBATAdminSNMPCommunityRowStatus_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATAdminSNMPCommunityTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCBATAdminSNMPCommunityTable_undo_setup_column */
+
+
+/* TODO: check if this is really necessary? */
+int
+_mfd_eocCBATAdminSNMPCommunity_undo_setup_allocate (eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ if (NULL == rowreq_ctx)
+ return MFD_ERROR;
+
+ /*
+ * other tables share our container/context and call
+ * this function. so we need to check and see if
+ * someone else already allocated data
+ */
+ if (NULL == rowreq_ctx->undo)
+ {
+ rowreq_ctx->undo = eocCBATAdminSNMPCommunityTable_allocate_data ();
+ if (NULL == rowreq_ctx->undo)
+ {
+ /** msg already logged */
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ else
+ {
+ /* TODO: check if something should be done here? */
+ }
+ }
+ ++rowreq_ctx->undo_ref_count;
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo_setup_allocate",
+ "++undo_refcount = %d\n",rowreq_ctx->undo_ref_count));
+
+ return rc;
+}
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCBATAdminSNMPCommunityTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCBATAdminSNMPCommunityTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCBATAdminSNMPCommunityTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATAdminSNMPCommunityTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_undo_setup */
+
+
+void
+_mfd_eocCBATAdminSNMPCommunityTable_undo_setup_release (eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo"
+ "_setup_release", "called\n"));
+
+ netsnmp_assert (rowreq_ctx->undo_ref_count > 0);
+ --rowreq_ctx->undo_ref_count;
+ snmp_log (LOG_ERR, "undo_refcount at %d\n", rowreq_ctx->undo_ref_count);
+
+ if (0 == rowreq_ctx->undo_ref_count)
+ {
+ eocCBATAdminSNMPCommunityTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCBATAdminSNMPCommunityTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCBATAdminSNMPCommunityTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_eocCBATAdminSNMPCommunityTable_undo_setup_release (rowreq_ctx);
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_set_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITY:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG;
+ rc = eocCBATAdminSNMPCommunity_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG;
+ rc = eocCBATAdminSNMPCommunityPermission_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG;
+ rc = eocCBATAdminSNMPCommunityRowStatus_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATAdminSNMPCommunityTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCBATAdminSNMPCommunityTable_set_column */
+
+int
+_mfd_eocCBATAdminSNMPCommunityTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATAdminSNMPCommunityTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCBATAdminSNMPCommunityTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCBATAdminSNMPCommunityTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCBATAdminSNMPCommunityTable_dirty_set( eocCBATAdminSNMPCommunityTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCBATAdminSNMPCommunityTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCBATAdminSNMPCommunityTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCBATAdminSNMPCommunityTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCBATAdminSNMPCommunityTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCBATAdminSNMPCommunityTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_undo_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITY:
+ rc = eocCBATAdminSNMPCommunity_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION:
+ rc = eocCBATAdminSNMPCommunityPermission_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS:
+ rc = eocCBATAdminSNMPCommunityRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATAdminSNMPCommunityTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCBATAdminSNMPCommunityTable_undo_column */
+
+int
+_mfd_eocCBATAdminSNMPCommunityTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCBATAdminSNMPCommunityTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATAdminSNMPCommunityTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCBATAdminSNMPCommunityTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCBATAdminSNMPCommunityTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_irreversible_commit",
+ "updating exists (%p) w/set (%p) = %p\n",
+ rowreq_ctx->column_exists_flags,
+ rowreq_ctx->column_set_flags,
+ (rowreq_ctx->column_exists_flags |
+ rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(eocCBATAdminSNMPCommunityTable_if_ctx.container, rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load (netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic))
+ {
+ snmp_log (LOG_ERR,
+ "invalid cache for \
+ eocCBATAdminSNMPCommunityTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert ((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ if (adding_snmpcommunity)
+ {
+ snmp_log (LOG_ERR, "skipping eocCBATAdminSNMPCommunityTable_cache_load, row adding "
+ "in progress\n");
+ return SNMP_ERR_NOERROR;
+ }
+ else
+ {
+ return eocCBATAdminSNMPCommunityTable_container_load (
+ (netsnmp_container *) cache->magic);
+ }
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCBATAdminSNMPCommunityTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ if (!adding_snmpcommunity)
+ {
+ _container_free (container);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "skipping eocCBATAdminSNMPCommunityTable_cache_free, row adding "
+ "in progress\n");
+ }
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_container_item_free","called\n"));
+ int ret;
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ if(NULL == rowreq_ctx)
+ return;
+
+ strcpy (key_buffer, rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+
+ /* remove new comm name of current item from internal storage list */
+ if (NULL != se_find_slist ("eoc_comm_list"))
+ {
+ ret = se_remove_label_from_slist ("eoc_comm_list", key_buffer);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! comm name not found in the table!\n");
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty comm name list!\n");
+ }
+
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(rowreq_ctx);
+
+
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCBATAdminSNMPCommunityTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCBATAdminSNMPCommunityTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCBATAdminSNMPCommunityTable_container_init(eocCBATAdminSNMPCommunityTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCBATAdminSNMPCommunityTable_oid,
+ eocCBATAdminSNMPCommunityTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCBATAdminSNMPCommunityTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCBATAdminSNMPCommunityTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCBATAdminSNMPCommunityTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCBATAdminSNMPCommunityTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCBATAdminSNMPCommunityTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCBATAdminSNMPCommunityTable_container_shutdown(eocCBATAdminSNMPCommunityTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_container_shutdown","called\n"));
+
+ eocCBATAdminSNMPCommunityTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCBATAdminSNMPCommunityTable_container_shutdown */
+
+
+eocCBATAdminSNMPCommunityTable_rowreq_ctx *
+eocCBATAdminSNMPCommunityTable_row_find_by_mib_index(eocCBATAdminSNMPCommunityTable_mib_index *mib_idx)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCBATAdminSNMPCommunityTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCBATAdminSNMPCommunityTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.h
new file mode 100644
index 0000000000..fd6bbcfae7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.h
@@ -0,0 +1,89 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_INTERFACE_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCBATAdminSNMPCommunityTable_initialize_interface(eocCBATAdminSNMPCommunityTable_registration * user_ctx,
+ u_long flags);
+void _eocCBATAdminSNMPCommunityTable_shutdown_interface(eocCBATAdminSNMPCommunityTable_registration * user_ctx);
+
+eocCBATAdminSNMPCommunityTable_registration *
+eocCBATAdminSNMPCommunityTable_registration_get( void );
+
+eocCBATAdminSNMPCommunityTable_registration *
+eocCBATAdminSNMPCommunityTable_registration_set( eocCBATAdminSNMPCommunityTable_registration * newreg );
+
+netsnmp_container *eocCBATAdminSNMPCommunityTable_container_get( void );
+int eocCBATAdminSNMPCommunityTable_container_size( void );
+
+u_int eocCBATAdminSNMPCommunityTable_dirty_get( void );
+void eocCBATAdminSNMPCommunityTable_dirty_set( u_int status );
+
+eocCBATAdminSNMPCommunityTable_data *
+eocCBATAdminSNMPCommunityTable_allocate_data (void);
+eocCBATAdminSNMPCommunityTable_rowreq_ctx * eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx(eocCBATAdminSNMPCommunityTable_data *,void *);
+void eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+
+int eocCBATAdminSNMPCommunityTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCBATAdminSNMPCommunityTable_mib_index *mib_idx);
+int eocCBATAdminSNMPCommunityTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCBATAdminSNMPCommunityTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCBATAdminSNMPCommunityTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_oids.h
new file mode 100644
index 0000000000..395528ff72
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_oids.h
@@ -0,0 +1,54 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_OIDS_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* OID definition for scalar added to table eocCBATAdminSNMPCommunityTable */
+#define EOCCBATADMINSNMPCOMMUNITYTABLENEXTINDEX_OID 1,3,6,1,4,1,17409,2,4,1,4,3
+
+/* column number definitions for table eocCBATAdminSNMPCommunityTable */
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_OID 1,3,6,1,4,1,17409,2,4,1,4,4
+
+
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITYINDEX 1
+
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITY 2
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG (0x1 << 1)
+
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION 3
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG (0x1 << 2)
+
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS 4
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG (0x1 << 3)
+
+
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_MIN_COL COLUMN_EOCCBATADMINSNMPCOMMUNITY
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_MAX_COL COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review EOCCBATADMINSNMPCOMMUNITYTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_SETTABLE_COLS (COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG | COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG | COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review EOCCBATADMINSNMPCOMMUNITYTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_REQUIRED_COLS (COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG | COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG | COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.c
new file mode 100644
index 0000000000..e334621875
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.c
@@ -0,0 +1,96 @@
+/*
+ * 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 "eocCBATSNMPSettingGroup.h"
+
+/** Initializes the eocCBATSNMPSettingGroup module */
+void
+init_eocCBATSNMPSettingGroup(void)
+{
+ static oid eocCBATAdminVarBindings_oid[] = { 1,3,6,1,4,1,17409,2,4,1,4,1 };
+ static oid eocCBATAdminSNMPVersion_oid[] = { 1,3,6,1,4,1,17409,2,4,1,4,2 };
+
+ DEBUGMSGTL(("eocCBATSNMPSettingGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminVarBindings", handle_eocCBATAdminVarBindings,
+ eocCBATAdminVarBindings_oid, OID_LENGTH(eocCBATAdminVarBindings_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminSNMPVersion", handle_eocCBATAdminSNMPVersion,
+ eocCBATAdminSNMPVersion_oid, OID_LENGTH(eocCBATAdminSNMPVersion_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocCBATAdminVarBindings(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int bind_num = EOCCBATADMIN_VARBINDINGS_MAX_NB;
+ /* 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 *)&bind_num,
+ sizeof (bind_num));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in "
+ "handle_eocCBATAdminVarBindings\n", reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCBATAdminSNMPVersion(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /* 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. */
+
+ admin_cbat_snmp_version_t snmp_version = ADMIN_CBAT_SNMP_V2;
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *)&snmp_version,
+ sizeof (snmp_version));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in "
+ "handle_eocCBATAdminSNMPVersion\n", reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.h
new file mode 100644
index 0000000000..a9cbc40162
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.h
@@ -0,0 +1,18 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATSNMPSETTINGGROUP_H
+#define EOCCBATSNMPSETTINGGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+/* function declarations */
+void init_eocCBATSNMPSettingGroup(void);
+Netsnmp_Node_Handler handle_eocCBATAdminVarBindings;
+Netsnmp_Node_Handler handle_eocCBATAdminSNMPVersion;
+Netsnmp_Node_Handler handle_eocCBATAdminSNMPCommunityTableNextIndex;
+
+#endif /* EOCCBATSNMPSETTINGGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects.h
new file mode 100644
index 0000000000..ce35500433
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects.h
new file mode 100644
index 0000000000..1451a5f19e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.c
new file mode 100644
index 0000000000..8bac5275c3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.c
@@ -0,0 +1,73 @@
+/*
+ * 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 "eocCbatExtendGlobalObjects.h"
+
+/** Initializes the eocCbatExtendGlobalObjects module */
+void
+init_eocCbatExtendGlobalObjects(void)
+{
+ static oid eocCbatUplinkOnuMacAddress_oid[] = { 1,3,6,1,4,1,17409,2,4,1,100,1,1 };
+
+ DEBUGMSGTL(("eocCbatExtendGlobalObjects", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCbatUplinkOnuMacAddress", handle_eocCbatUplinkOnuMacAddress,
+ eocCbatUplinkOnuMacAddress_oid, OID_LENGTH(eocCbatUplinkOnuMacAddress_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocCbatUplinkOnuMacAddress(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /* 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. */
+ int ret;
+ char admin_mac_addr[LIBSPID_MAC_BIN_LEN];
+ char buffer[LIBSPID_CONFIG_KEY_MAX_LEN];
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ memset (admin_mac_addr, 0, sizeof (admin_mac_addr));
+
+ ret = libspid_config_read_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ONU_MAC,
+ buffer,
+ LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ }
+ else
+ {
+ libspid_mac_str_to_bin (buffer, admin_mac_addr);
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *)admin_mac_addr,
+ sizeof (admin_mac_addr));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCbatUplinkOnuMacAddress\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.h
new file mode 100644
index 0000000000..fce9b00e38
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.h
@@ -0,0 +1,14 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATEXTENDGLOBALOBJECTS_H
+#define EOCCBATEXTENDGLOBALOBJECTS_H
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCbatExtendGlobalObjects(void);
+Netsnmp_Node_Handler handle_eocCbatUplinkOnuMacAddress;
+
+#endif /* EOCCBATEXTENDGLOBALOBJECTS_H */