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 

Delphi Indy 10 TIdIcmpClient

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Sat Dec 23, 2006 7:52 pm    Post subject: Delphi Indy 10 TIdIcmpClient Reply with quote



I really need help with this one......
Changes made in indy 10 seem not to include TTL
witch a really need to solve my problem,
or if some one out there knows of a better way to resolve this then
please be jolly over ther holliday and help me Smile

Here is a sample of my code like i would think this should work on
earlier versions of indy


function GetIspIP(const HostToTrace : String) : String;
var
ICMP: TIdIcmpClient;
i : Integer;
begin
result := '';
ICMP := TIdIcmpClient.Create;
ICMP.ReceiveTimeout := 1000;
ICMP.Host := HostToTrace; // for example google.com
// the route should first return my ip then router the the isp witch
whould have a dns name
// and i would like to use that dns name
for I := 1 to 20 - 1 do
begin
ICMP.TTL := ICMP.TTL;
ICMP.Ping;
// check if FromIpAddress includes domin.??(?) , not only ip
address
if HasDnsIncluded(ICMP.ReplyStatus.FromIpAdress) then
begin
//Extract Domin name
result := ExtractDns(ICMP.ReplyStatus.FromIpAdress);
exit;
end;
end;
end;
Back to top
Don Siders
Guest





PostPosted: Sun Dec 24, 2006 2:03 am    Post subject: Re: Delphi Indy 10 TIdIcmpClient Reply with quote



Quote:
I really need help with this one......

Changes made in indy 10 seem not to include TTL witch a really need to
solve my problem, or if some one out there knows of a better way to
resolve this then please be jolly over ther holliday and help me :)

Here is a sample of my code like i would think this should work on earlier
versions of indy

I'm not sure if this satifsfies all your processing requirements. The
changes in how TIdICMPClient handles ping responses were related to two
areas:

* multi-threaded pings
* packet differences between ECHO replies and TTL errors

You'll could use the TIdICMPClient.OnReply event handler to access TTL
information received in the reponse packets.

It would be easier to use the TIdTraceRoute component
(.\Core\IdTraceRoute.pas). It already handles the packet sequencing issues,
as well as Host IP to Host Name resolution. Check out the Trace and DoReply
methods in that unit.

hth...

---

Quote:
function GetIspIP(const HostToTrace : String) : String; var ICMP:
TIdIcmpClient; i : Integer; begin result := ''; ICMP :=
TIdIcmpClient.Create; ICMP.ReceiveTimeout := 1000; ICMP.Host :=
HostToTrace; // for example google.com // the route should first return my
ip then router the the isp witch whould have a dns name // and i would
like to use that dns name for I := 1 to 20 - 1 do begin ICMP.TTL :=
ICMP.TTL; ICMP.Ping; // check if FromIpAddress includes domin.??(?) , not
only ip address if HasDnsIncluded(ICMP.ReplyStatus.FromIpAdress) then
begin //Extract Domin name result :=
ExtractDns(ICMP.ReplyStatus.FromIpAdress); exit; end; end; end;
Back to top
Guest






PostPosted: Sun Dec 24, 2006 11:24 pm    Post subject: Re: Delphi Indy 10 TIdIcmpClient Reply with quote



Thank you for youīre input, i am now trying to use the TidTraceRoute object
but when i call route.Trace i get a socket error #10013 access denied.
I donīt really under stand this problem because i donīt have a firewall or
virus protection
I tryed to run-->cmd-->tracert google.com
and there it works fine,, do i need administrative rights to call the trace
procedure ?

here is a expample of my code

procedure TFVH69.FormCreate(Sender: TObject);
begin
inherited;
route := TIdTraceroute.create(self);
route.OnReply := TraceRouteReply;
route.ReceiveTimeout := 200;
route.ResolveHostNames := true;
route.Host := '157.157.110.10';
end;


function TFVH69.GetISPName : String;
begin
route.Trace;
Application.ProcessMessages;
end;

procedure TFVH69.TraceRouteReply(ASender: TComponent;
const AReplyStatus: TReplyStatus);
var
sTime,tmps: String;
begin
if (AReplyStatus.MsRoundTripTime = 0) then
sTime := '<1'
else
sTime := '=';

tmps := Format('%d bytes from %s ( %s ): icmp_seq=%d ttl=%d time%s%d ms
msg=%s',
[AReplyStatus.BytesReceived,
AReplyStatus.FromIpAddress,
AReplyStatus.HostName,
AReplyStatus.SequenceId,
AReplyStatus.TimeToLive,
sTime,
AReplyStatus.MsRoundTripTime,
AReplyStatus.Msg ]);

ShowMessage(tmps);
Application.processmessages;
end;



"Don Siders" <sidersd (AT) att (DOT) net> wrote in message
news:458d8b99$1 (AT) newsgroups (DOT) borland.com...
Quote:
I really need help with this one......

Changes made in indy 10 seem not to include TTL witch a really need to
solve my problem, or if some one out there knows of a better way to
resolve this then please be jolly over ther holliday and help me :)

Here is a sample of my code like i would think this should work on
earlier versions of indy

I'm not sure if this satifsfies all your processing requirements. The
changes in how TIdICMPClient handles ping responses were related to two
areas:

* multi-threaded pings
* packet differences between ECHO replies and TTL errors

You'll could use the TIdICMPClient.OnReply event handler to access TTL
information received in the reponse packets.

It would be easier to use the TIdTraceRoute component
(.\Core\IdTraceRoute.pas). It already handles the packet sequencing
issues, as well as Host IP to Host Name resolution. Check out the Trace
and DoReply methods in that unit.

hth...

---

function GetIspIP(const HostToTrace : String) : String; var ICMP:
TIdIcmpClient; i : Integer; begin result := ''; ICMP :=
TIdIcmpClient.Create; ICMP.ReceiveTimeout := 1000; ICMP.Host :=
HostToTrace; // for example google.com // the route should first return
my ip then router the the isp witch whould have a dns name // and i would
like to use that dns name for I := 1 to 20 - 1 do begin ICMP.TTL :=
ICMP.TTL; ICMP.Ping; // check if FromIpAddress includes domin.??(?) , not
only ip address if HasDnsIncluded(ICMP.ReplyStatus.FromIpAdress) then
begin //Extract Domin name result :=
ExtractDns(ICMP.ReplyStatus.FromIpAdress); exit; end; end; end;

Back to top
Don Siders
Guest





PostPosted: Wed Dec 27, 2006 11:54 pm    Post subject: Re: Delphi Indy 10 TIdIcmpClient Reply with quote

Quote:
Thank you for youīre input, i am now trying to use the TidTraceRoute
object
but when i call route.Trace i get a socket error #10013 access denied.
I donīt really under stand this problem because i donīt have a firewall or
virus protection
I tryed to run-->cmd-->tracert google.com
and there it works fine,, do i need administrative rights to call the
trace procedure ?

For WinNT and Win2000... definitely.

For WinXP, ICMP is tied to ICF(Internet Connetion Firewall). ICMP requests
/ responses are not enabled (by default) in Win XP and ICF. Changing ICF
settings requires Local Administrator privileges.

hth...
Back to top
Guest






PostPosted: Fri Dec 29, 2006 7:56 am    Post subject: Re: Delphi Indy 10 TIdIcmpClient Reply with quote

Iīm not getting the information i needed from the TidTraceRoute

this is what i get when i use the command promt trace route command

C:\Documents and Settings\valdi>tracert mbl.is
Tracing route to mbl.is [193.4.96.21]
over a maximum of 30 hops:

1 <1 ms <1 ms <1 ms dmz.basis.is [85.197.248.1]
2 <1 ms <1 ms <1 ms ipf-gw.basis.is [85.197.248.130]
3 1 ms 1 ms 1 ms basis-gw.ipf.is [85.197.255.137]
4 1 ms 1 ms 1 ms vl3-rtr1.tg.ipf.is [85.197.193.65]
5 1 ms 1 ms 1 ms rix-gw.islandssimi.is [193.4.59.13]
6 2 ms 2 ms 2 ms A024-V2009.metronet.is [193.4.253.131]
7 2 ms 3 ms 3 ms 193.4.252.166
8 2 ms 2 ms 3 ms neumann.mbl.is [193.4.96.21]

Trace complete.

This is what i get with the indy trace route

0.0.0.0 []
0.0.0.0 []
0.0.0.0 []
0.0.0.0 []
0.0.0.0 []
0.0.0.0 []
0.0.0.0 []
193.4.96.21 [neumann.mbl.is]

I need to get the first and second replay to identify the isp so i can
resolve the isp mail server witch in this case the isp is basis.is
then i try to gethostbyname mail.basis.is --> smtp.basis.is
if these are valid then i use them to send mail messages

does any one have an idea why i get different trace in Indy TidTraceRoute?
Does any one know of a better method of doing this?



"Don Siders" <sidersd (AT) att (DOT) net> wrote in message
news:4592b33e (AT) newsgroups (DOT) borland.com...
Quote:
Thank you for youīre input, i am now trying to use the TidTraceRoute
object
but when i call route.Trace i get a socket error #10013 access denied.
I donīt really under stand this problem because i donīt have a firewall
or virus protection
I tryed to run-->cmd-->tracert google.com
and there it works fine,, do i need administrative rights to call the
trace procedure ?

For WinNT and Win2000... definitely.

For WinXP, ICMP is tied to ICF(Internet Connetion Firewall). ICMP
requests / responses are not enabled (by default) in Win XP and ICF.
Changing ICF settings requires Local Administrator privileges.

hth...
Back to top
Ryan
Guest





PostPosted: Wed Feb 21, 2007 10:06 pm    Post subject: Re: Delphi Indy 10 TIdIcmpClient Reply with quote

I too am having the same problem using Indy 10.1.5.
Any calls to TIdICMPClient's TTL property (which I had to decend to use),
cause the ping to time out. This is despite the fact that if you look at the
packets using Ethereal, the pings return rapidly with 'TTL expired'. Yet by
using OnReply in aforementioned class I just get a timeout. I don't get it
at all.
So, I started using TIdTraceRoute. This comes back with hostname '' and ip
address = 0.0.0.0 for every hop, with FReplyStatus=rsTimeout.
What's going on!?
PS, I'm using windows 2003 server and delphi 2006.

<valdi (AT) dk (DOT) is> wrote in message news:459ef7b2 (AT) newsgroups (DOT) borland.com...
Quote:
Does any one know of a solution for this problem?
I this a know bug?





valdi (AT) dk (DOT) is> wrote in message news:459475d7 (AT) newsgroups (DOT) borland.com...
Iīm not getting the information i needed from the TidTraceRoute

this is what i get when i use the command promt trace route command

C:\Documents and Settings\valdi>tracert mbl.is
Tracing route to mbl.is [193.4.96.21]
over a maximum of 30 hops:

1 <1 ms <1 ms <1 ms dmz.basis.is [85.197.248.1]
2 <1 ms <1 ms <1 ms ipf-gw.basis.is [85.197.248.130]
3 1 ms 1 ms 1 ms basis-gw.ipf.is [85.197.255.137]
4 1 ms 1 ms 1 ms vl3-rtr1.tg.ipf.is [85.197.193.65]
5 1 ms 1 ms 1 ms rix-gw.islandssimi.is [193.4.59.13]
6 2 ms 2 ms 2 ms A024-V2009.metronet.is [193.4.253.131]
7 2 ms 3 ms 3 ms 193.4.252.166
8 2 ms 2 ms 3 ms neumann.mbl.is [193.4.96.21]

Trace complete.

This is what i get with the indy trace route

0.0.0.0 []
0.0.0.0 []
0.0.0.0 []
0.0.0.0 []
0.0.0.0 []
0.0.0.0 []
0.0.0.0 []
193.4.96.21 [neumann.mbl.is]

I need to get the first and second replay to identify the isp so i can
resolve the isp mail server witch in this case the isp is basis.is
then i try to gethostbyname mail.basis.is --> smtp.basis.is
if these are valid then i use them to send mail messages

does any one have an idea why i get different trace in Indy
TidTraceRoute?
Does any one know of a better method of doing this?



"Don Siders" <sidersd (AT) att (DOT) net> wrote in message
news:4592b33e (AT) newsgroups (DOT) borland.com...
Thank you for youīre input, i am now trying to use the TidTraceRoute
object
but when i call route.Trace i get a socket error #10013 access denied.
I donīt really under stand this problem because i donīt have a firewall
or virus protection
I tryed to run-->cmd-->tracert google.com
and there it works fine,, do i need administrative rights to call the
trace procedure ?

For WinNT and Win2000... definitely.

For WinXP, ICMP is tied to ICF(Internet Connetion Firewall). ICMP
requests / responses are not enabled (by default) in Win XP and ICF.
Changing ICF settings requires Local Administrator privileges.

hth...


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock 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.