summaryrefslogtreecommitdiff
path: root/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.c
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.c')
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.c794
1 files changed, 794 insertions, 0 deletions
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.c
new file mode 100644
index 0000000000..282b237384
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.c
@@ -0,0 +1,794 @@
+/*
+ * 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 "modEoCCLTMACVlanTable.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 modEoCCLTMACVlanTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanTable is subid 1 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1, length: 11
+ */
+ /*
+ * 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
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | 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
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * 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
+ * modEoCCLTMACVlanTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCCLTMACVlanTable_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 (modEoCCLTMACVlanTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCLTMACVlanTable_undo_setup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCCLTMACVlanTable undo.
+ * set up modEoCCLTMACVlanTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCCLTMACAdminVlanID_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACVlanTable_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 (modEoCCLTMACVlanTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCLTMACVlanTable_undo(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCCLTMACVlanTable undo.
+ * modEoCCLTMACVlanTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCCLTMACAdminVlanID_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACVlanTable_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 (modEoCCLTMACVlanTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACVlanTable_undo_cleanup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCCLTMACVlanTable undo.
+ * Undo storage is in (* modEoCCLTMACAdminVlanID_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACVlanTable_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
+ * modEoCCLTMACVlanTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCLTMACVlanTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACVlanTable_commit(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCCLTMACVlanTable 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.
+ */
+ if (save_flags & COLUMN_MODEOCCLTMACVLANEN_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTMACVLANEN_FLAG; /* clear modEoCCLTMACVlanEN */
+ /*
+ * set flag, in case we need to undo modEoCCLTMACVlanEN
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCLTMACVLANEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCLTMACADMINVLANID_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTMACADMINVLANID_FLAG; /* clear modEoCCLTMACAdminVlanID */
+ /*
+ * set flag, in case we need to undo modEoCCLTMACAdminVlanID
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACADMINVLANID_FLAG;
+ }
+
+ /*
+ * 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;
+} /* modEoCCLTMACVlanTable_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
+ * modEoCCLTMACVlanTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCLTMACVlanTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACVlanTable_undo_commit(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo modEoCCLTMACVlanTable 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 we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCCLTMACVlanTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCCLTMACVlanTable node value checks.
+ * TODO:450:M: Implement modEoCCLTMACVlanTable undo functions.
+ * TODO:460:M: Implement modEoCCLTMACVlanTable set functions.
+ * TODO:480:M: Implement modEoCCLTMACVlanTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanEntry.modEoCCLTMACVlanEN
+ * modEoCCLTMACVlanEN is subid 2 of modEoCCLTMACVlanEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * 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 modEoCCLTMACVlanEN_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
+ * modEoCCLTMACVlanTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTMACVlanEN_check_value(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx, u_long modEoCCLTMACVlanEN_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTMACVlanEN value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTMACVlanEN value not illegal */
+} /* modEoCCLTMACVlanEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACVlanTable_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
+ * modEoCCLTMACVlanTable_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
+modEoCCLTMACVlanEN_undo_setup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanEN_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTMACVlanEN undo.
+ */
+ /*
+ * copy modEoCCLTMACVlanEN data
+ * set rowreq_ctx->undo->modEoCCLTMACVlanEN from rowreq_ctx->data.modEoCCLTMACVlanEN
+ */
+ rowreq_ctx->undo->modEoCCLTMACVlanEN =
+ rowreq_ctx->data.modEoCCLTMACVlanEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanEN_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 modEoCCLTMACVlanEN_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTMACVlanEN_set(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACVlanEN_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanEN_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCLTMACVlanEN reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ switch (modEoCCLTMACVlanEN_val) {
+ case MODEOCCLTMACVLANEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ENABLE, LIBSPID_MASTER_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* if VlanEN is changed from enabled to disabled, call libspid function for disabling VLAN on master */
+ if (INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_ENABLE == rowreq_ctx->undo->modEoCCLTMACVlanEN){
+ if (LIBSPID_SUCCESS != libspid_eoc_master_disable_vlan_action()){
+ snmp_log(LOG_ERR, "disabling VLAN on master failed!");
+ }
+ }
+
+ rowreq_ctx->data.modEoCCLTMACVlanEN =
+ INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE;
+ break;
+
+ case MODEOCCLTMACVLANEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ENABLE, LIBSPID_MASTER_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* if VlanEN is changed from disabled to enabled, call libspid function for enabling VLAN on master */
+ if (INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE == rowreq_ctx->undo->modEoCCLTMACVlanEN){
+ if (LIBSPID_SUCCESS != libspid_eoc_master_vlan_action()){
+ snmp_log(LOG_ERR, "enabling VLAN on master failed!");
+ }
+ }
+
+ rowreq_ctx->data.modEoCCLTMACVlanEN =
+ INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCCLTMACVlanEN\n",
+ modEoCCLTMACVlanEN_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTMACVlanEN_undo(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanEN_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTMACVlanEN undo.
+ */
+ switch (rowreq_ctx->undo->modEoCCLTMACVlanEN) {
+ case INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ENABLE, LIBSPID_MASTER_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ENABLE, LIBSPID_MASTER_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for undone modEoCCLTMACVlanEN\n",
+ rowreq_ctx->undo->modEoCCLTMACVlanEN);
+ return SNMP_ERR_GENERR;
+ }
+ /*
+ * copy modEoCCLTMACVlanEN data
+ * set rowreq_ctx->data.modEoCCLTMACVlanEN from rowreq_ctx->undo->modEoCCLTMACVlanEN
+ */
+ rowreq_ctx->data.modEoCCLTMACVlanEN =
+ rowreq_ctx->undo->modEoCCLTMACVlanEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanEN_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanEntry.modEoCCLTMACAdminVlanID
+ * modEoCCLTMACAdminVlanID is subid 3 of modEoCCLTMACVlanEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 4095;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACAdminVlanID_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
+ * modEoCCLTMACVlanTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 4095
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTMACAdminVlanID_check_value(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCLTMACAdminVlanID_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACAdminVlanID_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTMACAdminVlanID value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTMACAdminVlanID value not illegal */
+} /* modEoCCLTMACAdminVlanID_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACVlanTable_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
+ * modEoCCLTMACVlanTable_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
+modEoCCLTMACAdminVlanID_undo_setup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACAdminVlanID_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTMACAdminVlanID undo.
+ */
+ /*
+ * copy modEoCCLTMACAdminVlanID data
+ * set rowreq_ctx->undo->modEoCCLTMACAdminVlanID from rowreq_ctx->data.modEoCCLTMACAdminVlanID
+ */
+ rowreq_ctx->undo->modEoCCLTMACAdminVlanID =
+ rowreq_ctx->data.modEoCCLTMACAdminVlanID;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACAdminVlanID_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 modEoCCLTMACAdminVlanID_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTMACAdminVlanID_set(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACAdminVlanID_val)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACAdminVlanID_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* disable previous VLAN on master prior to changing VLAN ID value */
+ if (LIBSPID_SUCCESS != libspid_eoc_master_disable_vlan_action()){
+ snmp_log(LOG_ERR, "disabling previous VLAN on master failed!");
+ }
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCLTMACAdminVlanID reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ sprintf(buffer, "%ld", modEoCCLTMACAdminVlanID_val);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID, buffer)) {
+ snmp_log(LOG_ERR,
+ "Couldn't write new AdminVlanID value to configuration file\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* enable new VLAN value on master */
+ if (LIBSPID_SUCCESS != libspid_eoc_master_vlan_action()){
+ snmp_log(LOG_ERR, "enabling new VLAN value on master failed!");
+ }
+
+ /*
+ * TODO:461:M: |-> Set modEoCCLTMACAdminVlanID value.
+ * set modEoCCLTMACAdminVlanID value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.modEoCCLTMACAdminVlanID = modEoCCLTMACAdminVlanID_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACAdminVlanID_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTMACAdminVlanID_undo(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACAdminVlanID_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTMACAdminVlanID undo.
+ */
+ sprintf(buffer, "%ld", rowreq_ctx->undo->modEoCCLTMACAdminVlanID);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID, buffer)) {
+ snmp_log(LOG_ERR,
+ "Couldn't write undone AdminVlanID value to configuration file\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /*
+ * copy modEoCCLTMACAdminVlanID data
+ * set rowreq_ctx->data.modEoCCLTMACAdminVlanID from rowreq_ctx->undo->modEoCCLTMACAdminVlanID
+ */
+ rowreq_ctx->data.modEoCCLTMACAdminVlanID =
+ rowreq_ctx->undo->modEoCCLTMACAdminVlanID;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACAdminVlanID_undo */
+
+/** @} */