RE: local ip address?
RE: local ip address?
- Subject: RE: local ip address?
- From: "Bell, Carl" <email@hidden>
- Date: Wed, 21 Nov 2001 14:18:15 -0600
- Thread-topic: local ip address?
>
-----Original Message-----
>
From: Tom Waters [mailto:email@hidden]
>
Sent: Wed, November 21, 2001 11:22 AM
>
To: Cocoa Dev Mailing List
>
Subject: local ip address?
>
>
(this was asked on this list in september, but unanswered)
>
>
Is there a way in Cocoa/Foundation to get the ip address of
>
the machine my program is running on?
Howdy,
Although technically it's not Cocoa, I do have some code to get the
machine's local ip address(es), hardware address(es), and interface
name(s), that folks are welcome to use. It works in Cocoa apps and
should work in Carbon apps as well. IIRC, it was based on code in
one of the Stevens Unix Network Programming books. Anyway, you can
find it here:
<
http://carl-bell-2.baylor.edu/~bellc/temp/dumpaddrs.tar.gz>.
Included is a quick and dirty main.c file that just dumps the
addresses to stdout. If you try it and have any problems with it
or have any questions (or find any bugs! :-) please let me know.
-cb
________________________________________________________________________
Carl W. Bell <
http://www.baylor.edu/~Carl_Bell/index.html>
Sr. Analyst/Programmer Baylor University Academic Technology Center