Re: SCNetworkServiceCreate returns kSCStatusNoKey when trying to create a PPP service
Re: SCNetworkServiceCreate returns kSCStatusNoKey when trying to create a PPP service
- Subject: Re: SCNetworkServiceCreate returns kSCStatusNoKey when trying to create a PPP service
- From: Allan Nathanson <email@hidden>
- Date: Tue, 3 Nov 2009 19:58:21 -0500
On Nov 3, 2009, at 7:38 PM, Gordon Scott wrote:
> I've been using the MoreSCF code to generate PPP network services which is working okay.
> Since I'm only targeting 10.4 and later I wanted to try using the System Configuration API to do this.
> I am locating the proper SCNetworkInterfaceRef based on the bsd name of the modem however SCNetworkServiceCreate() always fails with error kSCStatusNoKey.
>
> Any ideas why this is happening? Anything I need to setup first in the SCNetworkInterfaceRef or the SCPreferencesRef before making this call?
You can't create a network service using just a modem interface. You must layer a PPP interface on top of the modem and then create the service with using the PPP interface.
SCNetworkInterfaceRef modem;
SCNetworkInterfaceRef ppp;
SCNetworkServiceRef service;
...
ppp = SCNetworkInterfaceCreateWithInterface(modem, kSCNetworkInterfaceTypePPP);
service = SCNetworkServiceCreate(prefs, ppp);
...
- Allan
_______________________________________________
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