On Thu, Aug 27, 2009 at 10:09 AM, Mark McCray<marksmcc...@gmail.com> wrote:

> I've seen a bunch of methods for getting a list of ip addresses that a
> machine may have. But i haven't seen a Cocoa way of figuring out what
> ip address is attached to a given interface.  NSHost give's you IPs
> but which network interfaces those IPs are attached to.
>
> Can this be done with the SystemConfiguration Framework?
>
> Why do I need this? We know a bunch of our machines have many IPs but
> we only care about ethernet ip addresses. and we typically only care
> about ones that are en0 or en1. We want to write an application which
> will give this information to us easily without the user having to go
> into System Preferences.

If you know which interface(s) you want info about, you could run
"/sbin/ifconfig en0" with NSTask.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to