Re: Raw Ehternet Sockets on 10.1?
Re: Raw Ehternet Sockets on 10.1?
- Subject: Re: Raw Ehternet Sockets on 10.1?
- From: "Duane Murphy" <email@hidden>
- Date: Mon, 29 Sep 2003 11:47:14 -0700
Thanks for this vote of confidence Rich. Unfortunatelly I tried
BSDLLCTest between 10.2 and 10.1.5 and the 10.1.5 machine couldnot
receive any packets.
This seems to be the same problem I am experiencing in my code.
I did the following tests:
10.2.3 Sending -> 10.2.6 Receiving, this worked fine.
10.2.3 Sending -> 10.1.5 Receiving, does not work
The code shown is the leaf of three functions that do the right thing for
each protocol type. In the case we are having trouble with, we are doing
SNAP. We also do ETHERTYPE as well (ARP). We havent tried this on
ETHERTYPE yet.
The receiving machine is a PowerBook G3 (Firewire; aka Pismo) in case
that matters. The tests were done on Ethernet (built-in), not AirPort.
I would appreciate any additional information concerning this problem.
Thanks,
...Duane
--- At Fri, 26 Sep 2003 23:51:57 -0700, Rich Kubota wrote:
>
Duane,
>
>
I recall that I was able to process incoming packets under 10.1 with
>
the BSDLLCTest sample. As for your comment that ndrv_demux_desc and
>
SETDMXSPEC are not defined, that is true for the headers which
>
shipped with the tools supplied for 10.1. However, 10.1 was compiled
>
using these definitions, and they are required in order to use raw
>
ethernet mode.
>
>
The code snippet below should work as it is similar to the code in
>
the BSDLLCTest sample. The one thing which is not clear - is
>
in_demux[0].type set for NDRV_DEMUXTYPE_ETHERTYPE,
>
NDRV_DEMUXTYPE_SAP, or NDRV_DEMUXTYPE_SNAP. I recall that raw mode
>
reception worked for NDRV_DEMUXTYPE_SAP and NDRV_DEMUXTYPE_SNAP. I
>
don't recall testing with the type set for NDRV_DEMUXTYPE_ETHERTYPE
>
under 10.1.5. I still have a system with 10.1.5 present. I modify the
>
sample and see if the sample works with the type set for
>
NDRV_DEMUXTYPE_ETHERTYPE.
>
>
rich kubota
>
>
>
At 1:03 PM -0700 9/26/03, Duane Murphy wrote:
>
>Could part of the problem be that ndrv_demux_desc and SETDMXSPEC are not
>
>available in 10.1? How does one listen for packets of raw sockets on 10.1?
>
>
>
>Here is an example of what we are doing to register to listen. This does
>
>not return an error.
>
>
>
>int add_protocol_match(
>
> int fd, u_int32_t prot_family, ndrv_demux_desc* in_demux )
>
>{
>
> ndrv_protocol_desc desc = {};
>
>
>
> desc.version = NDRV_PROTOCOL_DESC_VERS;
>
> desc.protocol_family = prot_family;
>
> desc.demux_count = 1;
>
> desc.demux_list = in_demux;
>
>
>
> int result = setsockopt(
>
> fd, SOL_NDRVPROTO, NDRV_SETDMXSPEC,
>
> reinterpret_cast< caddr_t >( &desc ),
>
> sizeof desc );
>
> return result;
>
>}
>
>
>
>Thank you for any clarification or help.
>
>
>
>--- At Fri, 26 Sep 2003 12:42:02 -0700, Duane Murphy wrote:
>
>
>
>>--- At Fri, 26 Sep 2003 12:21:42 -0700, Duane Murphy wrote:
>
>>
>
>>>We are using raw ethernet sockets to communicate to a custom hardware
>
>>>device. On 10.2 everything seems to be working correctly. However, we are
>
>>>not having success on 10.1.
>
>>>
>
>>>Network traces show that packets are being successfully sent and the
>
>>>device is responding. However, we never see the packets.
>
>>>
>
>>>We are using CFSocket to manage the socket. We only use the
>
>>>kCFSocketReadCallBack. We also use setsockopt with NDRV_SETDMXSPEC in
>
>>>order to register to recieve packets of the correct type.
>
>>>
>
>>>I have not been able to find specific notes that would indicate a problem
>
>>>on 10.1. Our working theory is that it is one of these (setsockopt or
>
>>>CFSocket) that are the problem.
>
>>>
>
>>>Does anyone have a clue what we could be doing wrong to prevent things
>
>>>from working on 10.1?
>
>>>
>
>>>Thanks for the help,
>
>>
>
>>I should add that this is on 10.1.5. We would at least like to support
>
>>10.1.5 but more previous versions would be great (up to
>
>>SystemConfiguration support).
_______________________________________________
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.