Re: Getting the IP addresses for my interfaces
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Mar 11, 2007, at 09:20 , Mark Gilbert wrote: Folks. Justin -- Justin C. Walker, Curmudgeon-At-Large Institute for the Enhancement of the Director's Income -------- Experience is what you get when you don't get what you want. -------- _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Sorry for what appears to be a really simple Question, but I can't find a simple answer I want to find out the IP address assigned to my en0 ethernet interface, programatically. Both Steve and Vincent provided good answers, but since you have a program that does what you want, why not check its source to see how it was done? If that doesn't help, 'netstat' and 'ifconfig' both do similar things. But wait! There's more: the 'what' command might help as well: $ what /usr/sbin/ipconfig /usr/sbin/ipconfig PROGRAM:ipconfig PROJECT:bootp-133 DEVELOPER:root BUILT:Wed Mar 23 23:45:02 PST 2005 $ what /usr/sbin/netstat /usr/sbin/netstat Copyright (c) 1983, 1988, 1993 PROGRAM:netstat PROJECT:network_cmds-245.15 DEVELOPER:root BUILT:Tue Aug 15 22:03:39 PDT 2006 $ what /sbin/ifconfig /sbin/ifconfig Copyright (c) 1983, 1993 PROGRAM:ifconfig PROJECT:network_cmds-245 DEVELOPER:root BUILT:Sun Mar 20 19:35:49 PST 2005 so you can track these to their lairs and lay them open to inspection :-}. Admittedly, this doesn't always provide the projects, but you can hope :-} This email sent to site_archiver@lists.apple.com
participants (1)
-
Justin C. Walker