📄 inetcidrroutetable.c
字号:
the inetCidrRouteDestType object. The values for the index objects inetCidrRouteDest and inetCidrRoutePfxLen must be consistent. When the value of inetCidrRouteDest (excluding the zone index, if one is present) is x, then the bitwise logical-AND of x with the value of the mask formed from the corresponding index object inetCidrRoutePfxLen MUST be equal to x. If not, then the index pair is not consistent and an inconsistentName error must be returned on SET or CREATE requests. * * 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 inetCidrRouteDest IS NOT ACCESSIBLE * * *//** * check validity of inetCidrRouteDest 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 * inetCidrRouteTable_validate_index() function. */intinetCidrRouteDest_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteDest_check_index", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRouteDest. * check that index value in the table context (rowreq_ctx) * for inetCidrRouteDest is legal. */ return MFD_SUCCESS; /* inetCidrRouteDest index ok */} /* inetCidrRouteDest_check_index *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRoutePfxLen * inetCidrRoutePfxLen is subid 3 of inetCidrRouteEntry. * Its status is Current, and its access level is NoAccess. * OID: .1.3.6.1.2.1.4.24.7.1.3 * Description:Indicates the number of leading one bits which form the mask to be logical-ANDed with the destination address before being compared to the value in the inetCidrRouteDest field. The values for the index objects inetCidrRouteDest and inetCidrRoutePfxLen must be consistent. When the value of inetCidrRouteDest (excluding the zone index, if one is present) is x, then the bitwise logical-AND of x with the value of the mask formed from the corresponding index object inetCidrRoutePfxLen MUST be equal to x. If not, then the index pair is not consistent and an inconsistentName error must be returned on SET or CREATE requests. * * Attributes: * accessible 0 isscalar 0 enums 0 hasdefval 0 * readable 0 iscolumn 1 ranges 1 hashint 1 * settable 0 * hint: d * * Ranges: 0 - 2040; * * Its syntax is InetAddressPrefixLength (based on perltype UNSIGNED32) * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long) * * * * NOTE: NODE inetCidrRoutePfxLen IS NOT ACCESSIBLE * * *//** * check validity of inetCidrRoutePfxLen 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 * inetCidrRouteTable_validate_index() function. */intinetCidrRoutePfxLen_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRoutePfxLen_check_index", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRoutePfxLen. * check that index value in the table context (rowreq_ctx) * for inetCidrRoutePfxLen is legal. */ return MFD_SUCCESS; /* inetCidrRoutePfxLen index ok */} /* inetCidrRoutePfxLen_check_index *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRoutePolicy * inetCidrRoutePolicy is subid 4 of inetCidrRouteEntry. * Its status is Current, and its access level is NoAccess. * OID: .1.3.6.1.2.1.4.24.7.1.4 * Description:This object is an opaque object without any defined semantics. Its purpose is to serve as an additional index which may delineate between multiple entries to the same destination. The value { 0 0 } shall be used as the default value for this object. * * Attributes: * accessible 0 isscalar 0 enums 0 hasdefval 0 * readable 0 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 2040) * * * * NOTE: NODE inetCidrRoutePolicy IS NOT ACCESSIBLE * * *//** * check validity of inetCidrRoutePolicy 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 * inetCidrRouteTable_validate_index() function. */intinetCidrRoutePolicy_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRoutePolicy_check_index", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRoutePolicy. * check that index value in the table context (rowreq_ctx) * for inetCidrRoutePolicy is legal. */ return MFD_SUCCESS; /* inetCidrRoutePolicy index ok */} /* inetCidrRoutePolicy_check_index *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteNextHopType * inetCidrRouteNextHopType is subid 5 of inetCidrRouteEntry. * Its status is Current, and its access level is NoAccess. * OID: .1.3.6.1.2.1.4.24.7.1.5 * Description:The type of the inetCidrRouteNextHop address, as defined in the InetAddress MIB. Value should be set to unknown(0) for non-remote routes. Only those address types that may appear in an actual routing table are allowed as values of this object. * * Attributes: * accessible 0 isscalar 0 enums 1 hasdefval 0 * readable 0 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 5/8. Values: unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16) * * Its syntax is InetAddressType (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) * * * * NOTE: NODE inetCidrRouteNextHopType IS NOT ACCESSIBLE * * *//** * check validity of inetCidrRouteNextHopType 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 * inetCidrRouteTable_validate_index() function. */intinetCidrRouteNextHopType_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteNextHopType_check_index", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRouteNextHopType. * check that index value in the table context (rowreq_ctx) * for inetCidrRouteNextHopType is legal. */ return MFD_SUCCESS; /* inetCidrRouteNextHopType index ok */} /* inetCidrRouteNextHopType_check_index *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteNextHop * inetCidrRouteNextHop is subid 6 of inetCidrRouteEntry. * Its status is Current, and its access level is NoAccess. * OID: .1.3.6.1.2.1.4.24.7.1.6 * Description:On remote routes, the address of the next system en route. For non-remote routes, a zero length string. The type of this address is determined by the value of the inetCidrRouteNextHopType object. * * 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 inetCidrRouteNextHop IS NOT ACCESSIBLE * * *//** * check validity of inetCidrRouteNextHop 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 * inetCidrRouteTable_validate_index() function. */intinetCidrRouteNextHop_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteNextHop_check_index", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRouteNextHop. * check that index value in the table context (rowreq_ctx) * for inetCidrRouteNextHop is legal. */ return MFD_SUCCESS; /* inetCidrRouteNextHop index ok */} /* inetCidrRouteNextHop_check_index *//* * TODO:440:M: Implement inetCidrRouteTable node value checks. * TODO:450:M: Implement inetCidrRouteTable undo functions. * TODO:460:M: Implement inetCidrRouteTable set functions. * TODO:480:M: Implement inetCidrRouteTable commit functions. *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteIfIndex * inetCidrRouteIfIndex is subid 7 of inetCidrRouteEntry. * Its status is Current, and its access level is Create. * OID: .1.3.6.1.2.1.4.24.7.1.7 * Description:The ifIndex value which identifies the local interface through which the next hop of this route should be reached. A value of 0 is valid and represents the scenario where no interface is specified. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 1 * settable 1 * hint: d * * Ranges: 0 - 2147483647; * * Its syntax is InterfaceIndexOrZero (based on perltype INTEGER32) * The net-snmp type is ASN_INTEGER. The C type decl is long (long) *//** * Check that the proposed new value is potentially valid. * * @param rowreq_ctx * Pointer to the row request context. * @param inetCidrRouteIfIndex_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 * inetCidrRouteTable_check_dependencies() function. * * The following checks have already been done for you: * The syntax is ASN_INTEGER * The value is in (one of) the range set(s): 0 - 2147483647 * * If there a no other checks you need to do, simply return MFD_SUCCESS. * */intinetCidrRouteIfIndex_check_value(inetCidrRouteTable_rowreq_ctx * rowreq_ctx, long inetCidrRouteIfIndex_val){ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteIfIndex_check_value", "called\n")); /** should never get a NULL pointer */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -