Re: Is enet DLPI compatible ??
Re: Is enet DLPI compatible ??
- Subject: Re: Is enet DLPI compatible ??
- From: "Suhail Kazi" <email@hidden>
- Date: Sat, 17 Aug 2002 17:50:06 +0530
Hi Rich,
On Friday, August 16, 2002, at 11:16 AM, Rich Kubota wrote:
The enet0 driver is dlpi compatible under Mac OS 9.
Thanks very much for the confirmatory answer. In fact in my sample code
I was trying to check if enet0 is DLPI compatible, by passing it a
DL_ATTACH_REQ and check if I can get a DL_OK_ACK, so that I get to know
that enet0 responds to DLPI primitives hence it is DLPI compatible.
When I send a DL_ATTACH_REQ, am I wrong in expecting a DL_OK_ACK ?
You are correct, you should receive the DL_OK_ACK when you make the
OTStreamGetMessage following the OTStreamPutMessage (which is where the
DL_ATTACH_REQ is passed to the driver.
The
OT[Get/Put]Message() calls work fine. Irrespective of whatever
primitive
I Put, I always receive a DL_INFO_REQ(value 0) back in return. Can
someone point me out what is wrong in the code below ?? I have gone
through some chapters of "Inside Mac:Netwking with OT" and
"OTAdvancedClientProgramming"(OT-ACP) book. At one point (Ref:
OTACP-Ch3 - RawStreams) mentions three ways to open/create a Stream
1. OTOpenEndpoint(OTCreateConfiguration("tcp")....).
2. OTCreateStream(OTCreateConfiguration("tcp")....)
3. OTStreamOpen("/dev/tcp",...)
In looking at the code below, the first thing is that you are mixing
the OT methods for accessing the ethernet driver. You start by using
the OT endpoint API's, to open a connection with the ethernet driver
(method 1 as you list it), then follow with the streams API calls to
perform the attach and bind functions (method 3 by your list)
What I understand from this is OTStream[Get/Put]Message corresponds to
streams opened by OTStreamOpen(...). This is accessing streams at the
lowest level, also called as raw streams. And OT[Snd/Rcv]UData is used
along with OTOpenEndpoint(as used in OTLLCTest sample). This is using OT
STREAMS at a higher level which hides the internal "raw streams" for us,
and provides us with an endpoint interface.
If the above two statements are right then when will we use
OT[Get/Put]Message ? Will they be used with the 1st, 2nd or 3rd method
of Streams ?
I can provide a sample using strictly the OT Endpoint API's to
demonstrate how to communicate with the Ethernet driver.
Thanks Rich, I got your OTLLCTest code, and trying to figure out its
full working.
As for using the stream's api, I can also provide code to get you
started.
It will be my pleasure to lay my hands on some streams code. Please do
the honors. Thanks very much. What I am looking at currently is to make
the following somewhat Unixish code into OT code on 9. However any kind
of Streams sample code you might have is always welcome.
=====================================
fd = open("/dev/EthernetDevice"...)
request_struct myRequest.dl_primitive = DL_ATTACH_REQ;
putmsg(fd, &myRequest...); //Send a attach req downstream.
reply_struct myReply;
getmsg(fd, &myReply...); // Get a reply.
check if myReply.dl_primitive is DL_OK_ACK; //Check if request
was ACK'ed.
Similarly follow the above steps for (DL_BIND_REQ/DL_BIND_ACK),
(DL_GET_STATISTICS_REQ/DL_GET_STATISTICS_ACK)..so on.
=====================================
What I am going to do now is to map the above calls as shown below. Do
let me know if I am wrong.
fd -> to -> OTStreamOpen(..);
getmsg -> to -> OTStreamGetMessage()
putmsg -> to -> OTPutMessage();
=====================================
Can you let me know the best method to go about for the above. That will
be a real boon at this moment.
In the meantime I'll dirty my hands with above mapping..and check out
if that works for me.
Thanks again for all the help.
Best Regards,
Suhail.
_______________________________________________
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.