Re: retrieving your IP address
Re: retrieving your IP address
- Subject: Re: retrieving your IP address
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 23 Oct 2002 11:20:03 +0200
On Wednesday, October 23, 2002, at 04:06 AM, Kris Amico wrote:
If you don't mind using SystemConfiguration.framework, you could use
SCDynamicStoreCopyValue to get the dictionary at:
State:/Network/Global/IPv4
From that dictionary, grab the service ID at "PrimaryService" and then
copy
the dynamic store data at the key:
State:/Network/Service/[your service id]/IPv4
In that dictionary, the IP addresses are stored at "Addresses".
If you want a good look at what information you can get at in the
dynamic
store, use SCDynamicStoreCopyKeyList then SCDynamicStoreCopyMultiple
and
dump the data somewhere. The cool thing about using SC for this is
that you
can register to be notified when the IPv4 information changes so that
you
can have the very latest data when, say, the Customer switches to a
different network location.
there is also the scutil tool.
_______________________________________________
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.