🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #164

Re: How can I Trace the Route to an IP Addres from within my program

#164
From: Bob Gonder
Date: Sat, 28 Jun 2008 23:44
77 lines
3132 bytes
DreamChaser wrote:
>Bob Gonder wrote:
>> 	option[0].cbType = IP_OPT_EOL;
>> 
>should be:
>  	option[1].cbType = IP_OPT_EOL;
>
>Just looks wrong to me to be [0]. I'm just checking. Thanks again.

No wonder it "worked" but the output looked wrong.

	UCHAR	OptionSize = sizeof(RecordRouteOption);
	RecordRouteOption option[2] = {0};
	IP_OPTION_INFORMATION info = {0};

	DWORD	ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(option) +
				sizeof(SendData) + 8;
	ICMP_ECHO_REPLY* reply = (PICMP_ECHO_REPLY) malloc(ReplySize);

	info.Ttl = 255;
	info.OptionsSize = OptionSize + 1; // IP_OPT_RR + IP_OPT_EOL
	info.OptionsData = (PUCHAR)&option[0];

	memset(option,0,sizeof(option) );
	option[0].cbType = IP_OPT_RR;
	option[0].cbSize = OptionSize;
	option[0].pointer = 4;
	//option[1].cbType = IP_OPT_EOL;
	info.OptionsData[ OptionSize ] = IP_OPT_EOL;

Option too large.
An invalid or inconsistent flowspec was found in the QOS structure.

That error is good down to...
	UCHAR	OptionSize = 3+(10*4);

Then at this, or lower....
	UCHAR	OptionSize = 3+(9*4);
Request timed out.
Error due to lack of resources.

Then at
	UCHAR	OptionSize = 3+(0*4); or 64*4 == same thing
Bad option.
There are no senders.

 - - -

Changing the IP to a local machine, and OptionSize = 3+(8*4),

Reply from 192.168.0.3: bytes=5, time=  0ms TTL=128
Data: Hello
InfoAddress:902BBC

TimeToLive:128
TypeOfService:0
Flags:0
OptionsSize:36
OptionsData:902BC4
Type:7
Size:35
Pointer:8
IP2=0
IP1=300A8C0

Increasing OptionSize on this "working" version, gives
Option too large.

Changing the IP on this "working" version to non-existant local ip:
Request timed out.
Error due to lack of resources.

 - - -
Conclusions:
1) Options maxes out at 9 IP_ADDR
2) It needs some way of getting to the requested IP.
3) Aborts on Vista.
Technical Details
Message-ID: <cq1d64tov4s5l9arqm4g22beo2brfb63fu@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.isoc.lu!newsgroups.borland.com!not-for-mail
References: <MPG.22c8301ab312798c989a97@newsgroups.borland.com> <485faf40$1@newsgroups.borland.com> <MPG.22cb3a3e698457ac989a9a@newsgroups.borland.com> <rrj264107nnff1gqarmhq4p0v1c23k6801@4ax.com> <4861dce2$1@newsgroups.borland.com> <4862a806$1@newsgroups.borland.com> <486484c8$1@newsgroups.borland.com> <reoa64t03o0hdpjmju08fv7iusknnru0jo@4ax.com> <4865c7a7@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,7aa64e4617379849
X-Google-Attributes: gid11508e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <none@nowhere.invalid>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: How can I Trace the Route to an IP Addres from within my program
Date: Sat, 28 Jun 2008 16:44:19 -0700
Message-ID: <cq1d64tov4s5l9arqm4g22beo2brfb63fu@4ax.com>
References: <MPG.22c8301ab312798c989a97@newsgroups.borland.com> <485faf40$1@newsgroups.borland.com> <MPG.22cb3a3e698457ac989a9a@newsgroups.borland.com> <rrj264107nnff1gqarmhq4p0v1c23k6801@4ax.com> <4861dce2$1@newsgroups.borland.com> <4862a806$1@newsgroups.borland.com> <486484c8$1@newsgroups.borland.com> <reoa64t03o0hdpjmju08fv7iusknnru0jo@4ax.com> <4865c7a7@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.147.203
X-Trace: newsgroups.borland.com 1214696654 67.77.147.203 (28 Jun 2008 16:44:14 -0700)
Lines: 79
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.isoc.lu!newsgroups.borland.com!not-for-mail