Using SystemConfiguration to get BSD network device properties
Using SystemConfiguration to get BSD network device properties
- Subject: Using SystemConfiguration to get BSD network device properties
- From: Andrew White <email@hidden>
- Date: Thu, 07 Aug 2008 12:32:42 +1000
I'm trying to use Core Foundation's system configuration to get information
on the installed network devices.
The following gets me a dictionary containing a key 'Interfaces' which has
an array of BSD interface names:
CFStringRef intfKey =
SCDynamicStoreKeyCreateNetworkInterface (
NULL, kSCDynamicStoreDomainState
);
CFPropertyListRef intfRef = SCDynamicStoreCopyValue (_store, intfKey);
Given this info, I can iterate through the interfaces, but the info I can
get seems limited. What I really want to know is the interface type, but
using the Hardware key (for example) doesn't seem to do anything. I can
get the IPv4 addressing information (see next snipppet), but that's not
really what I want.
Getting addresses: for interface 'name', this gets an dictionary containing
"Addresses", "Broadcast Masks", and "Subnet Masks".
CFStringRef intfEntityKey =
SCDynamicStoreKeyCreateNetworkInterfaceEntity (
NULL, kSCDynamicStoreDomainState, name, kSCEntNetIPv4
);
CFPropertyListRef intf = SCDynamicStoreCopyValue (_store, intfEntityKey);
Is there a way to get this stuff from the dynamic store NetworkInterface
info, or do I need to go digging elsewhere? Do I need to use the POSIX API
to get this info?
Platform is 10.4.x and up. Currently using 10.4.11 and XCode 2.4.1.
Thanks
--
Andrew White
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden