• 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
How to get the current IP address using CF api from C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get the current IP address using CF api from C?


  • Subject: How to get the current IP address using CF api from C?
  • From: Mathias Kolehmainen <email@hidden>
  • Date: Mon, 20 Mar 2006 11:40:04 -0800

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: This email sent to email@hidden
  • Follow-Ups:
    • Re: How to get the current IP address using CF api from C?
      • From: Tom Marchand <email@hidden>
    • Re: How to get the current IP address using CF api from C?
      • From: "Justin C. Walker" <email@hidden>
  • Prev by Date: Re: UPnP Support
  • Next by Date: Re: How to get the current IP address using CF api from C?
  • Previous by thread: Re: UPnP Support
  • Next by thread: Re: How to get the current IP address using CF api from C?
  • Index(es):
    • Date
    • Thread