Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PBRemoteAccess function...



How did you make the "PPP Config" file?

From my understanding (and we tried this path as well), the document
format for this call has never been published. It was part of some
earlier version of Remote Access but has since been abandonded and is no
longer used (although this API may actually still work for compatibility
reasons).

I dont think this API can be used. The best you can do is use the default
connect method with out the connect document specified. As I recall this
will connect to the current RA configuration. The current configuration
can be controlled using Network Setup (or MoreNetworkSetup). I have
gotten this API to work using the parameters however, I could never get
the document version to work.

There are other limitations to this API that make it infeasible for most
uses. The password is in clear text and limited to 8 characters and the
user name is limited to 34 characters. You also need to make an educated
guess as to what lttype should be. (Thanks to a technote that I found and
later experimented with 'pppl' seems to be the answer.)

I would suggest using a different path, such as the PPP port interface or
AppleScript. (Warning: PPP AppleScript is broken on 9.1 due to a missing
library.)

Hmm, that seems to leave only one solution. :-)

In our code we use a combination of the two interfaces (PBRemoteAccess
and the PPP Port) depending on what we are doing. We have found problems
with both interfaces under some extreme conditions. Its frustrating
because the Remote Access modules and interfaces (control panel and
control strip) themselves seem to be quite stable but third-party authors
trying to do the same thing experience instabilities.

Good luck.

..Duane Murphy

--- At Mon, 18 Jun 2001 18:26:59 +0200, Giovanni Azua wrote:

>Hi all,
>
>Can anyone tell me where to find the implementation of PBRemoteAccess
>function??? I mean what is the library?
>
>and/or why is it that this snippet works for loading ARA:
>
> TRemoteAccessParamBlock loadPB;
>
> loadPB.LOAD.csCode = RAM_EXTENDED_CALL; // extended call
> loadPB.LOAD.resultStrPtr = nil; // result string
> loadPB.LOAD.extendedType = (char*)REMOTEACCESSNAME; // to remote access
> loadPB.LOAD.extendedCode = CmdRemoteAccess_Load; // try to load
> MorePBRemoteAccess(&loadPB, false); // issue sync call
>
> if (loadPB.LOAD.ioResult)
> {
> Str255 numberAsString;
> NumToString(loadPB.LOAD.ioResult,numberAsString);
> MessageBox("\pError", numberAsString);
> ExitToShell();
> }
>
>and fails with this next call to Connect to a saved PPP config with the
>error -5835 ERR_DAMAGED - "The ARA file has been modified;")???
>
>TRemoteAccessParamBlock connectPB;
>Str255 PathName;
>
>strcpy((char*)PathName,(char*)"\pMacintosh HD:GNDialerRASConfg");
>
>// Test if we can actually get the file...
>FSSpec fileSpec;
>OSErr err = FSMakeFSSpec(0,0,PathName,&fileSpec);
>
>LoadRemoteAccess(); // Get the Remote Access Manager
>
>// loaded
>connectPB.CONNECT.csCode = RAM_EXTENDED_CALL;
>connectPB.CONNECT.resultStrPtr = NULL;
>connectPB.CONNECT.extendedType = (char*)REMOTEACCESSNAME
>connectPB.CONNECT.extendedCode = CmdRemoteAccess_DoConnect;
>connectPB.CONNECT.portGlobalsPtr = nil;
>connectPB.CONNECT.fileInfo.vRefNum = 0;
>connectPB.CONNECT.fileInfo.parID = 0;
>
>strcpy((char*)&connectPB.CONNECT.fileInfo.name,(char*)&PathName);
>
>// Ask for password if needed, use connection document, & show connection
>connectPB.CONNECT.optionFlags = kNSCanInteract | kNSConnectDocument
> | kNSShowStatus
> | kNS2SavvyFlags // Use the 2.0 flags below
> | kNSAR2Connection // connection to a 2.0 server
> | kNSNotifyWhileConnected;
>
>MorePBRemoteAccess(&connectPB, false); // issue sync call
>
>if (connectPB.CONNECT.ioResult)
>{
> Str255 numberAsString;
> NumToString(connectPB.CONNECT.ioResult,numberAsString);
> MessageBox("\pError", numberAsString);
> ExitToShell();
> }
>
>
>Regards,
>Giovanni
>_______________________________________________
>opentransportdev mailing list
>email@hidden
>http://www.lists.apple.com/mailman/listinfo/opentransportdev


References: 
 >PBRemoteAccess function... (From: Giovanni Azua <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.