⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ifxtable.c

📁 snmp的源代码,已经在我的ubuntu下编译通过
💻 C
📖 第 1 页 / 共 5 页
字号:
     * TODO:231:o: |-> Extract the current value of the ifName data.     * set (* ifName_val_ptr_ptr ) and (* ifName_val_ptr_len_ptr ) from rowreq_ctx->data     */    /*     * make sure there is enough space for ifName data     */    tmp_len = strlen(rowreq_ctx->data.ifName);    if ((NULL == (*ifName_val_ptr_ptr))        || ((*ifName_val_ptr_len_ptr) < tmp_len)) {        /*         * allocate space for ifName data         */        (*ifName_val_ptr_ptr) =            malloc(tmp_len * sizeof((*ifName_val_ptr_ptr)[0]));        if (NULL == (*ifName_val_ptr_ptr)) {            snmp_log(LOG_ERR, "could not allocate memory\n");            return MFD_ERROR;        }    }    (*ifName_val_ptr_len_ptr) = tmp_len;    memcpy((*ifName_val_ptr_ptr), rowreq_ctx->data.ifName,           (*ifName_val_ptr_len_ptr) * sizeof((*ifName_val_ptr_ptr)[0]));    return MFD_SUCCESS;}                               /* ifName_get *//*--------------------------------------------------------------------- * IF-MIB::ifXEntry.ifInMulticastPkts * ifInMulticastPkts is subid 2 of ifXEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.31.1.1.1.2 * Description:The number of packets, delivered by this sub-layer to a            higher (sub-)layer, which were addressed to a multicast            address at this sub-layer.  For a MAC layer protocol, this            includes both Group and Functional addresses.            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 ifInMulticastPkts data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param ifInMulticastPkts_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 */intifInMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,                      u_long * ifInMulticastPkts_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != ifInMulticastPkts_val_ptr);    DEBUGMSGTL(("verbose:ifXTable:ifInMulticastPkts_get", "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:231:o: |-> Extract the current value of the ifInMulticastPkts data.     * set (* ifInMulticastPkts_val_ptr ) from rowreq_ctx->data     */    (*ifInMulticastPkts_val_ptr) = rowreq_ctx->data.ifInMulticastPkts;    return MFD_SUCCESS;}                               /* ifInMulticastPkts_get *//*--------------------------------------------------------------------- * IF-MIB::ifXEntry.ifInBroadcastPkts * ifInBroadcastPkts is subid 3 of ifXEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.31.1.1.1.3 * Description:The number of packets, delivered by this sub-layer to a            higher (sub-)layer, which were addressed to a broadcast            address at this sub-layer.            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 ifInBroadcastPkts data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param ifInBroadcastPkts_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 */intifInBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,                      u_long * ifInBroadcastPkts_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != ifInBroadcastPkts_val_ptr);    DEBUGMSGTL(("verbose:ifXTable:ifInBroadcastPkts_get", "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:231:o: |-> Extract the current value of the ifInBroadcastPkts data.     * set (* ifInBroadcastPkts_val_ptr ) from rowreq_ctx->data     */    (*ifInBroadcastPkts_val_ptr) = rowreq_ctx->data.ifInBroadcastPkts;    return MFD_SUCCESS;}                               /* ifInBroadcastPkts_get *//*--------------------------------------------------------------------- * IF-MIB::ifXEntry.ifOutMulticastPkts * ifOutMulticastPkts is subid 4 of ifXEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.31.1.1.1.4 * Description:The total number of packets that higher-level protocols            requested be transmitted, and which were addressed to a            multicast address at this sub-layer, including those that            were discarded or not sent.  For a MAC layer protocol, this            includes both Group and Functional addresses.            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 ifOutMulticastPkts data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param ifOutMulticastPkts_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 */intifOutMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,                       u_long * ifOutMulticastPkts_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != ifOutMulticastPkts_val_ptr);    DEBUGMSGTL(("verbose:ifXTable:ifOutMulticastPkts_get", "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:231:o: |-> Extract the current value of the ifOutMulticastPkts data.     * set (* ifOutMulticastPkts_val_ptr ) from rowreq_ctx->data     */    (*ifOutMulticastPkts_val_ptr) = rowreq_ctx->data.ifOutMulticastPkts;    return MFD_SUCCESS;}                               /* ifOutMulticastPkts_get *//*--------------------------------------------------------------------- * IF-MIB::ifXEntry.ifOutBroadcastPkts * ifOutBroadcastPkts is subid 5 of ifXEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.31.1.1.1.5 * Description:The total number of packets that higher-level protocols            requested be transmitted, and which were addressed to a            broadcast address at this sub-layer, including those that            were discarded or not sent.            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 ifOutBroadcastPkts data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param ifOutBroadcastPkts_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 */intifOutBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,                       u_long * ifOutBroadcastPkts_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != ifOutBroadcastPkts_val_ptr);    DEBUGMSGTL(("verbose:ifXTable:ifOutBroadcastPkts_get", "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:231:o: |-> Extract the current value of the ifOutBroadcastPkts data.     * set (* ifOutBroadcastPkts_val_ptr ) from rowreq_ctx->data     */    (*ifOutBroadcastPkts_val_ptr) = rowreq_ctx->data.ifOutBroadcastPkts;    return MFD_SUCCESS;}                               /* ifOutBroadcastPkts_get *//*--------------------------------------------------------------------- * IF-MIB::ifXEntry.ifHCInOctets * ifHCInOctets is subid 6 of ifXEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.31.1.1.1.6 * Description:The total number of octets received on the interface,            including framing characters.  This object is a 64-bit            version of ifInOctets.            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 COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) *//** * Extract the current value of the ifHCInOctets data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param ifHCInOctets_val_ptr *        Pointer to storage for a U64 variable * * @retval MFD_SUCCESS         : success * @retval MFD_SKIP            : skip this node (no value for now) * @retval MFD_ERROR           : Any other error */intifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,                 U64 * ifHCInOctets_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != ifHCInOctets_val_ptr);    /*     * TODO:231:o: |-> copy ifHCInOctets data.     * get (* ifHCInOctets_val_ptr ).low and (* ifHCInOctets_val_ptr ).high from rowreq_ctx->data     */    (*ifHCInOctets_val_ptr).high = rowreq_ctx->data.ifHCInOctets.high;    (*ifHCInOctets_val_ptr).low = rowreq_ctx->data.ifHCInOctets.low;    return MFD_SUCCESS;}                               /* ifHCInOctets_get *//*--------------------------------------------------------------------- * IF-MIB::ifXEntry.ifHCInUcastPkts * ifHCInUcastPkts is subid 7 of ifXEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.31.1.1.1.7 * Description:The number of packets, delivered by this sub-layer to a            higher (sub-)layer, which were not addressed to a multicast            or broadcast address at this sub-layer.  This object is a            64-bit version of ifInUcastPkts.            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 COUNTER64 (based on perltype COUNTER64) * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64) *//** * Extract the current value of the ifHCInUcastPkts data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param ifHCInUcastPkts_val_ptr *        Pointer to storage for a U64 variable * * @retval MFD_SUCCESS         : success * @retval MFD_SKIP            : skip this node (no value for now) * @retval MFD_ERROR           : Any other error */intifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,                    U64 * ifHCInUcastPkts_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != ifHCInUcastPkts_val_ptr);    /*     * TODO:231:o: |-> copy ifHCInUcastPkts data.     * get (* ifHCInUcastPkts_val_ptr ).low and (* ifHCInUcastPkts_val_ptr ).high from rowreq_ctx->data

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -