mibble-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mibble-devel] Fix for set operations on counter and gauge.


From: Per Cederberg
Subject: Re: [Mibble-devel] Fix for set operations on counter and gauge.
Date: Wed, 27 Dec 2006 00:13:17 +0100
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

Hi Paul,

Thanks for your bugreport + patch. It has now been
applied and will be present in Mibble 2.8 (forgot
to include it in 2.8.beta1 though). It has also
been reported as bug #18591:

  http://savannah.nongnu.org/bugs/index.php?18591

Sorry about the slow response on this. Too much
other stuff the last couple of months, and I am
just now catching up... :-)

Cheers,

/Per

Paul Faid wrote:
Hi,

I'm considering using Mibble in an application I need to put together,
and while playing around I found a bug in the interface between Mibble
and the Westhawk SNMP stack.  In the Mibble MIB browser, if you
attempt a Set operation on a counter or gauge, you get a 'Bad value
error'. This is because the type of the unsigned integer not being
set, and it defaults to TimeTicks.

I've modified the code as below and it now works ok for me.

In SNMPManager.java the method

public AsnObject createAsnValue(SnmpRequest request) throws SnmpException {
       ...
       ...
     } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 1)) {
           // Counter
//return new AsnUnsInteger(parseInteger(value)); <- original call
           return new AsnUnsInteger(parseInteger(value),
SnmpConstants.COUNTER);
       } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 2)) {
           // Gauge
           //return new AsnUnsInteger(parseInteger(value));    <-
original call
return new AsnUnsInteger(parseInteger(value), SnmpConstants.GAUGE);
       } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 3)) {
           // TimeTicks
           // return new AsnUnsInteger(parseInteger(value));   <-
original call
           return new AsnUnsInteger(parseInteger(value),
SnmpConstants.TIMETICKS);
       ...
       ...
}

Cheers
Paul


_______________________________________________
Mibble-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/mibble-devel






reply via email to

[Prev in Thread] Current Thread [Next in Thread]