📄 inetcidrroutetable_interface.c
字号:
* inetCidrRouteMetric1(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_INETCIDRROUTEMETRIC1: rc = netsnmp_check_vb_type(var, ASN_INTEGER); /* * yyy-rks: anything else we can do here? */ if (SNMPERR_SUCCESS == rc) { rc = inetCidrRouteMetric1_check_value(rowreq_ctx, *((long *) var->val. string)); if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) && (MFD_NOT_VALID_NOW != rc)) { snmp_log(LOG_ERR, "bad rc %d from inetCidrRouteMetric1_check_value\n", rc); rc = SNMP_ERR_GENERR; } } break; /* * inetCidrRouteMetric2(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_INETCIDRROUTEMETRIC2: rc = netsnmp_check_vb_type(var, ASN_INTEGER); /* * yyy-rks: anything else we can do here? */ if (SNMPERR_SUCCESS == rc) { rc = inetCidrRouteMetric2_check_value(rowreq_ctx, *((long *) var->val. string)); if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) && (MFD_NOT_VALID_NOW != rc)) { snmp_log(LOG_ERR, "bad rc %d from inetCidrRouteMetric2_check_value\n", rc); rc = SNMP_ERR_GENERR; } } break; /* * inetCidrRouteMetric3(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_INETCIDRROUTEMETRIC3: rc = netsnmp_check_vb_type(var, ASN_INTEGER); /* * yyy-rks: anything else we can do here? */ if (SNMPERR_SUCCESS == rc) { rc = inetCidrRouteMetric3_check_value(rowreq_ctx, *((long *) var->val. string)); if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) && (MFD_NOT_VALID_NOW != rc)) { snmp_log(LOG_ERR, "bad rc %d from inetCidrRouteMetric3_check_value\n", rc); rc = SNMP_ERR_GENERR; } } break; /* * inetCidrRouteMetric4(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_INETCIDRROUTEMETRIC4: rc = netsnmp_check_vb_type(var, ASN_INTEGER); /* * yyy-rks: anything else we can do here? */ if (SNMPERR_SUCCESS == rc) { rc = inetCidrRouteMetric4_check_value(rowreq_ctx, *((long *) var->val. string)); if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) && (MFD_NOT_VALID_NOW != rc)) { snmp_log(LOG_ERR, "bad rc %d from inetCidrRouteMetric4_check_value\n", rc); rc = SNMP_ERR_GENERR; } } break; /* * inetCidrRouteMetric5(16)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_INETCIDRROUTEMETRIC5: rc = netsnmp_check_vb_type(var, ASN_INTEGER); /* * yyy-rks: anything else we can do here? */ if (SNMPERR_SUCCESS == rc) { rc = inetCidrRouteMetric5_check_value(rowreq_ctx, *((long *) var->val. string)); if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) && (MFD_NOT_VALID_NOW != rc)) { snmp_log(LOG_ERR, "bad rc %d from inetCidrRouteMetric5_check_value\n", rc); rc = SNMP_ERR_GENERR; } } break; /* * inetCidrRouteStatus(17)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_INETCIDRROUTESTATUS: rc = netsnmp_check_vb_rowstatus_value(var); if (SNMPERR_SUCCESS == rc) { rc = inetCidrRouteStatus_check_value(rowreq_ctx, *((u_long *) var->val. string)); if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) && (MFD_NOT_VALID_NOW != rc)) { snmp_log(LOG_ERR, "bad rc %d from inetCidrRouteStatus_check_value\n", rc); rc = SNMP_ERR_GENERR; } } break; default: /** We shouldn't get here */ rc = SNMP_ERR_GENERR; snmp_log(LOG_ERR, "unknown column %d in _inetCidrRouteTable_check_column\n", column); } return rc;} /* _inetCidrRouteTable_check_column */int_mfd_inetCidrRouteTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests){ inetCidrRouteTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; int rc; DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_check_objects", "called\n")); netsnmp_assert(NULL != rowreq_ctx); for (; requests; requests = requests->next) { /* * get column number from table request info, and check that column */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _inetCidrRouteTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum); if (rc) { netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc)); break; } } /* for results */ return SNMP_ERR_NOERROR;} /* _mfd_inetCidrRouteTable_check_objects */NETSNMP_STATIC_INLINE int_inetCidrRouteTable_check_indexes(inetCidrRouteTable_rowreq_ctx * rowreq_ctx){ int rc; DEBUGMSGTL(("internal:inetCidrRouteTable:_inetCidrRouteTable_check_indexes", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * (INDEX) inetCidrRouteDestType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h */ rc = inetCidrRouteDestType_check_index(rowreq_ctx); if (MFD_SUCCESS != rc) return SNMP_ERR_NOCREATION; /* * (INDEX) inetCidrRouteDest(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h */ rc = inetCidrRouteDest_check_index(rowreq_ctx); if (MFD_SUCCESS != rc) return SNMP_ERR_NOCREATION; /* * (INDEX) inetCidrRoutePfxLen(3)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H */ rc = inetCidrRoutePfxLen_check_index(rowreq_ctx); if (MFD_SUCCESS != rc) return SNMP_ERR_NOCREATION; /* * (INDEX) inetCidrRoutePolicy(4)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h */ rc = inetCidrRoutePolicy_check_index(rowreq_ctx); if (MFD_SUCCESS != rc) return SNMP_ERR_NOCREATION; /* * (INDEX) inetCidrRouteNextHopType(5)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h */ rc = inetCidrRouteNextHopType_check_index(rowreq_ctx); if (MFD_SUCCESS != rc) return SNMP_ERR_NOCREATION; /* * (INDEX) inetCidrRouteNextHop(6)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h */ rc = inetCidrRouteNextHop_check_index(rowreq_ctx); if (MFD_SUCCESS != rc) return SNMP_ERR_NOCREATION; /* * if individual parts look ok, check them as a whole */ return inetCidrRouteTable_validate_index(rowreq_ctx-> inetCidrRouteTable_reg, rowreq_ctx);} /* _inetCidrRouteTable_check_indexes *//*---------------------------------------------------------------------- * * SET: Undo setup * *---------------------------------------------------------------------*//* * @internal * Set the value for a particular column */NETSNMP_STATIC_INLINE int_inetCidrRouteTable_undo_setup_column(inetCidrRouteTable_rowreq_ctx * rowreq_ctx, int column){ int rc = SNMPERR_SUCCESS; DEBUGMSGTL(("internal:inetCidrRouteTable:_inetCidrRouteTable_undo_setup_column", "called\n")); netsnmp_assert(NULL != rowreq_ctx); switch (column) { /* * inetCidrRouteIfIndex(7)/InterfaceIndexOrZero/ASN_INTEGER/long(long)//l/A/W/e/R/d/H */ case COLUMN_INETCIDRROUTEIFINDEX: rowreq_ctx->column_set_flags |= FLAG_INETCIDRROUTEIFINDEX; rc = inetCidrRouteIfIndex_undo_setup(rowreq_ctx); break; /* * inetCidrRouteType(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_INETCIDRROUTETYPE: rowreq_ctx->column_set_flags |= FLAG_INETCIDRROUTETYPE; rc = inetCidrRouteType_undo_setup(rowreq_ctx); break; /* * inetCidrRouteNextHopAS(11)/InetAutonomousSystemNumber/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/D/H */ case COLUMN_INETCIDRROUTENEXTHOPAS: rowreq_ctx->column_set_flags |= FLAG_INETCIDRROUTENEXTHOPAS; rc = inetCidrRouteNextHopAS_undo_setup(rowreq_ctx); break; /* * inetCidrRouteMetric1(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_INETCIDRROUTEMETRIC1: rowreq_ctx->column_set_flags |= FLAG_INETCIDRROUTEMETRIC1; rc = inetCidrRouteMetric1_undo_setup(rowreq_ctx); break; /* * inetCidrRouteMetric2(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_INETCIDRROUTEMETRIC2: rowreq_ctx->column_set_flags |= FLAG_INETCIDRROUTEMETRIC2; rc = inetCidrRouteMetric2_undo_setup(rowreq_ctx); break; /* * inetCidrRouteMetric3(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_INETCIDRROUTEMETRIC3: rowreq_ctx->column_set_flags |= FLAG_INETCIDRROUTEMETRIC3; rc = inetCidrRouteMetric3_undo_setup(rowreq_ctx); break; /* * inetCidrRouteMetric4(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_INETCIDRROUTEMETRIC4: rowreq_ctx->column_set_flags |= FLAG_INETCIDRROUTEMETRIC4; rc = inetCidrRouteMetric4_undo_setup(rowreq_ctx); break; /* * inetCidrRouteMetric5(16)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_INETCIDRROUTEMETRIC5: rowreq_ctx->column_set_flags |= FLAG_INETCIDRROUTEMETRIC5; rc = inetCidrRouteMetric5_undo_setup(rowreq_ctx); break; /* * inetCidrRouteStatus(17)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_INETCIDRROUTESTATUS: rowreq_ctx->column_set_flags |= FLAG_INETCIDRROUTESTATUS; rc = inetCidrRouteStatus_undo_setup(rowreq_ctx); break; default: snmp_log(LOG_ERR, "unknown column %d in _inetCidrRouteTable_undo_setup_column\n", column); break; } return rc;} /* _inetCidrRouteTable_undo_setup_column *//** * @internal * undo setup */int_mfd_inetCidrRouteTable_undo_setup(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests){ int rc; inetCidrRouteTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_undo_setup", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * allocate undo context */ rowreq_ctx->undo = inetCidrRouteTable_allocate_data(); if (NULL == rowreq_ctx->undo) { /** msg already logged */ netsnmp_request_set_error_all(requests,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -