Re: Getting Local IP Address in MacOS X
Re: Getting Local IP Address in MacOS X
- Subject: Re: Getting Local IP Address in MacOS X
- From: "Peter Lovell" <email@hidden>
- Date: Sat, 17 Sep 2005 10:43:40 -0400
>Hello.
>Forgive my ignorance.
>I'm starting to learn to develop for MacOS X from MacOS 9.
>A little late in the game, I know :)
>
>I am trying to find out how one would get the Local IP address of the
>machine without using Open Transport.
>
>I was using OTInetGetInterfaceInfo before to get the list of local IP
>addresses.
>
>Any pointers?
>
>Thanks.
Hi Gerry,
it depends upon what you're trying to do.
Do you want a single address to serve as an identifier of some sort, or
do you want the complete list?
If it's a single address you need, there's an IOKit sample on Apple
developer site <http://developer.apple.com/samplecode/
GetPrimaryMACAddress/GetPrimaryMACAddress.zip> which shows how to get
the primary Ethernet address - I expect getting the IP address from it
should be straightforward.
If you need the complete list (allowing for aliases, multiple
interfaces etc) then I can send you some code which does this.
Regards.....Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden