|
-
October 15th, 1999, 04:23 AM
#1
how to get the host ip
when i connect to internet through dial,
how can i get the host's ip address
-
October 15th, 1999, 05:29 AM
#2
Re: how to get the host ip
I don't know if you want know yourself address when you connect on ppp and achive a ip address.
you can input
"route print"
under dos window.
-
October 15th, 1999, 11:02 PM
#3
Re: how to get the host ip
thanks a lot,
can you teach how to get it through c code
-
October 16th, 1999, 11:54 AM
#4
Re: how to get the host ip
Hi !
try using gethostname(*) which fills a buffer with the name
of the local host.
Once you have the name, use gethostbyname(*) which
returns a pointer to a HOSTENT structure.
Next to other things this structure contains a list of
IP-addresses used by the host specified in the
call to gethostbyname.
if your computer is not part of an ip-network it should
only return the ip-address given to you by your provider.
regards,
Matthias.
-
October 16th, 1999, 09:39 PM
#5
Re: how to get the host ip
thank you a lot,
and can you teach me how to get the ISP's ip address?
-
October 17th, 1999, 10:01 AM
#6
Re: how to get the host ip
Hi again !
for what you want to do I think you need to get a bit deeper into the internals
of TCP/IP.
TCP/IP supports numerous options which you can fill in the header of
a TCP/IP-packet. One of these options lets you record the route that
a packet takes from a source host to a destination host. The IP-addresses
of all hosts along the route of the paket are actually written to the header
of the packet ( the header's length is not fixed ). The problem with
this option is that it's not supported by all IP-stacks ( that's what I know ).
Take a look at the RFCs for TCP/IP to get to the details.
Regards,
Matthias.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|