• 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
How to find the primary network interface?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to find the primary network interface?


  • Subject: How to find the primary network interface?
  • From: Stephane <email@hidden>
  • Date: Thu, 12 Oct 2006 13:27:10 +0200

In Mac OS X, there can be multiple network interface enabled and running at the same time. For instance, you can be connected to the Internet though the Ethernet Port and sharing the connection with other computers on AirPort. But AFAIK, there is only one interface that is used to send packets to the outside using applications such as Safari, Mail, iChat, ftp, etc...

I would like to know what this interface is.

I had a look at the SystemConfiguration frameworks API and while I saw some yummy features, I didn't seem to find any API to do this.

A look at the Networking sample code list didn't show anything either.

So is there a way with the system configuration framework to get this information without having to use some "tricky" stuff such as creating a socket to find which default network interface is going to be used? Could it be something like enumerating all the network configurations and finding the first one with an enabled IP address?


_______________________________________________ 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
  • Follow-Ups:
    • Re: How to find the primary network interface?
      • From: Allan Nathanson <email@hidden>
  • Prev by Date: Re: Strange TCP-networking problems with Mac OS X 10.4 and Solaris 10
  • Next by Date: Re: How to find the primary network interface?
  • Previous by thread: Re: Strange TCP-networking problems with Mac OS X 10.4 and Solaris 10
  • Next by thread: Re: How to find the primary network interface?
  • Index(es):
    • Date
    • Thread