• 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
IPSec not a "supported" protocol for PPP interfaces?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IPSec not a "supported" protocol for PPP interfaces?


  • Subject: IPSec not a "supported" protocol for PPP interfaces?
  • From: Nathan Duran <email@hidden>
  • Date: Thu, 20 Dec 2007 10:07:54 -0800

When I create a new L2TP VPN service in my network preferences, it builds a stack of interfaces like so:

IPv4
 |
L2TP
 |
PPP

It then creates the new service, and adds the following protocols to it:

Proxies, DNS, IPv4, IPv6, SMB, IPSec

When I attempt to mimic this behavior via

---
SCNetworkInterfaceRef l2tpInterface = SCNetworkInterfaceCreateWithInterface(kSCNetworkInterfaceIPv4, kSCNetworkInterfaceTypeL2TP);
SCNetworkInterfaceRef pppInterface = SCNetworkInterfaceCreateWithInterface(l2tpInterface, kSCNetworkInterfaceTypePPP);
SCNetworkServiceRef vpnService = SCNetworkServiceCreate(prefs, pppInterface);


SCNetworkServiceEstablishDefaultConfiguration(vpnService);
SCNetworkServiceSetName(vpnService, CFSTR("Whatever"));
SCNetworkSetAddService(SCNetworkSetCopyCurrent(prefs), vpnService);

if ( !SCNetworkServiceAddProtocolType(vpnService, kSCValNetL2TPTransportIPSec) )
{
SCNetworkInterfaceRef theRealVPNInterface = SCNetworkServiceGetInterface(vpnService);
CFArrayRef supportedProtocols = SCNetworkInterfaceGetSupportedProtocolTypes(theRealVPNInterface);

CFShow(supportedProtocols);
}
---


SCNetworkServiceAddProtocolType fails with SCError reporting "Invalid argument 1002" and the output of CFShow is as follows:

<CFArray 0x124400 [0xa0317174]>{type = mutable-small, count = 5, values = (
0 : <CFString 0xa06ca69c [0xa0317174]>{contents = "DNS"}
1 : <CFString 0xa06ca68c [0xa0317174]>{contents = "IPv4"}
2 : <CFString 0xa06ca67c [0xa0317174]>{contents = "IPv6"}
3 : <CFString 0xa06ca66c [0xa0317174]>{contents = "Proxies"}
4 : <CFString 0xa06ca65c [0xa0317174]>{contents = "SMB"}
)}


So if IPSec isn't a supported protocol, then how is it being added? I actually already have code to do this via SCPreferencesSetValue, thereby bypassing the apparently flawed logic in the higher-level method, but it's hideous and I'm trying to stop using it now that VPN config settings are no longer scattered across multiple unrelated preferences files.




_______________________________________________ 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: IPSec not a "supported" protocol for PPP interfaces?
      • From: Allan Nathanson <email@hidden>
  • Prev by Date: SCPreferencesCreateWithAuthorization: an open invitation to malware developers
  • Next by Date: Re: IPSec not a "supported" protocol for PPP interfaces?
  • Previous by thread: SCPreferencesCreateWithAuthorization: an open invitation to malware developers
  • Next by thread: Re: IPSec not a "supported" protocol for PPP interfaces?
  • Index(es):
    • Date
    • Thread