I generated some scalar code using the mib2c tool, which generated code which 
looks like the following:

int
handle_ocStbHostSoftwareVersion(netsnmp_mib_handler *handler,
                                netsnmp_handler_registration *reginfo,
                                netsnmp_agent_request_info *reqinfo,
                                netsnmp_request_info *requests)
{
    /*
     * We are never called for a GETNEXT if it's registered as a
     * "instance", as it's "magically" handled for us.  
     */

    /*
     * a instance handler also only hands us one request at a time, so
     * we don't need to loop over a list of requests; we'll only get one. 
     */

    switch (reqinfo->mode) {

    case MODE_GET:
        snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
                                 (u_char *)
                                 /* XXX: a pointer to the scalar's data */
                                 ,
                                 /*
                                  * XXX: the length of the data in bytes 
                                  */ );
        break;


    default:
        /*
         * we should never get here, so this is a really bad error 
         */
        snmp_log(LOG_ERR,
                 "unknown mode (%d) in handle_ocStbHostSoftwareVersion\n",
                 reqinfo->mode);
        return SNMP_ERR_GENERR;
    }

    return SNMP_ERR_NOERROR;
}

In our implementation, the "ocStbHostSoftwareVersion" data is not being 
supported right now so there will be no way to obtain thsi data.   What is the 
best way to handle a SNMP request from the real world asking for this data?   

I was thinking about simply returning SNMP_NOSUCHINSTANCE (ie: MFD_SKIP) and 
was wondering if this was appropriate or whether another course of action would 
be better.  

For my "MfD Tables", I can define "valid_columns" in the "xxxxxxx_init_data()" 
routine to indicate which columns should be skipped within the table, but I am 
not sure how to go about doing this for some scalar values.






       
---------------------------------
Boardwalk for $500? In 2007? Ha! 
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to