我想根据 GETBULK 请求更新子代理的表,而不必为每个内部 GETNEXT 请求进行更新。
mib2c 为 GET 请求生成了以下处理程序 - 我如何在子代理中设置处理程序以专门对 GETBULK 执行更新?
int
table_handler(netsnmp_mib_handler *handler,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests)
{
netsnmp_request_info *request;
netsnmp_table_request_info *table_info;
netsnmp_tdata *table_data;
netsnmp_tdata_row *table_row;
struct table_entry *table_entry;
int ret;
switch (reqinfo->mode) {
/*
* Read-support (also covers GetNext requests)
*/
case MODE_GET:
for (request = requests; request; request = request->next) {
table_entry = (struct table_entry *)
netsnmp_tdata_extract_entry(request);
table_info = netsnmp_extract_table_info(request);
switch (table_info->colnum) {
case COLUMN_NAMESERVER:
.
.
.
case COLUMN_NAMESERVERPORT:
.
.
.
default:
.
.
.
}