v***@dk.is
2006-12-23 13:52:06 UTC
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
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;
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
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;