Re: How to get the current IP address using CF api from C?
Re: How to get the current IP address using CF api from C?
- Subject: Re: How to get the current IP address using CF api from C?
- From: Tom Marchand <email@hidden>
- Date: Mon, 20 Mar 2006 19:45:37 -0500
Unless the linux is doing something weird, you should be able to use
the same code.
On Mar 20, 2006, at 2:40 PM, Mathias Kolehmainen wrote:
I'm porting some linux code to OSX, and I'm trying to figure out
how to get the current IP address. I'm using C with no gui, and so
I'm using the CoreFoundation API.
Looks like I am supposed to use the configuration system. What I
can't figure out from the docs is how to get a handle to the
configuration system.
My first attempt used SCNetoworkInterfaceCopyAll. That seems to
return proper SCNetworkInterfaceRef objects, but when I try to run
SCNetworkInterfaceGetConfiguration on them it always returns a NULL
dictionary.
So, what is the proper way to get into the system configuration
database? And if somebody knows how to navigate to the current-ip-
address property, that would be useful too.
(Am I supposed to use the IOKit? I notice the GetMACAddressSample
sample code uses the IOKit...)
thanks,
-mathias
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40comcast.net
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden