Hello,
I'm evaluating the smidump tool provided with libsmi v0.2.16 on SunOS as
part of subagent development using JAX. The problem involves the Java
classes generated to represent SNMP traps (v1 or v2). If a trap has a
VARIABLES (v1) or OBJECTS (v2) clause containing two or more variables
from the same MIB group then the Java class that is generated to
represent the trap does not compile. The reason is that the constructor
for the generated trap class takes a parameter for each variable in the
trap definition, and if the variables are from the same group then the
result is a duplication of parameters in the constructor.
For example, if the OBJECTS clause of the pingNoResponse notification in
the TUBS-IBR-PING-MIB example MIB is changed from { pingRtt, pingTimeout
} to { pingAvgRtt, pingTimeout } so that both variables in the clause
are from the pingStatistics group, then when the generated
PingNoResponse.java source file is compiled the following error occurs:
PingNoResponse.java:28: pingStatistics is already defined in
PingNoResponse(PingStatistics,PingStatistics)
public PingNoResponse(PingStatistics pingStatistics, PingStatistics
pingStatistics) {
^
I haven't seen any restrictions in the RFCs preventing a trap from
containing multiple variables from the same MIB group, so it seems to me
that this is a bug in the generated JAX code. Am I right that this is a
problem, and if so, will it be fixed anytime soon?
Thanks,
Jason
--
!! This message is brought to you via the `libsmi' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <libsmi-request(a)ibr.cs.tu-bs.de>.
!! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.
Hi,
There was no function called getSnmpType in dump-stools.c. Is it part of a newer
version of the library? The function was not there in any other program in the
directoty either.
Can you tell me if there is a straight mapping between the basetype and the
SnmpType? If so, what are the base types corresponding to the Counter32 and
Gauge32 (in SNMPv1)?
Mayank.
Juergen Schoenwaelder <schoenw(a)ibr.cs.tu-bs.de> on 07/03/2001 06:06:06 PM
To: Mayank Agarwal/HSS@HSS
cc: libsmi(a)ibr.cs.tu-bs.de
Subject: Re: [libsmi] Retrieving node SYNTAX
>>>>> sndtrn4 writes:
sndtrn4> I need to get the sysntax of a node, like Counter32, Gauge32,
sndtrn4> etc. The type just tells me whether it's an interger or an
sndtrn4> unsigned integer. Is there any way to find out whether it has
sndtrn4> been declared as a Counter or a Gauge?
I guess you are looking for a function which gives you the SNMP type
for a given SmiType. Take a look at getSnmpType() in
tools/dump-stools.c which does exactly that.
Well, it actually returns the SNMP tag names used by the gsnmp package
- but it should be straight-forward to modify the code to do whatever
you need. And this also explains why such a mapping is usually
specific to the SNMP implementation and thus libsmi does not provide
support for this kind of thing in the documented API.
/js
--
!! This message is brought to you via the `libsmi' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <libsmi-request(a)ibr.cs.tu-bs.de>.
!! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.
--
!! This message is brought to you via the `libsmi' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <libsmi-request(a)ibr.cs.tu-bs.de>.
!! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.
Hi!
I need to get the sysntax of a node, like Counter32, Gauge32, etc. The type just
tells me whether it's an interger or an unsigned integer. Is there any way to
find out whether it has been declared as a Counter or a Gauge?
Thanks,
Mayank.
--
!! This message is brought to you via the `libsmi' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <libsmi-request(a)ibr.cs.tu-bs.de>.
!! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.