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

📄 inetnettomediatable.c

📁 snmp的源代码,已经在我的ubuntu下编译通过
💻 C
📖 第 1 页 / 共 5 页
字号:
    return MFD_SUCCESS;         /* inetNetToMediaNetAddressType index ok */}                               /* inetNetToMediaNetAddressType_check_index *//*--------------------------------------------------------------------- * IP-MIB::inetNetToMediaEntry.inetNetToMediaNetAddress * inetNetToMediaNetAddress is subid 3 of inetNetToMediaEntry. * Its status is Current, and its access level is NoAccess. * OID: .1.3.6.1.2.1.4.35.1.3 * Description:The IP Address corresponding to the media-dependent            `physical' address.  The address type of this object is            specified in inetNetToMediaAddressType.            Implementors need to be aware that if the size of            inetNetToMediaNetAddress exceeds 115 octets then OIDS of            instances of columns in this row will have more than 128            sub-identifiers and cannot be accessed using SNMPv1, SNMPv2c            or SNMPv3. * * Attributes: *   accessible 0     isscalar 0     enums  0      hasdefval 0 *   readable   0     iscolumn 1     ranges 1      hashint   0 *   settable   0 * * Ranges:  0 - 255; * * Its syntax is InetAddress (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length.  (Max 255) * * * * NOTE: NODE inetNetToMediaNetAddress IS NOT ACCESSIBLE * * *//** * check validity of inetNetToMediaNetAddress index portion * * @retval MFD_SUCCESS   : the incoming value is legal * @retval MFD_BAD_VALUE : the incoming value is NOT legal * * @note this is not the place to do any checks for the sanity *       of multiple indexes. Those types of checks should be done in the *       inetNetToMediaTable_validate_index() function. */intinetNetToMediaNetAddress_check_index(inetNetToMediaTable_rowreq_ctx *                                     rowreq_ctx){    DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaNetAddress_check_index", "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:426:M: |-> Check inetNetToMediaTable index inetNetToMediaNetAddress.     * check that index value in the table context (rowreq_ctx)     * for inetNetToMediaNetAddress is legal.     */    return MFD_SUCCESS;         /* inetNetToMediaNetAddress index ok */}                               /* inetNetToMediaNetAddress_check_index *//* * TODO:440:M: Implement inetNetToMediaTable node value checks. * TODO:450:M: Implement inetNetToMediaTable undo functions. * TODO:460:M: Implement inetNetToMediaTable set functions. * TODO:480:M: Implement inetNetToMediaTable commit functions. *//*--------------------------------------------------------------------- * IP-MIB::inetNetToMediaEntry.inetNetToMediaPhysAddress * inetNetToMediaPhysAddress is subid 4 of inetNetToMediaEntry. * Its status is Current, and its access level is Create. * OID: .1.3.6.1.2.1.4.35.1.4 * Description:The media-dependent `physical' 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  0      hasdefval 0 *   readable   1     iscolumn 1     ranges 1      hashint   1 *   settable   1 *   hint: 1x: * * Ranges:  0 - 65535; * * Its syntax is PhysAddress (based on perltype OCTETSTR) * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char) * This data type requires a length.  (Max 65535) *//** * Check that the proposed new value is potentially valid. * * @param rowreq_ctx *        Pointer to the row request context. * @param inetNetToMediaPhysAddress_val_ptr *        A char containing the new value. * @param inetNetToMediaPhysAddress_val_ptr_len *        The size (in bytes) of the data pointed to by inetNetToMediaPhysAddress_val_ptr * * @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 * inetNetToMediaTable_check_dependencies() function. * * The following checks have already been done for you: *    The syntax is ASN_OCTET_STR *    The length is in (one of) the range set(s):  0 - 65535 * * If there a no other checks you need to do, simply return MFD_SUCCESS. * */intinetNetToMediaPhysAddress_check_value(inetNetToMediaTable_rowreq_ctx *                                      rowreq_ctx, char                                      *inetNetToMediaPhysAddress_val_ptr, size_t                                      inetNetToMediaPhysAddress_val_ptr_len){    DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_check_value", "called\n"));    /** should never get a NULL pointer */    netsnmp_assert(NULL != rowreq_ctx);    netsnmp_assert(NULL != inetNetToMediaPhysAddress_val_ptr);    /*     * TODO:441:o: |-> Check for valid inetNetToMediaPhysAddress value.     */    return MFD_SUCCESS;         /* inetNetToMediaPhysAddress value not illegal */}                               /* inetNetToMediaPhysAddress_check_value *//** * Save old value information * * @param rowreq_ctx *        Pointer to the table context (inetNetToMediaTable_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 * inetNetToMediaTable_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. */intinetNetToMediaPhysAddress_undo_setup(inetNetToMediaTable_rowreq_ctx *                                     rowreq_ctx){    DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_undo_setup", "called\n"));    /** should never get a NULL pointer */    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:455:o: |-> Setup inetNetToMediaPhysAddress undo.     */    /*     * copy inetNetToMediaPhysAddress and inetNetToMediaPhysAddress_len data     * set rowreq_ctx->undo->inetNetToMediaPhysAddress from rowreq_ctx->data->inetNetToMediaPhysAddress     */    return MFD_SUCCESS;}                               /* inetNetToMediaPhysAddress_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 inetNetToMediaPhysAddress_val_ptr *        A char containing the new value. * @param inetNetToMediaPhysAddress_val_ptr_len *        The size (in bytes) of the data pointed to by inetNetToMediaPhysAddress_val_ptr */intinetNetToMediaPhysAddress_set(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,                              char *inetNetToMediaPhysAddress_val_ptr,                              size_t inetNetToMediaPhysAddress_val_ptr_len){    DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_set", "called\n"));    /** should never get a NULL pointer */    netsnmp_assert(NULL != rowreq_ctx);    netsnmp_assert(NULL != inetNetToMediaPhysAddress_val_ptr);    /*     * TODO:461:M: |-> Set inetNetToMediaPhysAddress value.     * set inetNetToMediaPhysAddress value in rowreq_ctx->data     */    return MFD_SUCCESS;}                               /* inetNetToMediaPhysAddress_set *//** * undo the previous set. * * @param rowreq_ctx *        Pointer to the users context. */intinetNetToMediaPhysAddress_undo(inetNetToMediaTable_rowreq_ctx * rowreq_ctx){    DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_undo", "called\n"));    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:456:o: |-> Clean up inetNetToMediaPhysAddress undo.     */    /*     * copy inetNetToMediaPhysAddress and inetNetToMediaPhysAddress_len data     * set rowreq_ctx->data->inetNetToMediaPhysAddress from rowreq_ctx->undo->inetNetToMediaPhysAddress     */    return MFD_SUCCESS;}                               /* inetNetToMediaPhysAddress_undo *//*--------------------------------------------------------------------- * 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) *//** * Check that the proposed new value is potentially valid. * * @param rowreq_ctx *        Pointer to the row request context. * @param inetNetToMediaType_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 * inetNetToMediaTable_check_dependencies() function. * * The following checks have already been done for you: *    The syntax is ASN_INTEGER *    The value is one of  other(1), invalid(2), dynamic(3), static(4), local(5) * * If there a no other checks you need to do, simply return MFD_SUCCESS. * */intinetNetToMediaType_check_value(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,                               u_long inetNetToMediaType_val){    DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_check_value", "called\n"));    /** should never get a NULL pointer */    netsnmp_assert(NULL != rowreq_ctx);    /*     * TODO:441:o: |-> Check for valid inetNetToMediaType value.     */    return MFD_SUCCESS;         /* inetNetToMediaType value not illegal */}                               /* inetNetToMediaType_check_value *//** * Save old value information * * @param rowreq_ctx *        Pointer to the table context (inetNetToMediaTable_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 * inetNetToMediaTable_undo_setup has been called. *

⌨️ 快捷键说明

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