On 28 Sep 2004 12:26:09 +0530 Sasikumar wrote: SB> The code use to implement this 8 bit value is as follows(Thhis is not SB> the complete code only the part which handles bits is shown). SB> SB> iVal = atoi(cVal);/*cVal is the value given by th server in string SB> *form SB> */ SB> strVal[0] = iVal;/* SB> * strVal is the character array of size 1 SB> */ SB> /* SB> *If the iVal is 1 then the value set is 00000001 SB> *If the iVal is 3 then the value set is 00000011 SB> */ SB> snmp_set_var_typed_value(var, ASN_OCTET_STR, SB> (u_char *)strVal, SB> strlen(cVal)*sizeof(u_char) SB> );
SNMP BITS are actually reversed. See SNMP BITS are actually reversed, so 1 would be '10000000'. If the first 9 bits were set, then you would have an 2 bytes, '11111111' and '10000000'. http://www.net-snmp.org/faqs/rstory/#bits -- Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp> Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users> You are lost in a twisty maze of little standards, all different. ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ 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