Re: OTOptionManagement
Re: OTOptionManagement
- Subject: Re: OTOptionManagement
- From: Todd Casey <email@hidden>
- Date: Mon, 6 Oct 2003 11:28:11 -0700 (PDT)
Xavier,
Thank you for the great information! Everything works
great now!
Thanks,
Todd
--- Xavier Jubier <email@hidden> wrote:
>
>
> How do I use OTOptionManagement to set the
>
username (account name),
>
> password, and telephone number when using Open
>
Transport to establish
>
> a PPP dialup connection. Is this even the correct
>
function? From what
>
> I have read in the documentation I do this before
>
starting a
>
> connection using I_OTConnect.
>
>
>
> I am currently dialing a PPP connection using Open
>
Transport. The
>
> connection is using the default settings
>
(username, password, access
>
> number, etc). I need to set these settings
>
programmatically or even
>
> better without the user ever being able to see the
>
changes (temporary
>
> for the current connection).
>
>
To set the username you should do (check the code as
>
I have typed it by
>
memory):
>
>
Str255 myARAUserNameID; // Contains the
>
username
>
TOptMgmt myOptionsManagement;
>
TOption *myOption;
>
unsigned char myUsernameBuffer[sizeof(TOptionHeader)
>
+ kPPPMaxIDLength];
>
>
myOptionsManagement.opt.buf = myUsernameBuffer;
>
myOptionsManagement.opt.len = kOTOptionHeaderSize +
>
(myARAUserNameID[0]
>
* sizeof(unsigned char));
>
myOptionsManagement.opt.maxlen =
>
sizeof(myUsernameBuffer);
>
myOptionsManagement.flags = T_NEGOTIATE;
>
myOption = (TOption *) myUsernameBuffer;
>
myOption->len = kOTOptionHeaderSize +
>
(myARAUserNameID[0] *
>
sizeof(unsigned char));
>
myOption->level = COM_PPP;
>
myOption->name = SEC_OPT_ID;
>
myOption->status = T_SUCCESS;
>
BlockMoveData(&(myARAUserNameID[1]),
>
&(myOption->value[0]),
>
myARAUserNameID[0]);
>
myOTStatus = OTOptionManagement(myEndpointRef,
>
&myOptionsManagement,
>
&myOptionsManagement);
>
>
Then you wait for the option to be set (event in
>
notifier).
>
>
>
To set the password you use the SEC_OPT_PASSWORD
>
option,
>
CC_OPT_DTEADDRESS for the phone number,
>
CC_OPT_DTEADDRESSTYPE for the
>
Data Terminal Equipment, OPT_ALERTENABLE for the
>
information set, ...
>
(there are other option such as reminder timer, PPP
>
header compression,
>
...)
>
>
>
>
> Also, is there a way to programmatically set the
>
"Connect
>
> automatically when needed" PPP option?
>
>
Not to my knowledge. But since you want to control
>
when to make or
>
close a connection it shouldn't be a problem.
>
>
>
Xavier
>
>
>
>
> Thanks,
>
>
>
> Todd
>
> The New Yahoo! Shopping - with improved product
>
search
>
> _______________________________________________
>
> 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.
>
>
>
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
_______________________________________________
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.