📄 ipcidrroutetable_data_access.c
字号:
* Its status is Deprecated, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.24.4.1.1 * Description:The destination IP address of this route. This object may not take a Multicast (Class D) address value. Any assignment (implicit or otherwise) of an instance of this object to a value x must be rejected if the bitwise logical-AND of x with the value of the corresponding instance of the ipCidrRouteMask object is not equal to x. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is IPADDR (based on perltype IPADDR) * The net-snmp type is ASN_IPADDRESS. The C type decl is u_long (u_long) *//** * check validity of ipCidrRouteDest index portion * * @retval MFD_SUCCESS : the incoming value is legal * @retval MFD_ERROR : 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 * ipCidrRouteTable_validate_index() function. * * @note Also keep in mind that if the index refers to a row in this or * some other table, you can't check for that row here to make * decisions, since that row might not be created yet, but may * be created during the processing this request. If you have * such checks, they should be done in the check_dependencies * function, because any new/deleted/changed rows should be * available then. * * The following checks have already been done for you: * * If there a no other checks you need to do, simply return MFD_SUCCESS. */intipCidrRouteDest_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteDest_check_index", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteDest. * check that index value in the table context is legal. * (rowreq_ctx->tbl_index.ipCidrRouteDest) */ return MFD_SUCCESS; /* ipCidrRouteDest index ok */} /* ipCidrRouteDest_check_index *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMask * ipCidrRouteMask is subid 2 of ipCidrRouteEntry. * Its status is Deprecated, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.24.4.1.2 * Description:Indicate the mask to be logical-ANDed with the destination address before being compared to the value in the ipCidrRouteDest field. For those systems that do not support arbitrary subnet masks, an agent constructs the value of the ipCidrRouteMask by reference to the IP Address Class. Any assignment (implicit or otherwise) of an instance of this object to a value x must be rejected if the bitwise logical-AND of x with the value of the corresponding instance of the ipCidrRouteDest object is not equal to ipCidrRouteDest. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is IPADDR (based on perltype IPADDR) * The net-snmp type is ASN_IPADDRESS. The C type decl is u_long (u_long) *//** * check validity of ipCidrRouteMask index portion * * @retval MFD_SUCCESS : the incoming value is legal * @retval MFD_ERROR : 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 * ipCidrRouteTable_validate_index() function. * * @note Also keep in mind that if the index refers to a row in this or * some other table, you can't check for that row here to make * decisions, since that row might not be created yet, but may * be created during the processing this request. If you have * such checks, they should be done in the check_dependencies * function, because any new/deleted/changed rows should be * available then. * * The following checks have already been done for you: * * If there a no other checks you need to do, simply return MFD_SUCCESS. */intipCidrRouteMask_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMask_check_index", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteMask. * check that index value in the table context is legal. * (rowreq_ctx->tbl_index.ipCidrRouteMask) */ return MFD_SUCCESS; /* ipCidrRouteMask index ok */} /* ipCidrRouteMask_check_index *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteTos * ipCidrRouteTos is subid 3 of ipCidrRouteEntry. * Its status is Deprecated, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.24.4.1.3 * Description:The policy specifier is the IP TOS Field. The encoding of IP TOS is as specified by the following convention. Zero indicates the default path if no more specific policy applies. +-----+-----+-----+-----+-----+-----+-----+-----+ | | | | | PRECEDENCE | TYPE OF SERVICE | 0 | | | | | +-----+-----+-----+-----+-----+-----+-----+-----+ IP TOS IP TOS Field Policy Field Policy Contents Code Contents Code 0 0 0 0 ==> 0 0 0 0 1 ==> 2 0 0 1 0 ==> 4 0 0 1 1 ==> 6 0 1 0 0 ==> 8 0 1 0 1 ==> 10 0 1 1 0 ==> 12 0 1 1 1 ==> 14 1 0 0 0 ==> 16 1 0 0 1 ==> 18 1 0 1 0 ==> 20 1 0 1 1 ==> 22 1 1 0 0 ==> 24 1 1 0 1 ==> 26 1 1 1 0 ==> 28 1 1 1 1 ==> 30 * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 1 hashint 0 * settable 0 * * Ranges: 0 - 2147483647; * * Its syntax is INTEGER32 (based on perltype INTEGER32) * The net-snmp type is ASN_INTEGER. The C type decl is long (long) *//** * check validity of ipCidrRouteTos index portion * * @retval MFD_SUCCESS : the incoming value is legal * @retval MFD_ERROR : 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 * ipCidrRouteTable_validate_index() function. * * @note Also keep in mind that if the index refers to a row in this or * some other table, you can't check for that row here to make * decisions, since that row might not be created yet, but may * be created during the processing this request. If you have * such checks, they should be done in the check_dependencies * function, because any new/deleted/changed rows should be * available then. * * The following checks have already been done for you: * 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. */intipCidrRouteTos_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTos_check_index", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteTos. * check that index value in the table context is legal. * (rowreq_ctx->tbl_index.ipCidrRouteTos) */ return MFD_SUCCESS; /* ipCidrRouteTos index ok */} /* ipCidrRouteTos_check_index *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteNextHop * ipCidrRouteNextHop is subid 4 of ipCidrRouteEntry. * Its status is Deprecated, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.24.4.1.4 * Description:On remote routes, the address of the next system en route; Otherwise, 0.0.0.0. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is IPADDR (based on perltype IPADDR) * The net-snmp type is ASN_IPADDRESS. The C type decl is u_long (u_long) *//** * check validity of ipCidrRouteNextHop index portion * * @retval MFD_SUCCESS : the incoming value is legal * @retval MFD_ERROR : 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 * ipCidrRouteTable_validate_index() function. * * @note Also keep in mind that if the index refers to a row in this or * some other table, you can't check for that row here to make * decisions, since that row might not be created yet, but may * be created during the processing this request. If you have * such checks, they should be done in the check_dependencies * function, because any new/deleted/changed rows should be * available then. * * The following checks have already been done for you: * * If there a no other checks you need to do, simply return MFD_SUCCESS. */intipCidrRouteNextHop_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHop_check_index", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteNextHop. * check that index value in the table context is legal. * (rowreq_ctx->tbl_index.ipCidrRouteNextHop) */ return MFD_SUCCESS; /* ipCidrRouteNextHop index ok */} /* ipCidrRouteNextHop_check_index *//** * 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. * * All of the individual index validation functions have been called, so this * is the place to make sure they are valid as a whole when combined. If * you only have one index, then you probably don't need to do anything else * here. * * @note Keep in mind that if the indexes refer to a row in this or * some other table, you can't check for that row here to make * decisions, since that row might not be created yet, but may * be created during the processing this request. If you have * such checks, they should be done in the check_dependencies * function, because any new/deleted/changed rows should be * available then. * * * @param ipCidrRouteTable_reg * Pointer to the user registration data * @param rowreq_ctx * Pointer to the users context. * @retval MFD_SUCCESS : success * @retval MFD_CANNOT_CREATE_NOW : index not valid right now * @retval MFD_CANNOT_CREATE_EVER : index never valid */intipCidrRouteTable_validate_index(ipCidrRouteTable_registration * ipCidrRouteTable_reg, ipCidrRouteTable_rowreq_ctx * rowreq_ctx){ int rc = MFD_SUCCESS; DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_validate_index", "called\n")); /** we should have a non-NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:430:M: |-> Validate potential ipCidrRouteTable index. */ if (1) { snmp_log(LOG_WARNING, "invalid index for a new row in the " "ipCidrRouteTable table.\n"); /* * determine failure type. * * If the index could not ever be created, return MFD_NOT_EVER * If the index can not be created under the present circumstances * (even though it could be created under other circumstances), * return MFD_NOT_NOW. */ if (0) { return MFD_CANNOT_CREATE_EVER; } else { return MFD_CANNOT_CREATE_NOW; } } return rc;} /* ipCidrRouteTable_validate_index *//** @} */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -