mibble-users
[Top][All Lists]
Advanced

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

Re: [Mibble-users] question about syntax


From: Per Cederberg
Subject: Re: [Mibble-users] question about syntax
Date: Fri, 12 Mar 2004 23:00:28 +0100

On Fri, 2004-03-12 at 09:42, wshang wrote:
> hi,
> I have been away for some days, remember me ?
> I have a question about syntax.
> SNMPv1,v2 use the syntax : Integer,Unsigned32,Counter32, Counter64, 
> Gauge32,TimeTicks, Octect String, IpAddress ,Object Identifier ,Opaque.
> 
> when I want to know a Symbol's syntax ,I use the follow sentence:
>      if (((SnmpObjectType)type).getSyntax() instanceof XXXType){ 
>       //do something...
>      }
> but I find XXXType is only follow:
>     BitSetType
>     BooleanType
>     ChoiceType
>     IntegerType
>     NullType
>     ObjectIdentifierType
>     SequenceOfType
>     SequenceType
>     StringType
> there are some difference of the XXXType and the syntax the snmp use . 
> for example, how can I check if a symbol is Counter64 type ?

Good question. Fortunately Charles F. Schatz already pointed
this out before the 2.2 release, so since then there are two
ways to detect the referenced type:

1. Use the Mibble type name tracking:
     MibType.hasReferenceTo("Counter64")

2. Use the type tag for Counter64 [APPLICATION 6]:
     MibType.hasTag(MibTypeTag.APPLICATION_CATEOGORY, 6);

For SNMP I guess this is often a better method to use than
to test with instanceof since only a few base types are
really used.

Hope this answers your question!

Cheers,

/Per






reply via email to

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