• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get the current IP address using CF api from C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >How to get the current IP address using CF api from C? (From: Mathias Kolehmainen <email@hidden>)

  • Prev by Date: Re: MoreAuthSample
  • Next by Date: Re: Distributed Objects
  • Previous by thread: Re: How to get the current IP address using CF api from C?
  • Next by thread: Re: MoreAuthSample
  • Index(es):
    • Date
    • Thread