Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting Local IP Address in MacOS X



>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:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden

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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.