On 16 February 2010 13:18, Ashish vashishtha
<ashish.vashish...@gmail.com> 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

------------------------------------------------------------------------------
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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to