Re: [convert string as oid]
Ashish vashishtha <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
i have my application specific xml file that has it own tags like. <oid> 1.3.6.1.1.133.5</oid> i think snmp_parse_oid() function convert oids like ABCD to oid. when i am trying this function with string str that contains 1.3.6.1.1.133.5 i am getting garbage values. On Tue, Feb 16, 2010 at 6:53 PM, Dave Shield <[email protected]>wrote: > On 16 February 2010 13:18, Ashish vashishtha > <[email protected]> wrote: > > I am reading oid from a xml file. > > and oids are in generic form like this > > <oid>1.3.6.1.1.133.5<oid> in xml file. > > > > i am reading this xml file and saving it as a std::string. > > now i need to convert it as oid for registering. > > how i can achieve this > > Use 'snmp_parse_oid()' - as I said this morning. > > > > as i dont have length of the OID > > and length of the string is not same as length of the OID. > > The length parameter passed into 'snmp_parse_oid' > is the size of the OID *buffer* - this would normally be > initialised to MAX_OID_LEN. > > The snmp_parse_oid routine will pass back the actual > length of the OID, once it's been parsed. > > Please see the code for the various command-line tools > (under 'apps') for example of how this routine is used. > > Dave > -- Regards Ashish Vashishtha ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ 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