• 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: Network Devices (en0, en1, etc.) in an NSPopUpButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Network Devices (en0, en1, etc.) in an NSPopUpButton


  • Subject: Re: Network Devices (en0, en1, etc.) in an NSPopUpButton
  • From: Chris Ridd <email@hidden>
  • Date: Thu, 27 Nov 2003 15:21:31 +0000

On 27/11/03 2:22 pm, email@hidden
<email@hidden> wrote:

> I am writing a GUI wrapper for a command line tool and I need to pass
> an interface, such as "en0" or "en1" (the utility uses libpcap).
>
> Consequently I want to fill an NSPopUpButton with all the detected
> interfaces. What is the best way to do this? It seems pretty hard to
> get the unix interface names, such as "en0" from Carbon calls. Should I
> just use a libpcap call? Does anyone have any sample code or other
> suggestions.

The BSD getifaddrs() call returns a linked list of interface configurations
(type man getifaddrs).

You may also want to display the friendly name associated with each
interface like System Preferences (eg "Built-in Ethernet", "Airport"). I
think you can get that from the SystemConfiguration.framework, but I'm not
sure how and I can't find any documentation of it apart from the header
files.

Cheers,

Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Network Devices (en0, en1, etc.) in an NSPopUpButton
      • From: Chris Garaffa <email@hidden>
  • Prev by Date: Re: Is it possible to interact with Microsoft Office X programmatically
  • Next by Date: Re: Adding methods to NSString
  • Previous by thread: Network Devices (en0, en1, etc.) in an NSPopUpButton
  • Next by thread: Re: Network Devices (en0, en1, etc.) in an NSPopUpButton
  • Index(es):
    • Date
    • Thread