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

📄 inetnettomediatable.c

📁 snmp的源代码,已经在我的ubuntu下编译通过
💻 C
📖 第 1 页 / 共 5 页
字号:
     * TODO:231:o: |-> Extract the current value of the inetNetToMediaPhysAddress data.     * set (* inetNetToMediaPhysAddress_val_ptr_ptr ) and (* inetNetToMediaPhysAddress_val_ptr_len_ptr ) from rowreq_ctx->data     */    (*inetNetToMediaPhysAddress_val_ptr_ptr) =        rowreq_ctx->data->arp_physaddress;    (*inetNetToMediaPhysAddress_val_ptr_len_ptr) =        rowreq_ctx->data->arp_physaddress_len;    return MFD_SUCCESS;}                               /* inetNetToMediaPhysAddress_get *//*--------------------------------------------------------------------- * IP-MIB::inetNetToMediaEntry.inetNetToMediaLastUpdated * inetNetToMediaLastUpdated is subid 5 of inetNetToMediaEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.35.1.5 * 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 inetNetToMediaLastUpdated data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param inetNetToMediaLastUpdated_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 */intinetNetToMediaLastUpdated_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,                              u_long * inetNetToMediaLastUpdated_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != inetNetToMediaLastUpdated_val_ptr);    DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaLastUpdated_get", "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:231:o: |-> Extract the current value of the inetNetToMediaLastUpdated data.     * set (* inetNetToMediaLastUpdated_val_ptr ) from rowreq_ctx->data     */    return MFD_SKIP;            /* TODO:235:M: |-> Remove SKIP once you've set inetNetToMediaLastUpdated data */    return MFD_SUCCESS;}                               /* inetNetToMediaLastUpdated_get *//*--------------------------------------------------------------------- * IP-MIB::inetNetToMediaEntry.inetNetToMediaType * inetNetToMediaType is subid 6 of inetNetToMediaEntry. * Its status is Current, and its access level is Create. * OID: .1.3.6.1.2.1.4.35.1.6 * Description:The type of mapping.            Setting this object to the value invalid(2) has the effect            of invalidating the corresponding entry in the            inetNetToMediaTable.  That is, it effectively dis-            associates the interface identified with said entry from the            mapping identified with said entry.  It is an            implementation- specific matter as to whether the agent            removes an invalidated entry from the table.  Accordingly,            management stations must be prepared to receive tabular            information from agents that corresponds to entries not            currently in use.  Proper interpretation of such entries            requires examination of the relevant inetNetToMediaType            object.            The 'dynamic(3)' type indicates that the IP address to            physical addresses mapping has been dynamically resolved            using e.g. IPv4 ARP or the IPv6 Neighbor Discovery protocol.            The 'static(4)' type indicates that the mapping has been            statically configured.  Both of these refer to entries that            provide mappings for other entities addresses.            The 'local(5)' type indicates that the mapping is provided            for an entity's own interface address.            As the entries in this table are typically not persistent            when this object is written the entity SHOULD NOT save the            change to non-volatile storage. * * Attributes: *   accessible 1     isscalar 0     enums  1      hasdefval 1 *   readable   1     iscolumn 1     ranges 0      hashint   0 *   settable   1 *   defval: static * * Enum range: 5/8. Values:  other(1), invalid(2), dynamic(3), static(4), local(5) * * Its syntax is INTEGER (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 inetNetToMediaType data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param inetNetToMediaType_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 */intinetNetToMediaType_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,                       u_long * inetNetToMediaType_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != inetNetToMediaType_val_ptr);    DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_get",                "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:231:o: |-> Extract the current value of the inetNetToMediaType data.     * set (* inetNetToMediaType_val_ptr ) from rowreq_ctx->data     */    (*inetNetToMediaType_val_ptr) = rowreq_ctx->data->arp_type;    return MFD_SUCCESS;}                               /* inetNetToMediaType_get *//*--------------------------------------------------------------------- * IP-MIB::inetNetToMediaEntry.inetNetToMediaState * inetNetToMediaState is subid 7 of inetNetToMediaEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.35.1.7 * Description:The Neighbor Unreachability Detection [4] state for the            interface when the address mapping in this entry is used.            If Neighbor Unreachability Detection is not in use (e.g. for            IPv4), this object is always unknown(6). * * Attributes: *   accessible 1     isscalar 0     enums  1      hasdefval 0 *   readable   1     iscolumn 1     ranges 0      hashint   0 *   settable   0 * * Enum range: 6/8. Values:  reachable(1), stale(2), delay(3), probe(4), invalid(5), unknown(6), incomplete(7) * * Its syntax is INTEGER (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 inetNetToMediaState data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param inetNetToMediaState_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 */intinetNetToMediaState_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,                        u_long * inetNetToMediaState_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != inetNetToMediaState_val_ptr);    DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaState_get",                "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:231:o: |-> Extract the current value of the inetNetToMediaState data.     * set (* inetNetToMediaState_val_ptr ) from rowreq_ctx->data     */    (*inetNetToMediaState_val_ptr) = INETNETTOMEDIASTATE_UNKNOWN;    return MFD_SUCCESS;}                               /* inetNetToMediaState_get *//*--------------------------------------------------------------------- * IP-MIB::inetNetToMediaEntry.inetNetToMediaRowStatus * inetNetToMediaRowStatus is subid 8 of inetNetToMediaEntry. * Its status is Current, and its access level is Create. * OID: .1.3.6.1.2.1.4.35.1.8 * 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            inetNetToMediaPhysAddress object has been set.            Note that if the inetNetToMediaType is set to 'invalid' the            managed node may delete the entry independent of the state            of this object. * * 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 inetNetToMediaRowStatus data. * * Set a value using the data context for the row. * * @param rowreq_ctx *        Pointer to the row request context. * @param inetNetToMediaRowStatus_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 */intinetNetToMediaRowStatus_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,                            u_long * inetNetToMediaRowStatus_val_ptr){   /** we should have a non-NULL pointer */    netsnmp_assert(NULL != inetNetToMediaRowStatus_val_ptr);    (*inetNetToMediaRowStatus_val_ptr) =        rowreq_ctx->inetNetToMediaRowStatus;    return MFD_SUCCESS;}                               /* inetNetToMediaRowStatus_get *//** @} *//********************************************************************** ********************************************************************** *** *** Table inetNetToMediaTable *** ********************************************************************** **********************************************************************//* * inetNetToMediaTable is subid 35 of ip. * Its status is Current. * OID: .1.3.6.1.2.1.4.35, 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   |     *                        +--------------+         +--------------+     *     *//** * verify specified index is valid. * * This check is independent of whether or not the values specified for * the columns of the new row are valid. Column values and row consistency * will be checked later. At this point, only the index values should be * checked. *

⌨️ 快捷键说明

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