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: Gordon Scott <email@hidden>
- Date: Wed, 4 Nov 2009 11:59:26 -0800
>>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);
>> ...
Thanks, That got me closer but I'm still missing or not understanding something. The created service does not appear in the Network Preferences.
modem = LookupInterfaceByBsdName(...);
ppp = SCNetworkInterfaceCreateWithInterface(modem, kSCNetworkInterfaceTypePPP);
service = SCNetworkServiceCreate(prefs, ppp);
SCNetworkServiceSetName(service, CFSTR("TEST SERVICE"));
SCNetworkServiceSetEnabled(service, 1);
SCNetworkSetRef currentSet = SCNetworkSetCopyCurrent();
SCNetworkSetAddService(currentSet, service);
CFRelease(currentSet);
SCPreferencesSynchronize(prefs);
CFRelease(prefs);
If I recreate preferences and try to locate the service it is not found and does not appear in Network preferences panel
_______________________________________________
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