[AGENT++] Unexpected request type for SNMP set
Dave White | Networking
dave.white at efi.com
Thu Apr 28 20:29:59 CEST 2005
David Nedde,
I think you need to distinguish between version 1 and version 2 of the SNMP
protocol. Version 1 set-request has the same value as version 2 response.
Look deeper into the PDU to also check the version. The values for
sNMP_PUD_SET defined in snmp_pp/smi.h are for v2. The raw PDU received in
the loop is probably v1. As stated by Jochen, the request type gets changed
before being processed.
Regards,
Dave
-----Original Message-----
From: agentpp-bounces at agentpp.org [mailto:agentpp-bounces at agentpp.org] On
Behalf Of Jochen Katz
Sent: Thursday, April 28, 2005 10:17 AM
To: agentpp at agentpp.org
Subject: Re: [AGENT++] Unexpected request type for SNMP set
Hi,
> I'm trying to detect a request type of sNMP_PDU_SET in my process request
loop
> so that I can save off the persistent mibs if there is a set operation.
When I
> do a set operation from the snmp client though, the req->get_type() is
> sNMP_PDU_RESPONSE instead of sNMP_PDU_SET. Am I doing something wrong
here?
without looking at the agent++ code: The process_request() function
changes the request type before answering the request, so check the type
before calling process_request().
Request* req = reqList->receive(0);
if ( req )
{
bool save = false;
if ( req->get_type() == sNMP_PDU_SET )
save = true;
mib->process_request(req);
if (save)
mib->save_all();
}
Regards,
Jochen
_______________________________________________
AGENTPP mailing list
AGENTPP at agentpp.org
http://lists.agentpp.org/mailman/listinfo/agentpp
More information about the AGENTPP
mailing list