AnsweredAssumed Answered

vrf What's my IP address?

Question asked by VRFuser on Jan 29, 2004
> (IP Works from devSoft Inc.)

IP Works should have a "local IP" property somewhere that will tell you your
local IP. If not, it's easy enough to get it from the Winsock auto library:
Set s = CreateObject("MSWinsock.Winsock"); then your IP is s.LocalIp. There
are plenty of ways to get at it if that's  unsatisfactory.

One of the most solid I can think of offhand would be to use gethostbyname.
The basic sequence would be GetComputerName, gethostbyname, copy the first
entry in the returned HOSTENT's h_addr_list  member to an IN_ADDR struct and
call inet_ntoa on it. The result is a dotted internet address as a string.

You could get it right from the TCP layer and bypass winsock but that would
be a pretty harrowing experience. It might be difficult to dig up the right
control codes to send the driver, and even when you do find them duplicating
the CTL_CODE macro can be frustrating.

Always reject the loopback address (127.x.x.x).

Broadcasting is a heavy duty subject! Does this IP Works just abstract it
all?
-SHAWN-


---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Send your favorite VEE example to "VRF-EXAMPLES@agilent.com" for possible inclusion in VEE 7.0!

Outcomes