summaryrefslogtreecommitdiff
path: root/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c')
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c273
1 files changed, 273 insertions, 0 deletions
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;
+}
+/** @{ */