BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to read counter64 in IdSNMP

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket)
View previous topic :: View next topic  
Author Message
Mert CAN
Guest





PostPosted: Tue May 10, 2005 1:28 pm    Post subject: How to read counter64 in IdSNMP Reply with quote



I can read a 32 bit counter value by using the code below.
snmp_mng->QuickSend("1.3.6.1.2.1.2.2.1.10.4","public","192.168.2.1",1);
inoctet = StrToInt(snmp_mng->Reply->Value[0]);

But I can't get the counter64 type value by using the code below? Is there
a special way of reading it?
snmp_mng->QuickSend("1.3.6.1.3.9999.1.2.1.3.5","public",pch_snmp,1);
total_inoctet = snmp_mng->Reply->Value[0];

I captured the traffic. The response for my request for this OID is coming
to my computer. Also other SNMP manager utilities can read the value of this
OID but by using Indy 9, I couldn't read it.


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue May 10, 2005 4:47 pm    Post subject: Re: How to read counter64 in IdSNMP Reply with quote




"Mert CAN" <sokrates1331 (AT) hotmail (DOT) com> wrote


Quote:
I captured the traffic. The response for my request for this OID is coming
to my computer.

Please be more specific. What does the data actualy look like? Have you
tried StrToInt64()?

Quote:
by using Indy 9, I couldn't read it.

Why not? You need to be more specific.


Gambit



Back to top
Mert CAN
Guest





PostPosted: Tue May 10, 2005 7:05 pm    Post subject: Re: How to read counter64 in IdSNMP Reply with quote



The data returned is NULL for value[0]. I tried to use strtoint64() now but
I didn't work. As you can see in my first message, the only change in my
code is the OID that I requested. I also checked the ValueType of OID for
the reply and it is true(70) but the value[0] is NULL.



"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com>, haber iletisinde şunları
yazdı:4280e792$1 (AT) newsgroups (DOT) borland.com...
Quote:

"Mert CAN" <sokrates1331 (AT) hotmail (DOT) com> wrote in message
news:4280ba31$1 (AT) newsgroups (DOT) borland.com...

I captured the traffic. The response for my request for this OID is
coming
to my computer.

Please be more specific. What does the data actualy look like? Have you
tried StrToInt64()?

by using Indy 9, I couldn't read it.

Why not? You need to be more specific.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue May 10, 2005 8:15 pm    Post subject: Re: How to read counter64 in IdSNMP Reply with quote


"Mert CAN" <sokrates1331 (AT) hotmail (DOT) com> wrote


Quote:
The data returned is NULL for value[0].
snip
I also checked the ValueType of OID for the reply and it is true(70)

Indy doesn't have any knowledge of that particular ValueType, so it doesn't
know how to decode it when filling in the Reply values. The value is NULL
since it is an unknown type. This is because Counter64 was added in SNMP
v2, which Indy does not implement yet.


Gambit



Back to top
Mert CAN
Guest





PostPosted: Wed May 11, 2005 7:08 am    Post subject: Re: How to read counter64 in IdSNMP Reply with quote

Thank you for your answer. I wonder if it is impossible to read the response
by using udpbase->responsestring() function. Or is there any other way to
get the value of this counter64?




"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com>, haber iletisinde şunları
yazdı:42811636$1 (AT) newsgroups (DOT) borland.com...
Quote:

"Mert CAN" <sokrates1331 (AT) hotmail (DOT) com> wrote in message
news:42810604$1 (AT) newsgroups (DOT) borland.com...

The data returned is NULL for value[0].
snip
I also checked the ValueType of OID for the reply and it is true(70)

Indy doesn't have any knowledge of that particular ValueType, so it
doesn't
know how to decode it when filling in the Reply values. The value is NULL
since it is an unknown type. This is because Counter64 was added in SNMP
v2, which Indy does not implement yet.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed May 11, 2005 4:45 pm    Post subject: Re: How to read counter64 in IdSNMP Reply with quote


"Mert CAN" <sokrates1331 (AT) hotmail (DOT) com> wrote


Quote:
I wonder if it is impossible to read the response by using
udpbase->responsestring() function. Or is there any other
way to get the value of this counter64?

An easier way would be to manually update IdASN1Utils.pas to recognize
Counter64 types, and then recompile the Indy library. That way, you can
continue using TIdSNMP as-is, and you should then have non-NUL string values
that you can pass to StrToInt64()..


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.