📄 ipcidrroutetable.c
字号:
* @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 * ipCidrRouteTable_validate_index() function. */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 (rowreq_ctx) * for ipCidrRouteDest is legal. */ 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_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 * ipCidrRouteTable_validate_index() function. */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 (rowreq_ctx) * for ipCidrRouteMask is legal. */ 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_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 * ipCidrRouteTable_validate_index() function. */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 (rowreq_ctx) * for ipCidrRouteTos is legal. */ 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_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 * ipCidrRouteTable_validate_index() function. */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 (rowreq_ctx) * for ipCidrRouteNextHop is legal. */ return MFD_SUCCESS; /* ipCidrRouteNextHop index ok */} /* ipCidrRouteNextHop_check_index *//* * TODO:440:M: Implement ipCidrRouteTable node value checks. * TODO:450:M: Implement ipCidrRouteTable undo functions. * TODO:460:M: Implement ipCidrRouteTable set functions. * TODO:480:M: Implement ipCidrRouteTable commit functions. *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteIfIndex * ipCidrRouteIfIndex is subid 5 of ipCidrRouteEntry. * Its status is Deprecated, and its access level is Create. * OID: .1.3.6.1.2.1.4.24.4.1.5 * Description:The ifIndex value which identifies the local interface through which the next hop of this route should be reached. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 1 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * defval: 0 * * * Its syntax is INTEGER32 (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 ipCidrRouteIfIndex_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 * ipCidrRouteTable_check_dependencies() function. * * The following checks have already been done for you: * The syntax is ASN_INTEGER * * If there a no other checks you need to do, simply return MFD_SUCCESS. * */intipCidrRouteIfIndex_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx, long ipCidrRouteIfIndex_val){ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_check_value", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:441:o: |-> Check for valid ipCidrRouteIfIndex value. */ return MFD_SUCCESS; /* ipCidrRouteIfIndex value not illegal */} /* ipCidrRouteIfIndex_check_value *//** * Save old value information * * @param rowreq_ctx * Pointer to the table context (ipCidrRouteTable_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 * ipCidrRouteTable_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. */intipCidrRouteIfIndex_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_undo_setup", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:455:o: |-> Setup ipCidrRouteIfIndex undo. */ /* * copy ipCidrRouteIfIndex data * set rowreq_ctx->undo->ipCidrRouteIfIndex from rowreq_ctx->data->ipCidrRouteIfIndex */ return MFD_SUCCESS;} /* ipCidrRouteIfIndex_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 ipCidrRouteIfIndex_val * A long containing the new value. */intipCidrRouteIfIndex_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx, long ipCidrRouteIfIndex_val){ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_set", "called\n")); /** should never get a NULL pointer */ netsnmp_assert(NULL != rowreq_ctx); /* * TODO:461:M: |-> Set ipCidrRouteIfIndex value. * set ipCidrRouteIfIndex value in rowreq_ctx->data */ return MFD_SUCCESS;} /* ipCidrRouteIfIndex_set *//** * undo the previous set. * * @param rowreq_ctx * Pointer to the users context. */intipCidrRouteIfIndex_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx){ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_undo", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:456:o: |-> Clean up ipCidrRouteIfIndex undo. */ /* * copy ipCidrRouteIfIndex data * set rowreq_ctx->data->ipCidrRouteIfIndex from rowreq_ctx->undo->ipCidrRouteIfIndex */ return MFD_SUCCESS;} /* ipCidrRouteIfIndex_undo *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteType * ipCidrRouteType is subid 6 of ipCidrRouteEntry. * Its status is Deprecated, and its access level is Create. * OID: .1.3.6.1.2.1.4.24.4.1.6 * Description:The type of route. Note that local(3) refers to a route for which the next hop is the final destination; remote(4) refers to a route for which the next hop is
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -