How to convert BITS data into OCTET String

Abhishek Mishra <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi,

We have a column in the table that have datatype of BITS. After
compilation of the MIB file, it is converted into a character array. I
found some information in the RFC# 3416/3417 regarding the conversion
but could not understand well how to convert BITS field into the octet
string. Following is the BITS field we are using:

SYNTAX      BITS {
                  other(0),
                  userAgent(1),
                  proxyServer(2),
                  redirectServer(3),
                  registrarServer(4)
                }

Now, I have to set bit 2 (proxyServer) and 4 (registrarServer) into the octet string.
Please guide me how the conversion would actually take place.

I suppose that numbering would be:
8 7 6 5 4 3 2 1
- - X - X - - -

If these bits would be set then index 0 of the octet string should be equal to: 0x28.
Is that correct?

Kind Regards,
-Abhishek

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.