Problems setting the Terminal Script for PPP on OS X?
Problems setting the Terminal Script for PPP on OS X?
- Subject: Problems setting the Terminal Script for PPP on OS X?
- From: Dave Camp <email@hidden>
- Date: Tue, 27 Aug 2002 11:06:15 -0700
I'm working on a front end setup app that lets the user choose from a
list of ISPs and click a Connect button to start a PPP connection. Some
of the ISPs require a custom connection script (also called a terminal
script in OS 9 I think) as they have non-standard PPP login prompts.
I have not had any success in getting my connection scripts executed at
the right time in my OS X app, either on 10.1 or 10.2. I was hoping
someone could tell me what I;m doing wrong...
The first method I tried was using OT. My code looks like:
result = InitOpenTransportInContext(kInitOTForApplicationMask, nil);
endpointRef =
OTOpenEndpointInContext(OTCreateConfiguration(kPPPControlName),0, nil,
&result, nil);
result = OTInstallNotifier(endpointRef, NotifyProc, self);
OTSetAsynchronous(endpointRef);
result = OTIoctl(endpointRef, I_OTGetMiscellaneousEvents, (void*) 1);
info.fScriptLength = [buffer length];
info.fScriptType = kPPPScriptTypeConnect;
info.fTheScript = (void*) [buffer bytes];
result = OTIoctl(endpointRef, I_OTScript, &info);
Then, in my NotifyProc I have something like:
case kPPPSetScriptCompleteEvent:
result = OTIoctl(endpointRef, I_OTConnect, &info);
When the connect call executes, I get a Console message saying
something like "can't find script /tmp/OTScript.XXXX" and the connect
fails. Just for fun I tried copying my script to /tmp/OTScript.XXXX and
the error went away, but it appeared to be running my connection script
in place of the modem script. Not what I had intended at all.
The second method I tried was to modify MoreSCF (since I'm already
using it to create my location and PPP settings) to be able to set the
terminal script. I added another CFStringRef to the PPPDigest struct
and the following line in MoreSCFDigest.c:MoreSCFCreatePPPEntry.
CFDictionaryAddValue(result, kSCPropNetPPPCommTerminalScript,
terminalScript)
I've tried placing the script in /Library/Modem Scripts and passing the
name of the script, and passing the full path to the script, but
neither seems to have any effect.
What am I doing wrong?
Thanks,
Dave
---
Among the chief weapons of UNIX: Fear, surprise and ruthless
efficiency.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.