Reputation: 7117
I am new to Mac-OS-X development. I want to get the users Network details just for displaying it in my application. Details such as the IP address, Subnet mask, status whether connected or not, etc.
Is it possible to get the same??
And secondly, Is the IP address different for wireless lan connections and the normal ethernet connections?? I am a little weak at networking concepts.
Any help will be appreciated.
note: I already tried searching the apple developer site for leads but wat i could find is only the System Configuration Programming guide
Upvotes: 1
Views: 2547
Reputation: 7117
Strange.. There are no Frameworks or classes to get the IP address... But i somehow managed to get my hands on the following information.. First with this reference.. And secondly i found that..
preferences.plist
.But if we set the IP to DCHP, then we can get the ConfigMethod as "DCHP" and hence check the com.apple.network.identification.plist
, it'll have the details for the IP address.
Hence with the use of both the plist and checking whether the ConfigMethod is "Manual" or "DCHP" we can get the current IP address albeit this is not documented anywhere.
Upvotes: 2