Re: SNMP Agent response time

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2009/2/27 Ragesh V <[email protected]>:
>
> The code which handles getNext is as below......


> case snmp_Type_ObjectId :
>    {
>        vp->type = snmp_Type_ObjectId;
>                if (!strRetValue.empty ())
>        {
>        *var_len = (int) 14;
>        return (u_char *)strRetValue.c_str();
>        }
> }

The value returned for a MIB object of syntax ASN_OBJECT_ID
should be of type "oid[]"   (not a string),   and the 'var_len' field
should be the size of this (in bytes, not subidentifiers).

I strongly suspect that you probably need to do something with
'strRetValue.c_str() to ensure it is an array of 'oid' values.

And if this always contains 14 subidentifiers, then you also need

   *var_len = 14 * sizeof(oid);

Dave

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.