Sorry for this delayed reply.

    In my case all get/set request is passed via the server to the node
in this case server gives me the data(value ) for the respective request
is given as string. Take for example in H3223 mib there is an entry
called codec types which take 13 bits.

This is for 8 bits
    Server gives the value as 0(00000000), 1(00000001), 2(00000010)
etc..
The code use to implement this 8 bit value is as follows(Thhis is not
the complete code only the part which handles bits is shown).

iVal = atoi(cVal);/*cVal is the value given by th server in string 
                   *form
                   */
strVal[0] = iVal;/*
                  * strVal is the character array of size 1
                  */
/*
 *If the iVal is 1 then the value set is 00000001
 *If the iVal is 3 then the value set is 00000011
 */
snmp_set_var_typed_value(var, ASN_OCTET_STR,
                        (u_char *)strVal,
                        strlen(cVal)*sizeof(u_char)
                        );


If snmpget is done on this entry the output shows the correct bits is
set.
 Is there any other way to handle bits, the above procedure works for
8bits.I don't know how to handle more than 8 bits.
 If you need more clarification let me know.

 
On Thu, 2004-09-09 at 19:54, Dave Shield wrote:
> >    I am facing some problem while implementing Accounting control MIB
> > i.e one of the entry has data type BITS value ranges from 0-9 , I am
> > passing the bit value through character array (size 2).But it is taking
> > the value present in the first character , not reading the second
> > character.
> 
> How are you setting the value?
> What's the exact code used to implement this particular object?
> 
> Dave
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
> _______________________________________________
> 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



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
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

Reply via email to