[SNMP4J] "BITS" type in SMIv2

Frank Fock fock at agentpp.com
Wed Jul 19 21:25:31 CEST 2006


Hi Alastair,

Since on the wire OCTET STRING is indistinguishable from
BITS, getSyntax() will return the same value in both cases.

You will need to check the OID to determine the "display"
type of the value.

Best regards,
Frank

Alastair Hewitt wrote:
> Thanks Frank, just one last question...
> 
> In my application, I may not have a MIB and so don't know what syntax 
> type I'm receiving (from the OID).  I need to convert the OctetString 
> into either text (if it is DisplayString) or a radix 2 number (if it is 
> BITS).  When I get a variable binding from a trap, will the Variable 
> getSyntax method return 4 (OctetString) in both cases?
> 
> Many thanks,
> 
> Alastair
> 
> Frank Fock wrote:
> 
>> Hi Alastair,
>>
>> The BITS type is in fact an OCTET STRING on the wire.
>> So it is already supported by the OctetString class.
>>
>> Best regards,
>> Frank
>>
>> Alastair Hewitt wrote:
>>
>>> There is a new datatype "BITS" in SMIv2 described as "An enumeration 
>>> of nonnegative named bits".
>>>
>>>  From what I can tell, SNMP4J does not handle this type.  Without 
>>> digging too deep into the code, will a trap containing a variable 
>>> binding of this type get ignored or cause an exception?  I've looked 
>>> a little bit at what it would take to add this type and it doesn't 
>>> look too difficult, but wanted to know if this was on the radar for a 
>>> future release?
>>>
>>> Any other info about BITS support would be greatly appreciated!
>>>
>>> Thanks,
>>>
>>> Alastair
>>> _______________________________________________
>>> SNMP4J mailing list
>>> SNMP4J at agentpp.org
>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>
>>
> 
> 

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list