• 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: local IP adresses / local host names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: local IP adresses / local host names


  • Subject: Re: local IP adresses / local host names
  • From: Quinn <email@hidden>
  • Date: Thu, 10 Jul 2008 12:47:20 +0100

At 11:30 +0000 10/7/08, Andreas Fink wrote:
The host name is secondary and only used for display purposes. Reverse DNS or gethostname() should be sufficient in this case.

Good to know.

I'm connected to a corporate network via Ethernet and a WWAN network. I can bind to the WWAN IP or to the corporate IP or to "any". And same goes for IPv4 versus IPv6 sockets. To be able to decide on which IP's I want to listen to and to which I don't, I need to know what IP's are available on the system at the current time. So basically a list of IP Interfaces, their IP Addresses (IPv4 and IPv6) as they can have multiple.

The "Calling All IPs" section of the technote lists three choices, and the following sections describe those choices in some detail. AFAICT either option 1 (System Configuration framework) or option 3 (BSD sockets) will meet your needs.


For option 1, look at the code in Listings 6 and 7.

For option 3, search the text for "getifaddrs".

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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: 
 >local IP adresses / local host names (From: Andreas Fink <email@hidden>)
 >Re: local IP adresses / local host names (From: Quinn <email@hidden>)
 >Re: local IP adresses / local host names (From: Andreas Fink <email@hidden>)

  • Prev by Date: Re: local IP adresses / local host names
  • Next by Date: PAC files and CFNetworkCopyProxiesForAutoConfigurationScript()
  • Previous by thread: Re: local IP adresses / local host names
  • Next by thread: Re: local IP adresses / local host names
  • Index(es):
    • Date
    • Thread