Re: OTOptionManagement help?
Re: OTOptionManagement help?
- Subject: Re: OTOptionManagement help?
- From: Quinn <email@hidden>
- Date: Mon, 2 Dec 2002 09:56:28 +0000
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.