Hi,

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 as i dont have length of the OID and length of the
string is not same as length of the OID.



On Tue, Feb 16, 2010 at 2:58 PM, Vivek Singh Bhadauria <viv_...@yahoo.com>wrote:

> hi,
>
> Use ASCII code for each character.
>
> Example:
> Say you have string ABcd and want to convert into oid
> so check for the ASCII value of A, B .. and then make oid like
> strlen(ABcd).ASCII(A).ASCII(B).ASCII(c).ASCII(d)
>
> So
> A = 65
> B= 66
> c= 99
> d = 100
>
>
> Hence ur string oid would be  4..65.66.99.100 for ABcd
>
> --- On *Tue, 16/2/10, Ashish vashishtha <ashish.vashish...@gmail.com>*wrote:
>
>
> From: Ashish vashishtha <ashish.vashish...@gmail.com>
> Subject: [convert string as oid]
> To: net-snmp-users@lists.sourceforge.net, "Dave Shield" <
> d.t.shi...@liverpool.ac.uk>
> Date: Tuesday, 16 February, 2010, 2:18 PM
>
>
> hello ,
>
> is there any way to convert string to oid.
>
> for example i have a string string str that contains numeric oid like
> 1.3.6.1.1.1.1
>
> how i convert it as OID type?
>
> --
> Regards
> Ashish Vashishtha
>
> -----Inline Attachment Follows-----
>
>
> ------------------------------------------------------------------------------
> 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
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Net-snmp-users mailing list
> Net-snmp-users@lists.sourceforge.net<http://mc/compose?to=net-snmp-us...@lists.sourceforge.net>
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>
>
> ------------------------------
> Your Mail works best with the New Yahoo Optimized IE8. Get it 
> NOW!<http://in.rd.yahoo.com/tagline_ie8_new/*http://downloads.yahoo.com/in/internetexplorer/>
> .
>



-- 
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
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