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...



All of this information is in the same Developer kit that the ARA trap
information came in. I think its the OpenTransport Developer Kit
available on the Apple Developer website.

You will find an entire document that talks about the 'PPP' Port and the
ioctl calls that can be made to control the connection and get status
from the connection.

Good guess on the ARA document, that's what I thought also, but was
informed by Apple folks that this was in fact _not_ and ARA document that
was being referred to.

Good luck,
..Duane

--- At Wed, 20 Jun 2001 11:26:34 +0200, Giovanni Azua wrote:

>Hello Duane,
>
>I really appreciate your help and found it quite helpful!!!
>
>I tried the same snippet avoiding specifying the kNSConnectDocument
>flag and the "ARA Document" (I created this ARA document by exporting
>a valid configuration from the Remote Access Panel). Now it takes the
>parammeters specified inside the TRAConnectInfoTemplate struct and inits
>the call.
>
>Since I haven't found any samples using the ARA API could you send me some
>snippet for specifying username and passw? and maybe also controlling the
>status of the connection after issuing the Connect command.
>
>Best Regards and thank you again,
>Giovanni
>
>----- Original Message -----
>From: <email@hidden>
>To: "OpenTransport Developers" <email@hidden>
>Sent: Monday, June 18, 2001 7:19 PM
>Subject: Re: PBRemoteAccess function...
>
>> 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
>> _______________________________________________
>> opentransportdev mailing list
>> email@hidden
>> http://www.lists.apple.com/mailman/listinfo/opentransportdev


References: 
 >Re: 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.