Thank you Dave, this exactly what i wanted. snprint_objid suited me the best for this purpose, as i was able to assign buffer output to variable.
In case others are interested how this is done: static char buf[SPRINT_MAX_LEN]; int res = snprint_objid(buf,sizeof(buf)-1,oid,oid_length); buf[sizeof(buf)-1] = '\0'; Laimis On 2012 Jan 31, at 16:12, Dave Shield wrote: > On 31 January 2012 11:28, opium <[email protected]> wrote: >> Are there any C API functions which would return textual representation of >> OID ? > > $ man mib_api > : > Output > > print_objid will take an object identifier (as returned by read_objid, > snmp_parse_oid or get_module_node), and prints the textual form > of this OID to the standard output. > > fprint_objid does the same, but prints to the FILE pointer specified > by the initial parameter. > > snprint_objid prints the same information into the buffer pointed to > by buf which is of length len. > > Dave ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! 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-d2d _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
