> But I need to register a string. Searching the documentation I haven't  
> found a function looking like netsnmp_register_string_instance and I 
> coudn't find an example explaining how to register a string using the 
> generic netsnmp_register_instance 

Have a look at "netsnmp_register_watched_scalar"
Not only does this cope with string values as well as integer ones,
it also handles scalar objects correctly (which netsnmp_register_instance
doesn't - in particular requests for an invalid instance)


I'm afraid there aren't any examples using it (yet!),
but it'd be something like:

     netsnmp_handler_registration *reg =
         netsnmp_create_handler_registration(
                "myStringObject", NULL,
                myStringObjectOID, OID_LENGTH(myStringObjectOID),
                HANDLER_CAN_RONLY);
     netsnmp_watcher_info *winfo =
         netsnmp_create_watcher_info(
                myStringObject, strlen(myStringObject),
                ASN_OCTET_STR, WATCHER_FIXED_SIZE);
     netsnmp_register_watched_scalar( reg, winfo );

Dave



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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

Reply via email to