📄 ipcidrroutetable_interface.c
字号:
* ipCidrRouteType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_IPCIDRROUTETYPE: if (var->val_len != sizeof(u_long)) { rc = SNMP_ERR_WRONGLENGTH; snmp_log(LOG_ERR, "varbind size of %d does not match expected size %d\n", var->val_len, sizeof(u_long)); break; } rowreq_ctx->column_set_flags |= FLAG_IPCIDRROUTETYPE; rc = ipCidrRouteType_set(rowreq_ctx, *((u_long *) var->val.string)); break; /* * ipCidrRouteInfo(9)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h */ case COLUMN_IPCIDRROUTEINFO: rowreq_ctx->column_set_flags |= FLAG_IPCIDRROUTEINFO; rc = ipCidrRouteInfo_set(rowreq_ctx, (oid *) var->val.string, var->val_len); break; /* * ipCidrRouteNextHopAS(10)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTENEXTHOPAS: if (var->val_len != sizeof(long)) { rc = SNMP_ERR_WRONGLENGTH; snmp_log(LOG_ERR, "varbind size of %d does not match expected size %d\n", var->val_len, sizeof(long)); break; } rowreq_ctx->column_set_flags |= FLAG_IPCIDRROUTENEXTHOPAS; rc = ipCidrRouteNextHopAS_set(rowreq_ctx, *((long *) var->val.string)); break; /* * ipCidrRouteMetric1(11)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEMETRIC1: if (var->val_len != sizeof(long)) { rc = SNMP_ERR_WRONGLENGTH; snmp_log(LOG_ERR, "varbind size of %d does not match expected size %d\n", var->val_len, sizeof(long)); break; } rowreq_ctx->column_set_flags |= FLAG_IPCIDRROUTEMETRIC1; rc = ipCidrRouteMetric1_set(rowreq_ctx, *((long *) var->val.string)); break; /* * ipCidrRouteMetric2(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEMETRIC2: if (var->val_len != sizeof(long)) { rc = SNMP_ERR_WRONGLENGTH; snmp_log(LOG_ERR, "varbind size of %d does not match expected size %d\n", var->val_len, sizeof(long)); break; } rowreq_ctx->column_set_flags |= FLAG_IPCIDRROUTEMETRIC2; rc = ipCidrRouteMetric2_set(rowreq_ctx, *((long *) var->val.string)); break; /* * ipCidrRouteMetric3(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEMETRIC3: if (var->val_len != sizeof(long)) { rc = SNMP_ERR_WRONGLENGTH; snmp_log(LOG_ERR, "varbind size of %d does not match expected size %d\n", var->val_len, sizeof(long)); break; } rowreq_ctx->column_set_flags |= FLAG_IPCIDRROUTEMETRIC3; rc = ipCidrRouteMetric3_set(rowreq_ctx, *((long *) var->val.string)); break; /* * ipCidrRouteMetric4(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEMETRIC4: if (var->val_len != sizeof(long)) { rc = SNMP_ERR_WRONGLENGTH; snmp_log(LOG_ERR, "varbind size of %d does not match expected size %d\n", var->val_len, sizeof(long)); break; } rowreq_ctx->column_set_flags |= FLAG_IPCIDRROUTEMETRIC4; rc = ipCidrRouteMetric4_set(rowreq_ctx, *((long *) var->val.string)); break; /* * ipCidrRouteMetric5(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEMETRIC5: if (var->val_len != sizeof(long)) { rc = SNMP_ERR_WRONGLENGTH; snmp_log(LOG_ERR, "varbind size of %d does not match expected size %d\n", var->val_len, sizeof(long)); break; } rowreq_ctx->column_set_flags |= FLAG_IPCIDRROUTEMETRIC5; rc = ipCidrRouteMetric5_set(rowreq_ctx, *((long *) var->val.string)); break; /* * ipCidrRouteStatus(16)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_IPCIDRROUTESTATUS: if (var->val_len != sizeof(u_long)) { rc = SNMP_ERR_WRONGLENGTH; snmp_log(LOG_ERR, "varbind size of %d does not match expected size %d\n", var->val_len, sizeof(u_long)); break; } rowreq_ctx->column_set_flags |= FLAG_IPCIDRROUTESTATUS; rc = ipCidrRouteStatus_set(rowreq_ctx, *((u_long *) var->val.string)); break; default: snmp_log(LOG_ERR, "unknown column %d in _ipCidrRouteTable_set_column\n", column); break; } return rc;} /* _ipCidrRouteTable_set_column */int_mfd_ipCidrRouteTable_set_values(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests){ ipCidrRouteTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; int rc = SNMP_ERR_NOERROR; DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_set_values", "called\n")); netsnmp_assert(NULL != rowreq_ctx); rowreq_ctx->column_set_flags = 0; for (; requests; requests = requests->next) { /* * set column data */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _ipCidrRouteTable_set_column(rowreq_ctx, requests->requestvb, tri->colnum); if (MFD_SUCCESS != rc) { DEBUGMSGTL(("verbose:ipCidrRouteTable:mfd", "error %d from " "ipCidrRouteTable_set_column\n", rc)); netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc)); } } /* for results */ return SNMP_ERR_NOERROR;} /* _mfd_ipCidrRouteTable_set_values *//*---------------------------------------------------------------------- * * SET: commit * *---------------------------------------------------------------------*//** * @internal * commit the values */int_mfd_ipCidrRouteTable_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests){ int rc; ipCidrRouteTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_commit", "called\n")); netsnmp_assert(NULL != rowreq_ctx); rc = ipCidrRouteTable_commit(rowreq_ctx); if (MFD_SUCCESS != rc) { DEBUGMSGTL(("verbose:ipCidrRouteTable:mfd", "error %d from " "ipCidrRouteTable_commit\n", rc)); netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); } return SNMP_ERR_NOERROR;}int_mfd_ipCidrRouteTable_undo_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests){ int rc; ipCidrRouteTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_undo_commit", "called\n")); netsnmp_assert(NULL != rowreq_ctx); rc = ipCidrRouteTable_undo_commit(rowreq_ctx); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("verbose:ipCidrRouteTable:mfd", "error %d from " "ipCidrRouteTable_undo_commit\n", rc)); } return SNMP_ERR_NOERROR;} /* _mfd_ipCidrRouteTable_commit *//*---------------------------------------------------------------------- * * SET: Undo * *---------------------------------------------------------------------*//** * @internal * undo the value for a particular column */NETSNMP_STATIC_INLINE int_ipCidrRouteTable_undo_column(ipCidrRouteTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column){ int rc = SNMPERR_SUCCESS; DEBUGMSGTL(("internal:ipCidrRouteTable:_ipCidrRouteTable_undo_column", "called\n")); netsnmp_assert(NULL != rowreq_ctx); switch (column) { /* * ipCidrRouteIfIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEIFINDEX: rc = ipCidrRouteIfIndex_undo(rowreq_ctx); break; /* * ipCidrRouteType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_IPCIDRROUTETYPE: rc = ipCidrRouteType_undo(rowreq_ctx); break; /* * ipCidrRouteInfo(9)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h */ case COLUMN_IPCIDRROUTEINFO: rc = ipCidrRouteInfo_undo(rowreq_ctx); break; /* * ipCidrRouteNextHopAS(10)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTENEXTHOPAS: rc = ipCidrRouteNextHopAS_undo(rowreq_ctx); break; /* * ipCidrRouteMetric1(11)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEMETRIC1: rc = ipCidrRouteMetric1_undo(rowreq_ctx); break; /* * ipCidrRouteMetric2(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEMETRIC2: rc = ipCidrRouteMetric2_undo(rowreq_ctx); break; /* * ipCidrRouteMetric3(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEMETRIC3: rc = ipCidrRouteMetric3_undo(rowreq_ctx); break; /* * ipCidrRouteMetric4(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEMETRIC4: rc = ipCidrRouteMetric4_undo(rowreq_ctx); break; /* * ipCidrRouteMetric5(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h */ case COLUMN_IPCIDRROUTEMETRIC5: rc = ipCidrRouteMetric5_undo(rowreq_ctx); break; /* * ipCidrRouteStatus(16)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ case COLUMN_IPCIDRROUTESTATUS: rc = ipCidrRouteStatus_undo(rowreq_ctx); break; default: snmp_log(LOG_ERR, "unknown column %d in _ipCidrRouteTable_undo_column\n", column); break; } return rc;} /* _ipCidrRouteTable_undo_column */int_mfd_ipCidrRouteTable_undo_values(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *agtreq_info, netsnmp_request_info *requests){ int rc; ipCidrRouteTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_undo_values", "called\n")); netsnmp_assert(NULL != rowreq_ctx); for (; requests; requests = requests->next) { /* * set column data */ tri = netsnmp_extract_table_info(requests); if (NULL == tri) continue; rc = _ipCidrRouteTable_undo_column(rowreq_ctx, requests->requestvb, tri->colnum); if (MFD_SUCCESS != rc) { /* * nothing we can do about it but log it */ DEBUGMSGTL(("verbose:ipCidrRouteTable:mfd", "error %d from " "ipCidrRouteTable_undo_column\n", rc)); } } /* f
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -