📄 ipcidrroutetable.c
字号:
* 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) *//** * Extract the current value of the ipCidrRouteIfIndex data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipCidrRouteIfIndex_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 */intipCidrRouteIfIndex_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx, long *ipCidrRouteIfIndex_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipCidrRouteIfIndex_val_ptr); DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipCidrRouteIfIndex data. * copy (* ipCidrRouteIfIndex_val_ptr ) from rowreq_ctx->data */ (*ipCidrRouteIfIndex_val_ptr) = rowreq_ctx->data->if_index; return MFD_SUCCESS;} /* ipCidrRouteIfIndex_get *//*--------------------------------------------------------------------- * 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 not the final destination. Routes which do not result in traffic forwarding or rejection should not be displayed even if the implementation keeps them stored internally. reject (2) refers to a route which, if matched, discards the message as unreachable. This is used in some protocols as a means of correctly aggregating routes. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * Enum range: 3/8. Values: other(1), reject(2), local(3), remote(4) * * 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 ipCidrRouteType data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipCidrRouteType_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 */intipCidrRouteType_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx, u_long * ipCidrRouteType_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipCidrRouteType_val_ptr); DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipCidrRouteType data. * copy (* ipCidrRouteType_val_ptr ) from rowreq_ctx->data */ (*ipCidrRouteType_val_ptr) = rowreq_ctx->data->rt_type; return MFD_SUCCESS;} /* ipCidrRouteType_get *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteProto * ipCidrRouteProto is subid 7 of ipCidrRouteEntry. * Its status is Deprecated, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.24.4.1.7 * Description:The routing mechanism via which this route was learned. Inclusion of values for gateway routing protocols is not intended to imply that hosts should support those protocols. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 11/16. Values: other(1), local(2), netmgmt(3), icmp(4), egp(5), ggp(6), hello(7), rip(8), isIs(9), esIs(10), ciscoIgrp(11), bbnSpfIgp(12), ospf(13), bgp(14), idpr(15), ciscoEigrp(16) * * 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 ipCidrRouteProto data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipCidrRouteProto_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 */intipCidrRouteProto_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx, u_long * ipCidrRouteProto_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipCidrRouteProto_val_ptr); DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteProto_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipCidrRouteProto data. * copy (* ipCidrRouteProto_val_ptr ) from rowreq_ctx->data */ (*ipCidrRouteProto_val_ptr) = rowreq_ctx->data->rt_proto; return MFD_SUCCESS;} /* ipCidrRouteProto_get *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteAge * ipCidrRouteAge is subid 8 of ipCidrRouteEntry. * Its status is Deprecated, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.24.4.1.8 * Description:The number of seconds since this route was last updated or otherwise determined to be correct. Note that no semantics of `too old' can be implied except through knowledge of the routing protocol by which the route was learned. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 1 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * defval: 0 * * * Its syntax is INTEGER32 (based on perltype INTEGER32) * The net-snmp type is ASN_INTEGER. The C type decl is long (long) *//** * Extract the current value of the ipCidrRouteAge data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipCidrRouteAge_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 */intipCidrRouteAge_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx, long *ipCidrRouteAge_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipCidrRouteAge_val_ptr); DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteAge_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipCidrRouteAge data. * copy (* ipCidrRouteAge_val_ptr ) from rowreq_ctx->data */ /* * TODO:235:M: |-> Remove log message/SKIP once you've set ipCidrRouteAge data */ return MFD_SKIP; return MFD_SUCCESS;} /* ipCidrRouteAge_get *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteInfo * ipCidrRouteInfo is subid 9 of ipCidrRouteEntry. * Its status is Deprecated, and its access level is Create. * OID: .1.3.6.1.2.1.4.24.4.1.9 * Description:A reference to MIB definitions specific to the particular routing protocol which is responsible for this route, as determined by the value specified in the route's ipCidrRouteProto value. If this information is not present, its value should be set to the OBJECT IDENTIFIER { 0 0 }, which is a syntactically valid object identifier, and any implementation conforming to ASN.1 and the Basic Encoding Rules must be able to generate and recognize this value. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * * * 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 ) *//** * Extract the current value of the ipCidrRouteInfo data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipCidrRouteInfo_val_ptr_ptr * Pointer to storage for a oid variable * @param ipCidrRouteInfo_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by ipCidrRouteInfo. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error* * @note If you need more than (*ipCidrRouteInfo_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update ipCidrRouteInfo_val_ptr_ptr. * <b>DO NOT</b> free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */intipCidrRouteInfo_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx, oid ** ipCidrRouteInfo_val_ptr_ptr, size_t * ipCidrRouteInfo_val_ptr_len_ptr){ /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != ipCidrRouteInfo_val_ptr_ptr) && (NULL != *ipCidrRouteInfo_val_ptr_ptr)); netsnmp_assert(NULL != ipCidrRouteInfo_val_ptr_len_ptr); DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipCidrRouteInfo data. * copy (* ipCidrRouteInfo_val_ptr_ptr ) data and (* ipCidrRouteInfo_val_ptr_len_ptr ) from rowreq_ctx->data */ /** nullOidLen is in bytes, so not sizeof(oid) needed */ if ((*ipCidrRouteInfo_val_ptr_len_ptr) < nullOidLen) { (*ipCidrRouteInfo_val_ptr_ptr) = malloc(nullOidLen); if (NULL == (*ipCidrRouteInfo_val_ptr_ptr)) return MFD_ERROR; } (*ipCidrRouteInfo_val_ptr_len_ptr) = nullOidLen; memcpy((*ipCidrRouteInfo_val_ptr_ptr), nullOid, nullOidLen); return MFD_SUCCESS;} /* ipCidrRouteInfo_get *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteNextHopAS * ipCidrRouteNextHopAS is subid 10 of ipCidrRouteEntry. * Its status is Deprecated, and its access level is Create. * OID: .1.3.6.1.2.1.4.24.4.1.10 * Description:The Autonomous System Number of the Next Hop. The semantics of this object are determined by the routing- protocol specified in the route's ipCidrRouteProto value. When this object is unknown or not relevant its value should be set to zero. * * 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) *//** * Extract the current value of the ipCidrRouteNextHopAS data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipCidrRouteNextHopAS_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 */intipCidrRouteNextHopAS_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx, long *ipCidrRouteNextHopAS_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipCidrRouteNextHopAS_val_ptr); DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipCidrRouteNextHopAS data. * copy (* ipCidrRouteNextHopAS_val_ptr ) from rowreq_ctx->data */ (*ipCidrRouteNextHopAS_val_ptr) = rowreq_ctx->data->rt_nexthop_as; return MFD_SUCCESS;} /* ipCidrRouteNextHopAS_get *//*--------------------------------------------------------------------- * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric1 * ipCidrRouteMetric1 is subid 11 of ipCidrRouteEntry. * Its status is Deprecated, and its access level is Create. * OID: .1.3.6.1.2.1.4.24.4.1.11 * Description:The primary routing metric for this route. The semantics of this metric are determined by the routing- protocol specified in the route's ipCidrRouteProto value. If this metric is not used, its value should be
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -