Re: Get BITS value
Dave Shield <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2005-10-26 at 17:46 -0700, Yong Chen (yongche) wrote:
> I have a question regarding BITS object, please help.
> I'm using netsnmp 5.1.
That's fairly old - we'd strongly suggest that you upgrade.
mib2c has never been very good at handling BITS-syntax objects,
but I believe that newer versions are a little bit better.
> Lets say in get func, I want to return the value with v0, v3 and v10
> set, so the value is: 1 + 4 + 512 = 517.
No.
A BITS-based object is *not* an integer-based value.
The SMI BITS syntax is built on OCTET STRING.
An istance with bits v0, v3 and v10 set will have the value:
10010000 00100000
so will consist of the two octets 0x90 & 0x20
> Is following pseudo code correct?
Well, you come up with the correct answers.
But you have a *very* funny way of getting there!
> Also mib2c by default puts *var_len=sizeof(int32_t),
> am I correct in saying it may be wrong?
Yes, it's wrong.
It shouldn't be treating the value as an integer at all.
Dave
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users