📄 snmpnotifyfiltertable.c
字号:
* 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 * snmpNotifyFilterTable_check_dependencies() function. * * The following checks have already been done for you: * The syntax is ASN_INTEGER * The value is one of other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5) * * If there a no other checks you need to do, simply return MFD_SUCCESS. * */intsnmpNotifyFilterStorageType_check_value(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx, u_long snmpNotifyFilterStorageType_val){ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_check_value", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:441:o: |-> Check for valid snmpNotifyFilterStorageType value. */ return MFD_SUCCESS; /* snmpNotifyFilterStorageType value not illegal */} /* snmpNotifyFilterStorageType_check_value *//** * Save old value information * * @param rowreq_ctx * Pointer to the table context (snmpNotifyFilterTable_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 * snmpNotifyFilterTable_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. */intsnmpNotifyFilterStorageType_undo_setup(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_undo_setup", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:455:o: |-> Setup snmpNotifyFilterStorageType undo. */ /* * copy snmpNotifyFilterStorageType data * set rowreq_ctx->undo->snmpNotifyFilterStorageType from rowreq_ctx->data.snmpNotifyFilterStorageType */ rowreq_ctx->undo->snmpNotifyFilterStorageType = rowreq_ctx->data.snmpNotifyFilterStorageType; return MFD_SUCCESS;} /* snmpNotifyFilterStorageType_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 snmpNotifyFilterStorageType_val * A long containing the new value. */intsnmpNotifyFilterStorageType_set(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx, u_long snmpNotifyFilterStorageType_val){ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_set", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:461:M: |-> Set snmpNotifyFilterStorageType value. * set snmpNotifyFilterStorageType value in rowreq_ctx->data */ rowreq_ctx->data.snmpNotifyFilterStorageType = snmpNotifyFilterStorageType_val; return MFD_SUCCESS;} /* snmpNotifyFilterStorageType_set *//** * undo the previous set. * * @param rowreq_ctx * Pointer to the users context. */intsnmpNotifyFilterStorageType_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_undo", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:456:o: |-> Clean up snmpNotifyFilterStorageType undo. */ /* * copy snmpNotifyFilterStorageType data * set rowreq_ctx->data.snmpNotifyFilterStorageType from rowreq_ctx->undo->snmpNotifyFilterStorageType */ rowreq_ctx->data.snmpNotifyFilterStorageType = rowreq_ctx->undo->snmpNotifyFilterStorageType; return MFD_SUCCESS;} /* snmpNotifyFilterStorageType_undo *//*--------------------------------------------------------------------- * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterRowStatus * snmpNotifyFilterRowStatus is subid 5 of snmpNotifyFilterEntry. * Its status is Current, and its access level is Create. * OID: .1.3.6.1.6.3.13.1.3.1.5 * Description:The status of this conceptual row. To create a row in this table, a manager must set this object to either createAndGo(4) or createAndWait(5). * * 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 snmpNotifyFilterRowStatus_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 * snmpNotifyFilterTable_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. * */intsnmpNotifyFilterRowStatus_check_value(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx, u_long snmpNotifyFilterRowStatus_val){ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_check_value", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:441:o: |-> Check for valid snmpNotifyFilterRowStatus value. */ return MFD_SUCCESS; /* snmpNotifyFilterRowStatus value not illegal */} /* snmpNotifyFilterRowStatus_check_value *//** * Save old value information * * @param rowreq_ctx * Pointer to the table context (snmpNotifyFilterTable_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 * snmpNotifyFilterTable_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. */intsnmpNotifyFilterRowStatus_undo_setup(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_undo_setup", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:455:o: |-> Setup snmpNotifyFilterRowStatus undo. */ /* * copy snmpNotifyFilterRowStatus data * set rowreq_ctx->undo->snmpNotifyFilterRowStatus from rowreq_ctx->data.snmpNotifyFilterRowStatus */ rowreq_ctx->undo->snmpNotifyFilterRowStatus = rowreq_ctx->data.snmpNotifyFilterRowStatus; return MFD_SUCCESS;} /* snmpNotifyFilterRowStatus_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 snmpNotifyFilterRowStatus_val * A long containing the new value. */intsnmpNotifyFilterRowStatus_set(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx, u_long snmpNotifyFilterRowStatus_val){ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_set", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:461:M: |-> Set snmpNotifyFilterRowStatus value. * set snmpNotifyFilterRowStatus value in rowreq_ctx->data */ rowreq_ctx->data.snmpNotifyFilterRowStatus = snmpNotifyFilterRowStatus_val; return MFD_SUCCESS;} /* snmpNotifyFilterRowStatus_set *//** * undo the previous set. * * @param rowreq_ctx * Pointer to the users context. */intsnmpNotifyFilterRowStatus_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_undo", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:456:o: |-> Clean up snmpNotifyFilterRowStatus undo. */ /* * copy snmpNotifyFilterRowStatus data * set rowreq_ctx->data.snmpNotifyFilterRowStatus from rowreq_ctx->undo->snmpNotifyFilterRowStatus */ rowreq_ctx->data.snmpNotifyFilterRowStatus = rowreq_ctx->undo->snmpNotifyFilterRowStatus; return MFD_SUCCESS;} /* snmpNotifyFilterRowStatus_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 * snmpNotifyFilterTable.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-snmpNotifyFilterTable if you don't have dependencies) */intsnmpNotifyFilterTable_check_dependencies(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx){ int rc = MFD_SUCCESS; DEBUGMSGTL(("internal:snmpNotifyFilterTable:snmpNotifyFilterTable_check_dependencies", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:470:o: Check snmpNotifyFilterTable row dependencies. * check that all new value are legal and consistent with each other */ /* * check for valid StorageType transition (old, new) */ rc = check_storage_transition(rowreq_ctx->undo-> snmpNotifyFilterStorageType, rowreq_ctx->data. snmpNotifyFilterStorageType); if (MFD_SUCCESS != rc) return rc; /* * check RowStatus dependencies */ if (rowreq_ctx-> column_set_flags & COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG) { /* * check for valid RowStatus transition (old, new) * (Note: move tran
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -