Re: OTOptionManagement help?
Re: OTOptionManagement help?
- Subject: Re: OTOptionManagement help?
- From: Dylan Barrie <email@hidden>
- Date: Tue, 3 Dec 2002 07:16:45 -0800
I've tried doing:
option.len = kOTFourByteOptionSize;
option.level = LNK_TPI;
option.name = OPT_SETRAWMODE;
option.status = 0;
option.value[0] = 0;
req.opt.buf = (UInt8 *) &option;
req.opt.len = sizeof (option);
req.flags = T_CURRENT;
ret.opt.buf = (UInt8 *) &option;
ret.opt.maxlen = sizeof (option);
err = ep->OptionManagement (&req, &ret);
ThrowIfOSErr_ (err);
if (option.status != T_SUCCESS)
ThrowIfOSErr_ (option.status);
SignalString_ (LStr255 ((long)*(UInt32 *)option.value));
as well (which is copied and pasted from that IM:NWOT site), and it too
returns the KOTBadOptionErr error.
I thought it might have something to do with the fact that I'm running
this under Classic, but I tried it on a comp running OS 9 and the same
error occurred.
Also, what does LNK_TPI refer to? I would have thought the link level
you'd want to use for this would be LNK_ENET?
Thanks again,
Dylan Barrie
PfhorSlayer
On Monday, December 2, 2002, at 10:01 PM,
email@hidden wrote:
At 22:56 -0800 30/11/02, Dylan Barrie wrote:
option.len = kOTOptionHeaderSize;
option.level = LNK_TPI;
option.name = OPT_SETRAWMODE;
option.status = 0;
option.value[0] = 0;
req.opt.buf = (UInt8 *) &option;
req.opt.len = kOTOptionHeaderSize;
req.flags = T_CURRENT;
ret.opt.buf = (UInt8 *) &option;
ret.opt.maxlen = sizeof (option);
Error -3151 is kOTBadOptionErr. OPT_SETRAWMODE is a 4 byte option.
When you go to read the option, you should set option.len and
req.opt.len to the length of this specific option buffer (ie
kOTFourByteOptionSize, not kOTOptionHeaderSize). Otherwise OT has
nowhere to put the resulting 4 bytes.
Better yet, use known working code, such as the code from the
OTLLCTest sample.
<http://developer.apple.com/samplecode/Sample_Code/Networking/
OTLLCTest/NegotiateRawModeSample.c.htm>
Or the Set/GetFourByteOption functions from IM:NWOT.
<http://developer.apple.com/techpubs/mac/NetworkingOT/NetworkingWOT-
39.html>
Whenever I need to set or get an option I just copy and paste this
code because otherwise it's way too confusing (-:
S+E
--
Quinn "The Eskimo!"
<http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications,
Hardware
_______________________________________________
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.