On 17/04/07, Erik Earle <[EMAIL PROTECTED]> wrote:
> char buf[SPRINT_MAX_LEN];
> snprint_objid(buf, sizeof(buf), var->name,
> var->name_length);
> DEBUGMSGTL(("agenty", " oidStr: %s\n", buf));
> the oidStr =
> "SNMPv2-SMI::enterprises.7755.1000.42.1.1.0"
>
> Is there function to convert that to the numeric form:
> 1.3.6.1.4.1.7755.1000.42.1.1.0
Two possibilities:
a) The request actually contains the numeric OID in the 'var->name' field.
So it's directly accessible already.
The 'snprintf_objid()' call is just used to convert this into a
printable format.
b) If you want a printable string containing the numeric OID,
then call
netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
NETSNMP_OID_OUTPUT_NUMERIC);
before the 'snprintf_objid()' call
Dave
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders