📄 iftable.c
字号:
*/intifOutNUcastPkts_get(ifTable_rowreq_ctx * rowreq_ctx, u_long * ifOutNUcastPkts_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ifOutNUcastPkts_val_ptr); DEBUGMSGTL(("verbose:ifTable:ifOutNUcastPkts_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ifOutNUcastPkts data. * copy (* ifOutNUcastPkts_val_ptr ) from rowreq_ctx->data */ (*ifOutNUcastPkts_val_ptr) = rowreq_ctx->data.ifOutNUcastPkts; return MFD_SUCCESS;} /* ifOutNUcastPkts_get *//*--------------------------------------------------------------------- * IF-MIB::ifEntry.ifOutDiscards * ifOutDiscards is subid 19 of ifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.2.2.1.19 * Description:The number of outbound packets which were chosen to be discarded even though no errors had been detected to prevent their being transmitted. One possible reason for discarding such a packet could be to free up buffer space. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER (based on perltype COUNTER) * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long) *//** * Extract the current value of the ifOutDiscards data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ifOutDiscards_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 */intifOutDiscards_get(ifTable_rowreq_ctx * rowreq_ctx, u_long * ifOutDiscards_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ifOutDiscards_val_ptr); DEBUGMSGTL(("verbose:ifTable:ifOutDiscards_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ifOutDiscards data. * copy (* ifOutDiscards_val_ptr ) from rowreq_ctx->data */ (*ifOutDiscards_val_ptr) = rowreq_ctx->data.ifOutDiscards; return MFD_SUCCESS;} /* ifOutDiscards_get *//*--------------------------------------------------------------------- * IF-MIB::ifEntry.ifOutErrors * ifOutErrors is subid 20 of ifEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.2.2.1.20 * Description:For packet-oriented interfaces, the number of outbound packets that could not be transmitted because of errors. For character-oriented or fixed-length interfaces, the number of outbound transmission units that could not be transmitted because of errors. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is COUNTER (based on perltype COUNTER) * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long) *//** * Extract the current value of the ifOutErrors data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ifOutErrors_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 */intifOutErrors_get(ifTable_rowreq_ctx * rowreq_ctx, u_long * ifOutErrors_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ifOutErrors_val_ptr); DEBUGMSGTL(("verbose:ifTable:ifOutErrors_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ifOutErrors data. * copy (* ifOutErrors_val_ptr ) from rowreq_ctx->data */ (*ifOutErrors_val_ptr) = rowreq_ctx->data.ifOutErrors; return MFD_SUCCESS;} /* ifOutErrors_get *//*--------------------------------------------------------------------- * IF-MIB::ifEntry.ifOutQLen * ifOutQLen is subid 21 of ifEntry. * Its status is Deprecated, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.2.2.1.21 * Description:The length of the output packet queue (in packets). * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is GAUGE (based on perltype GAUGE) * The net-snmp type is ASN_GAUGE. The C type decl is u_long (u_long) *//** * Extract the current value of the ifOutQLen data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ifOutQLen_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 */intifOutQLen_get(ifTable_rowreq_ctx * rowreq_ctx, u_long * ifOutQLen_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ifOutQLen_val_ptr); DEBUGMSGTL(("verbose:ifTable:ifOutQLen_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ifOutQLen data. * copy (* ifOutQLen_val_ptr ) from rowreq_ctx->data */ (*ifOutQLen_val_ptr) = rowreq_ctx->data.ifOutQLen; return MFD_SUCCESS;} /* ifOutQLen_get *//*--------------------------------------------------------------------- * IF-MIB::ifEntry.ifSpecific * ifSpecific is subid 22 of ifEntry. * Its status is Deprecated, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.2.2.1.22 * Description:A reference to MIB definitions specific to the particular media being used to realize the interface. It is recommended that this value point to an instance of a MIB object in the media-specific MIB, i.e., that this object have the semantics associated with the InstancePointer textual convention defined in RFC 2579. In fact, it is recommended that the media-specific MIB specify what value ifSpecific should/can take for values of ifType. If no MIB definitions specific to the particular media are available, the value should be set to the OBJECT IDENTIFIER { 0 0 }. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is OBJECTID (based on perltype OBJECTID) * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid) * This data type requires a length. (Max 255) *//** * Extract the current value of the ifSpecific data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ifSpecific_val_ptr_ptr * Pointer to storage for a oid variable * @param ifSpecific_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by ifSpecific. * 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 (*ifSpecific_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update ifSpecific_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.) */intifSpecific_get(ifTable_rowreq_ctx * rowreq_ctx, oid ** ifSpecific_val_ptr_ptr, size_t * ifSpecific_val_ptr_len_ptr){ /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != ifSpecific_val_ptr_ptr) && (NULL != *ifSpecific_val_ptr_ptr)); netsnmp_assert(NULL != ifSpecific_val_ptr_len_ptr); DEBUGMSGTL(("verbose:ifTable:ifSpecific_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ifSpecific data. * copy (* ifSpecific_val_ptr_ptr ) data and (* ifSpecific_val_ptr_len_ptr ) from rowreq_ctx->data */#ifdef IFTABLE_HAS_IFSPECIFIC /* * make sure there is enough space for ifSpecific data */ if ((NULL == (*ifSpecific_val_ptr_ptr)) || ((*ifSpecific_val_ptr_len_ptr) < (rowreq_ctx->data.ifSpecific_len * sizeof(rowreq_ctx->data.ifSpecific[0])))) { /* * allocate space for ifSpecific data */ (*ifSpecific_val_ptr_ptr) = malloc(rowreq_ctx->data.ifSpecific_len * sizeof(rowreq_ctx->data.ifSpecific[0])); if (NULL == (*ifSpecific_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*ifSpecific_val_ptr_len_ptr) = rowreq_ctx->data.ifSpecific_len * sizeof(rowreq_ctx->data.ifSpecific[0]); memcpy((*ifSpecific_val_ptr_ptr), rowreq_ctx->data.ifSpecific, (*ifSpecific_val_ptr_len_ptr));#else /* * hard coded */ netsnmp_assert((*ifSpecific_val_ptr_len_ptr) > nullOidLen); (*ifSpecific_val_ptr_len_ptr) = nullOidLen; memcpy(*ifSpecific_val_ptr_ptr, &nullOid, nullOidLen);#endif return MFD_SUCCESS;} /* ifSpecific_get *//** @} *//********************************************************************** ********************************************************************** *** *** Table ifTable *** ********************************************************************** **********************************************************************//* * IF-MIB::ifTable is subid 2 of interfaces. * Its status is Current. * OID: .1.3.6.1.2.1.2.2, 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 * +==============+ * +----------------|| object || * | E || lookup || * | +==============+ * | | S * | +==============+ * | E || check || * |<---------------|| values || * | +==============+ * | | S * | +==============+ * | +<-------|| undo || * | | E || setup || * | | +==============+ * | | | S * | | +==============+ * | | || set ||-------------------------->+ * | | || value || E | * | | +==============+ | * | | | S | * | | +--------------+ | * | | | check |-------------------------->| * | | | consistency | E | * | | +--------------+ | * | | | S | * | | +==============+ +
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -