Re: [convert string as oid]

Ashish vashishtha <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
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 <[email protected]>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 <[email protected]>*wrote:
>
>
> From: Ashish vashishtha <[email protected]>
> Subject: [convert string as oid]
> To: [email protected], "Dave Shield" <
> [email protected]>
> 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
> [email protected]<http://mc/[email protected]>
> 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
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.