> What do I need to do to make net-snmp happy with the data that I get from
> the pipe?  Will I need to make dummy variables, and register those with
> net-snmp?  Just use the variables like in the switch statements that follow
> this comment in example.c? Or quit looking at example.c all together? :)

Quit looking at example.c altogether.   <seriously!>

If nothing else, this example uses the old v4 API.
Although this *can* support a "register subtree" approach,
it's a bit of hack, and it's really aimed at working with
a list of known variables.
  From what you've said so far, you'd be much better off
using the new v5 API.

You can use 'netsnmp_register_handler' in the initialisation
routine to register the whole of your subtree as being handled
by your handler routine.  Something like:

    netsnmp_handler_registration    *reg =
        netsnmp_create_handler_registration(
                "mySubtree", handle_mysubtree,
                mySubtree_oid, OID_LENGTH( mySubtree_oid ),
                HANDLER_CAN_RWRITE);
   netsnmp_register_handler( reg );


Then the handler can extract each requested OID, send it down
the pipe, receive the result, and then pass it back to the
main agent using

        snmp_set_var_objid(request->requestvb,
                           result_oid, result_oid_len);
        snmp_set_var_typed_value(request->requestvb,
                           ASN_TYPE, &result, sizeof(result));

(That skips over a lot of details, but you should get the idea...)



Question:
   Does the other end of the pipe cope with the GETNEXT lexical
ordering?   Or does it assume that everything is a GET?
How does it handle SET requests.

Dave



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to