Re: macnetworkprog digest, Vol 3 #290 - 4 msgs
Re: macnetworkprog digest, Vol 3 #290 - 4 msgs
- Subject: Re: macnetworkprog digest, Vol 3 #290 - 4 msgs
- From: Dylan Barrie <email@hidden>
- Date: Wed, 4 Dec 2002 15:48:18 -0800
On Tuesday, December 3, 2002, at 10:01 PM,
email@hidden wrote:
as well (which is copied and pasted from that IM:NWOT site), and it
too returns the KOTBadOptionErr error.
Take a look at the DoNegotiateRawModeOption function in the following
sample.
<http://developer.apple.com/samplecode/Sample_Code/Networking/
OTLLCTest/NegotiateRawModeSample.c.htm>
That seems to handle all the special cases. Looking at that code
brings back memories of the 4 vs 12 byte raw mode options, depending
on which OT version you're using.
I am not having any trouble setting the endpoint to raw mode (which I
can do with a FourByteOption buffer), but rather, I can't get the raw
setting of the endpoint. I tried using that code (but zeroing the
value variables and using T_CURRENT) to get the value like so:
struct dl_recv_control_t {
unsigned long dl_primitive;
unsigned long dl_flags;
unsigned long dl_truncation_length;
};
TOption *option;
UInt8 twelveByteOpt[kOTOptionHeaderSize + 12];
TOptMgmt req, ret;
dl_recv_control_t *rawModePtr;
option = (TOption *)twelveByteOpt;
option->len = sizeof (twelveByteOpt);
option->level = LNK_TPI;
option->name = OPT_SETRAWMODE;
option->status = 0;
rawModePtr = (dl_recv_control_t *)&option->value;
rawModePtr->dl_primitive = 0;
rawModePtr->dl_flags = 0;
rawModePtr->dl_truncation_length = 0;
req.opt.buf = (UInt8 *) twelveByteOpt;
req.opt.len = kOTOptionHeaderSize;
req.flags = T_CURRENT;
ret.opt.buf = (UInt8 *) twelveByteOpt;
ret.opt.maxlen = sizeof (twelveByteOpt);
err = xboxep->OptionManagement (&req, &ret);
ThrowIfOSErr_ (err);
if (option->status != T_SUCCESS)
ThrowIfOSErr_ (option->status);
SignalString_ (LStr255 ((long)*(UInt32 *)&rawModePtr->dl_flags));
But I still get kOTBadOptionErr from the call to OTOptionManagement ().
I've tried changing req.opt.len to sizeof (twelveByteOpt), but that
doesn't work either. There has got to be something I'm missing here...
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?
These options are not implemented as part of the Ethernet driver
(which speaks DLPI, and hence can't be communicated with directly via
an OT endpoint). Instead, these options are implemented by the
"tpi8022x" module, which is automatically pushed on top of the stream
when you open an endpoint to an Ethernet port. Hence, LNK_TPI rather
than LNK_ENET.
Ahh, I get it now. Thanks. :)
Dylan Barrie
Postpose.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.