Page 1 of 1

problem setting a snmp gauge32

Posted: Wed Jul 17, 2013 12:51 pm
by molecat
Hello NetBurner fans,
In developing a NTCIP application using snmpv1, we found that the present NetBurner snmp stack is not allowing a set of a gauge32. It is essential in the NTCIP 1103v02 standard that the Community Name Table have a writable mask, which is a gauge data type (snmpv1 all gauges are 32 bit). Tracing a snmpset into snmp.cpp:

BaseTablePutOIDFunction is called
switch on wlo->WriteType goes to WRITE_Int
switch on wlo->ObjectType goes to SMI_GAUGE32
req.get_asn.GetGauge32() returns 0
req.get_asn.error is true

Tracing into asn1.cpp:

ASN::GetGauge32 rv_type != SMI_GAUGE32 TRUE

also in asn1.cpp:
DWORD ASN::GetGauge32()
{
BYTE rv_type;
int objlen;
DWORD rv;
if ( RootParse( objlen, rv_type ) )

RootParse requires a pointer argument for rv: ( RootParse( objlen, &rv_type )
and clearly ASN::GetGauge32() passes the value rv and not its address.

Doesn't this look like the root cause of the error?

Re: problem setting a snmp gauge32

Posted: Wed Jul 17, 2013 4:24 pm
by rnixon
I'm not an snmp expert, but I thought counters and gauges were read only. Have you verified that the tools you are using are sending the proper command, and that it is actually received by the netburner device for processing?

Re: problem setting a snmp gauge32

Posted: Wed Jul 17, 2013 4:42 pm
by pbreed
Actually the & in c++ means pass by reference not pointer.
A pointer is *.....

Google CPP pass by reference.....

This is not your error.....

Re: problem setting a snmp gauge32

Posted: Wed Jul 17, 2013 4:50 pm
by pbreed
Also error is not a boolean... but a value.....

My guess is the error value is:

ASNERR_WRONG_TYPE; IE the snmp set was for a guage entry... but the set value was not of gage type...
or
ASNERR_TOO_LONG; IE the snmp set was too big for a 32 bit gage... ie the value passed in was bigger than 32bits....