• 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
Problems setting the Terminal Script for PPP on OS X?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Re: Problems setting the Terminal Script for PPP on OS X? [half solved]
      • From: Dave Camp <email@hidden>
  • Prev by Date: Re (2): OTBind + Serial Endpoint
  • Next by Date: Re: gethostbyname under 10.2
  • Previous by thread: Re (2): OTBind + Serial Endpoint
  • Next by thread: Re: Problems setting the Terminal Script for PPP on OS X? [half solved]
  • Index(es):
    • Date
    • Thread