Get a list of all available network interfaces (en0, en1, en2, etc) with Cocoa?

cocoa, networking, objective-c

Solution

Better than wrapping ifconfig you shall check the reference of SCNetworkConfiguration which is part of Core Foundation.

Check SCNetworkInterfaceXxx functions for details.

Problem

In my Cocoa application I want to show the user a list of available network interfaces, like Wireshark does: What is the best way of getting such a list? Does Apple provide a framework for this, or must I use a C API from the standard library or another library?

Original source