RE: Get BITS value
Dave Shield <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 2005-10-28 at 10:59 -0700, Yong Chen (yongche) wrote:
> But I thought an instance with bits v0, v3 and v10 set would be:
>
> 00000100 00000101
> ^ ^ ^
> bit 10 3 0
Why?
RFC 1906 states very clearly:
(3) When encoding an object whose syntax is described using the BITS
construct, the value is encoded as an OCTET STRING, in which all
the named bits in (the definition of) the bitstring, commencing
with the first bit and proceeding to the last bit, are placed in
bits 8 to 1 of the first octet, followed by bits 8 to 1 of each
subsequent octet in turn....
RFC 3416/7 is even more explicit that bit 8 is the high order bit, and
bit 1 is the low order bit.
You still seem to be thinking in terms of this as a numeric value.
It's not - it's a *string* of independent bits.
> So it's 0x04 and 0x05 (not 0x90 & 0x20). That's why I did the "funny"
> conversion based on RFC 3417 section 8.
You're looking in the right place, but seem to be interpreting it
backwards.
> Also should I send out 0x9020 or 0x2090?
0x9020 - as you quoted below
> Does big/small endian-ness (and network order) play a role here?
No.
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