Hi Sasi,
For getnext response,
netsnmp_variable_list *var = NULL;
var = requests->agent_req_info->asp->pdu->variables;
//To fill the oid into varbind, ( Assume that in inName you have text form of the oid, eg “sysName” )
//For scalar make no_of_index=0 , for table relevant no_of_index should be assigned properly,
var->name_length = var->name_length + no_of_index + 1;
if(snmp_parse_oid(outTableAttributeName[resCount],var->name,&var->name_length))
DEBUGMSGTL(("Table", "Oid Parsing is Success \n"));
else
{
snmp_log(LOG_ERR,"oid parsing is failed \n");
netsnmp_request_set_error(requests,SNMP_ERR_GENERR);
return SNMP_ERR_NOERROR;
}
// to fill the value for that oid in the var bind, Assume that the type is INT and intValue has the value of the var bind
snmp_set_var_typed_value (var, ASN_INTEGER, (u_char *) & intValue,sizeof (intValue));
To iterate over the var binds, you can use
var = var->next_variable;
Kanda
________________________________
From: [EMAIL PROTECTED] on behalf of = [EMAIL PROTECTED]
Sent: Tue 2/21/2006 8:16 PM
Subject: snmpgetnext with multiple varbindes
Hi All,
I am using net-snmp-5.2.1.2 version, I am not using the default = implementation code generated by mib2c. I am registering the handler = directly, whenever request comes the handler is invoked for getnext = request i am forming the return oid. In case of snmpget with = multi-varbind i am getting the response for all the varbindes, but the = problem is with getnext only the response for forst varbind is displayed = by the manager(i.e. net-snmp utility function snmpgetnext) but inside = the handler i am returning the value for both the varbindes
Rgards, Sasikumar.
