📄 ipaddresstable.c
字号:
* Its syntax is TimeStamp (based on perltype TICKS) * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long) *//** * Extract the current value of the ipAddressCreated data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipAddressCreated_val_ptr * Pointer to storage for a u_long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */intipAddressCreated_get(ipAddressTable_rowreq_ctx * rowreq_ctx, u_long * ipAddressCreated_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipAddressCreated_val_ptr); DEBUGMSGTL(("verbose:ipAddressTable:ipAddressCreated_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipAddressCreated data. * copy (* ipAddressCreated_val_ptr ) from rowreq_ctx->data */ (*ipAddressCreated_val_ptr) = rowreq_ctx->ipAddressCreated; return MFD_SUCCESS;} /* ipAddressCreated_get *//*--------------------------------------------------------------------- * IP-MIB::ipAddressEntry.ipAddressLastChanged * ipAddressLastChanged is subid 9 of ipAddressEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.34.1.9 * Description:The value of sysUpTime at the time this entry was last updated. If this entry was updated prior to the last re- initialization of the local network management subsystem, then this object contains a zero value. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is TimeStamp (based on perltype TICKS) * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long) *//** * Extract the current value of the ipAddressLastChanged data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipAddressLastChanged_val_ptr * Pointer to storage for a u_long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */intipAddressLastChanged_get(ipAddressTable_rowreq_ctx * rowreq_ctx, u_long * ipAddressLastChanged_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipAddressLastChanged_val_ptr); DEBUGMSGTL(("verbose:ipAddressTable:ipAddressLastChanged_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipAddressLastChanged data. * copy (* ipAddressLastChanged_val_ptr ) from rowreq_ctx->data */ (*ipAddressLastChanged_val_ptr) = rowreq_ctx->ipAddressLastChanged; return MFD_SUCCESS;} /* ipAddressLastChanged_get *//*--------------------------------------------------------------------- * IP-MIB::ipAddressEntry.ipAddressRowStatus * ipAddressRowStatus is subid 10 of ipAddressEntry. * Its status is Current, and its access level is Create. * OID: .1.3.6.1.2.1.4.34.1.10 * Description:The status of this conceptual row. The RowStatus TC requires that this DESCRIPTION clause states under which circumstances other objects in this row can be modified. The value of this object has no effect on whether other objects in this conceptual row can be modified. A conceptual row can not be made active until the ipAddressIfIndex has been set to a valid index. * * 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 ipAddressRowStatus data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipAddressRowStatus_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 */intipAddressRowStatus_get(ipAddressTable_rowreq_ctx * rowreq_ctx, u_long * ipAddressRowStatus_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipAddressRowStatus_val_ptr); /** WARNING: this code might not work for netsnmp_ipaddress_entry */ (*ipAddressRowStatus_val_ptr) = rowreq_ctx->ipAddressRowStatus; return MFD_SUCCESS;} /* ipAddressRowStatus_get *//*--------------------------------------------------------------------- * IP-MIB::ipAddressEntry.ipAddressStorageType * ipAddressStorageType is subid 11 of ipAddressEntry. * Its status is Current, and its access level is Create. * OID: .1.3.6.1.2.1.4.34.1.11 * Description:The storage type for this conceptual row. If this object has a value of 'permanent' then no other objects are required to be able to be modified. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 1 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * defval: volatile * * Enum range: 4/8. Values: other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5) * * Its syntax is StorageType (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 ipAddressStorageType data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipAddressStorageType_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 */intipAddressStorageType_get(ipAddressTable_rowreq_ctx * rowreq_ctx, u_long * ipAddressStorageType_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipAddressStorageType_val_ptr); DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipAddressStorageType data. * copy (* ipAddressStorageType_val_ptr ) from rowreq_ctx->data */ (*ipAddressStorageType_val_ptr) = rowreq_ctx->data->ia_storagetype; return MFD_SUCCESS;} /* ipAddressStorageType_get *//** @} *//********************************************************************** ********************************************************************** *** *** Table ipAddressTable *** ********************************************************************** **********************************************************************//* * IP-MIB::ipAddressTable is subid 34 of ip. * Its status is Current. * OID: .1.3.6.1.2.1.4.34, length: 8 */ /* * 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 * ipAddressTable_allocate_data(), but may need extra * initialization similar to what you may have done in * ipAddressTable_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 (ipAddressTable_rowreq_ctx) * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error. set will fail. */intipAddressTable_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx){ int rc = MFD_SUCCESS; DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_undo_setup", "called\n")); /** we should have a non-NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:451:M: |-> Setup ipAddressTable undo. * set up ipAddressTable undo information, in preparation for a set. * Undo storage is in (* ipAddressStorageType_val_ptr )* */ /* * check for storage types that don't allow modification. * probably should try and do this earlier (and we could, by * adding code to the interface file), but this ought to suffice. */ if (STORAGETYPE_READONLY == rowreq_ctx->data->ia_storagetype) { DEBUGMSGTL(("ipAddressTable", "can't change readonly row\n")); return MFD_NOT_VALID_EVER; } /* * save last changed */ rowreq_ctx->ipAddressLastChanged_undo = rowreq_ctx->ipAddressLastChanged; /* * just copy everything */ rc = netsnmp_access_ipaddress_entry_copy(rowreq_ctx->undo, rowreq_ctx->data); return rc;} /* ipAddressTable_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 (ipAddressTable_rowreq_ctx) * * @retval MFD_SUCCESS : success * @retval MFD_ERROR : error. set will fail. */intipAddressTable_undo(ipAddressTable_rowreq_ctx * rowreq_ctx){ int rc = MFD_SUCCESS; DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_undo", "called\n")); /** we should have a non-NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:451:M: |-> ipAddressTable undo. * ipAddressTable undo information, in response to a failed set. * Undo storage is in (* ipAddressStorageType_val_ptr )* */ return rc;} /* ipAddressTable_undo_setup */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -