>>>>> On Mon, 20 Feb 2006 19:05:08 +0530, <[EMAIL PROTECTED]> said:

kanda> 1. How i can send response to BITS data-type oids, now i am filling 
set_var_type_value as follows.

kanda> snmp_set_var_typed_value (requests, ASN_OCTET_STR, (u_char *) "1",strlen 
("1"));

kanda> When i am giving snmpget on this oid, it is displaying as 

kanda> snmpget -v2c -c public 10.201.114.135 myOid.1.1
kanda> MY-MIB::myOid.1.1 = BITS: 30
kanda> noPiggybackReq(2) noFragmentData(3)

kanda> Do i have to pass the value in different format or i am sending
kanda> in the right format which is not able to understand by snmpget
kanda> application?

If you're trying to set the first bit what you need to do is pass in a
string which contains a binary repsenetation of the BIT pack.  The
number "1" passed in as you put it above will pack the ascii code for
"1", which is not what you want.

char x;
x = 0x40;  /* sets the 1 bit in a BITS field (0x80 would be bit 0) */
snmp_set_var_typed_value (requests, ASN_OCTET_STR, &x, sizeof(x));



-- 
Wes Hardaker
Sparta, Inc.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to