> Assume that you are calling the registration code with <theOid> as the > OID, then _instance registers a variable at <theOid> while _scalar > registers a variable at <theOid>.0, this is useful for simple scalar > variables that are declared outside of any table in the MIB. So the main (only?) difference is how to register the OID; with or without trailing .0?
>> 2) netsnmp_register_watched_instance( >> netsnmp_create_handler_registration( >> "two", >> NULL, >> my_oid2, >> OID_LENGTH(my_oid2), >> HANDLER_CAN_RWRITE), >> netsnmp_create_watcher_info( >> (void *)&integer, >> sizeof(integer), >> ASN_INTEGER, >> WATCHER_FIXED_SIZE)); >> >> snmpget works fine / snmpset doesn't work (wrong type or length) > What exact commad are you issuing? snmpset -v 1 -c private localhost <OID> i 1 which works for the example in 3). I played around with the types a bit, but as expected, that won't work with either version. >> 3) netsnmp_register_int_instance( >> "two", >> my_oid2, >> OID_LENGTH(my_oid2), >> &integer, >> NULL); >> >> snmpget/-set works fine > Could you pleease check if your problem is present in the trunk version > as well? f there is a bug I would rather know about it now than later. I can try to reproduce and check this at home. For the record, the problem occurred using net-snmp 5.4.1.2 on Fedora 9 (x64). > I failed to understand question III Someone already helped me out in this question: Roy M. Silvernail wrote: > This (untested) snippet may work for your second attempt. > > oid testOid[] = {2, 100, 3}; > netsnmp_set_row_column(netsnmp_row, 2, ASN_OBJECT_ID, > (char *)testOid, sizeof(oid)); Doesn't help me to understand how those "net-snmp OIDs" are encoded, but as long as it works I don't mind. ;) However, every OID seems to be rooted at ccitt(0). When I change testOid to {0}, I get 0.0 (which I wanted to achieve in the first place), but even {2, 100, 3} results in 0.2.x * * * Hirschmann Automation and Control GmbH, Neckartenzlingen Register court: Stuttgart, Trade register No.: HRB 225927 VAT No.: DE 814 212 604 Managing Director: Dr. Wolfgang Babel ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders