• 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
Can't get non-physical network interfaces from SC framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't get non-physical network interfaces from SC framework


  • Subject: Can't get non-physical network interfaces from SC framework
  • From: Jamie Griffin <email@hidden>
  • Date: Tue, 15 Nov 2005 00:17:29 -0500

Hi all-

I need to get a list of all network interfaces on a system in BSD- name format. The following call will get all physical interfaces (I have made use of the no-penalty CF to NS type conversions):

NSArray *interfacesArray = CFArrayCreateCopy(NULL, SCNetworkInterfaceCopyAll());

I can then use SCNetworkInterfaceGetBSDName() on each element to get the BSD names.

However, this only gets me physical interfaces and completely ignores the Network system prefs.

I would like to get all "virtual" interfaces. An example: Say a user has a modem installed and has setup 2 configurations in the prefs. This method will only return "modem" rather than "ppp0" and "ppp1" as I'd like.

If I use SCNetworkSetCopyServices() I get the full list from system prefs but when I then call SCNetworkServiceGetInterface() on an element and SCNetworkInterfaceGetBSDName() on the result, I still get a physical interface name. In the case of the previous example, I would get "modem" twice. This also has some odd quirks (such as returning en0 twice even if there is only one setup for it in system prefs).

Any ideas...
Thanks.

Sorry if I haven't described this well, I've been looking at this code for way too long...

Jamie Griffin
<email@hidden>


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: Maximum file name length?
  • Next by Date: DC Metro area User Group?
  • Previous by thread: [Meet] Cocoaheads New York City - Tuesday Nov 15th
  • Next by thread: DC Metro area User Group?
  • Index(es):
    • Date
    • Thread