problem setting a snmp gauge32

Discussion to talk about software related topics only.
Post Reply
molecat
Posts: 4
Joined: Mon Jul 15, 2013 11:45 am

problem setting a snmp gauge32

Post 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?
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: problem setting a snmp gauge32

Post 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?
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: problem setting a snmp gauge32

Post 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.....
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: problem setting a snmp gauge32

Post 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....
Post Reply