Re: Ip address of VPN
Re: Ip address of VPN
- Subject: Re: Ip address of VPN
- From: Quinn <email@hidden>
- Date: Tue, 22 Dec 2009 09:35:42 +0000
At 12:46 +0530 22/12/09, Vasavi Mahadev wrote:
I am trying to read the address from the below location:
/Leopard/Library/Preferences/SystemConfiguration/preferences.list/NetworkServices/IPv4
using the following API:
(NSArray*)SCDynamicStoreCopyKeyList(dynamicStore,(CFStringRef)@"State:/Network/Service/[^/]+/IPv4");
Actually, these are not related. The file you mention would be
accessed to by the System Configuration framework preferences API
(SCPreferences). The call you mention is part of the System
Configuration framework dynamic store API (SCDynamicStore). The
dynamic store only exists in memory, and it's used to hold the
current networking of the machine.
I'm not sure why your VPN IP address isn't showing up in the dynamic
store. I don't have a Cisco VPN set up to try this out, but I tested
the equivalent situation with the Apple VPN and it worked as
expected. I tested this with <x-man-page://8/scutil>:
$ # Before connecting with the VPN, all I see is my primary Wi-Fi interface.
$ scutil
list State:/Network/Service/[^/]+/IPv4
subKey [0] = State:/Network/Service/1F6ADF95-ABD2-4A7E-9412-4305CEE70C6A/IPv4
show State:/Network/Service/1F6ADF95-ABD2-4A7E-9412-4305CEE70C6A/IPv4
<dictionary> {
SubnetMasks : <array> {
0 : 255.255.255.240
}
Router : 217.41.101.30
NetworkSignature :
IPv4.Router=217.41.101.30;IPv4.RouterHardwareAddress=00:13:49:a6:8a:80
InterfaceName : en1
Addresses : <array> {
0 : 217.41.101.23
}
}
^D
$ # Now connect the VPN.
$ # Now I see both Wi-Fi and VPN.
list list State:/Network/Service/[^/]+/IPv4
no keys.
list State:/Network/Service/[^/]+/IPv4
subKey [0] = State:/Network/Service/1F6ADF95-ABD2-4A7E-9412-4305CEE70C6A/IPv4
subKey [1] = State:/Network/Service/20CA3728-0201-4F59-9EA1-50B2928B6EA2/IPv4
show State:/Network/Service/20CA3728-0201-4F59-9EA1-50B2928B6EA2/IPv4
<dictionary> {
Router : 17.151.64.19
DestAddresses : <array> {
0 : 17.151.64.19
}
ServerAddress : 17.151.63.19
NetworkSignature : VPN.RemoteAddress=vpn-cup-saci.apple.com
InterfaceName : ppp0
Addresses : <array> {
0 : 17.151.93.11
}
}
^D
$
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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