Hello,

we have recently moved from net-snmp 5.3.3 to 5.5.
Our code used to retrieve user request errors using usmStats, but in 5.5 it has 
been reimplemented and our code doesn't compile.

In detail, we used variable2 usmStats_variables[]... as defined in usmStats.h, 
for example in this function:


/**
 * @brief Delivers the count of SNMP request errors "unknown user name".
 * @return number of request errors "unknown user name".
 */
static LONG32 get_usm_stats_unknown_user_names (void)
{
    LONG32     long_ret; /* return value*/
    struct variable var; /* SNMP variable */
    /* OID of MIB node that stores the counter of
     * request errors "unknown user name"
     */
    oid o[MAX_OID_LEN]     = { 1, 3, 6, 1, 6, 3, 15, 1, 1, 3, 0 };
    size_t olen = 11; /* the OID's length */

    /* store variable access */
    var.acl = usmStats_variables[2].acl;
    /* store find method */
    var.findVar = usmStats_variables[2].findVar;
    /* store magic number */
    var.magic = usmStats_variables[2].magic;
    /* store OID */
    memcpy (var.name, o, sizeof (var.name));
    var.namelen = olen; /* store OID length */
    /* store variable type */
    var.type = usmStats_variables[2].type;
    /* get SMP variable value */
    long_ret = snmp_get_statistic(var.magic + STAT_USM_STATS_START);

    return long_ret; /* return error count number (SNMP variable value) */
}


But usmStats_variables is not declared anymore. Can you tell the way to 
implement it now with 5.5?

Thank you!
Jose.

                                          
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to