[squeak-dev] Figuring out external IP addresses of network interfaces

Frank Shearar frank.shearar at gmail.com
Mon Mar 6 03:04:17 UTC 2017


On 4 March 2017 at 09:40, Hari Balaraman <hari.balaraman at icloud.com> wrote:

> Hi All,
>
> I was wondering if there is a way to figure out the IP addresses of
> various network interfaces on a host machine. I've looked at some traffic
> on the list from a few years ago (6-7 years ago) that appeared to indicate
> there was no way to do this. As far as I could tell, there was a workaround
> using (running regularly) shell script that would write interface
> information to a file that could then be scooped up by the image.
>
> I was wondering if things have changed.
>
> I'd like an application to be aware of and be able to provide the IP
> address and port it is listening on for requests from the outside world
> (not localhost.)
>
> Thanks in advance.
>
> Kind regards,
>
> Hari
>
>
I'm unaware of any Squeak library doing this, but sounds like you want an
FFI interface to the iphlpapi DLL, on a Windows box. That will let you
iterate over interfaces, addresses of interfaces, and so on. It's in
Delphi, but you can see the APIs can be used here:
https://github.com/frankshearar/SipStack/blob/master/src/IdNetworking.pas

frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170305/249b491a/attachment.html>


More information about the Squeak-dev mailing list