Hi,

root and rootlen are defined as below :
oid root[MAX_OID_LEN];
int rootlen = MAX_OID_LEN;

Btw, I've figured out the problem. The OID types works fine in other tables but in this particular table i had some empty columns. With strings they just return nulls "". With OID types snmpwalk can't find the next value and timeouts.

What actually happens when snmp_parse_oid parses an empty string?
Temporarily in the agent I'm returning "1.3.6.1.4.1" if string is NULL just so the agent has something to parse.

Thanks in advance,

Syikin


Dave Shield wrote:
On 30 July 2010 09:47, Norasyikin MD Ali <[email protected]> wrote:
      value = val->s;
      snmp_parse_oid(value,root,&rootlen);

How are you defining the variable 'root'?
What value does 'rootlen' have before you call this routine?

Remember that you need to initialise rootlen with the size of the
buffer - i.e. the maximum size of the OID that can be handled.
The value returned will be the *actual* size of the OID that was
parsed.
   If you're re-using this length variable for parsing two or more
OID strings, then you need to re-set the length to indicate the
maximum size before trying to parse the second one.


Dave

______________________________________________ This email has been scanned by Netintelligence http://www.netintelligence.com/email



------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
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