• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting Local IP Address in MacOS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Getting Local IP Address in MacOS X (From: Gerry Beggs <email@hidden>)

  • Prev by Date: Getting Local IP Address in MacOS X
  • Next by Date: Re: Getting Local IP Address in MacOS X
  • Previous by thread: Getting Local IP Address in MacOS X
  • Next by thread: Re: Getting Local IP Address in MacOS X
  • Index(es):
    • Date
    • Thread