Re: equivalent of sockaddr_ll? or raw packets w/no header?
Re: equivalent of sockaddr_ll? or raw packets w/no header?
- Subject: Re: equivalent of sockaddr_ll? or raw packets w/no header?
- From: "Duane Murphy" <email@hidden>
- Date: Wed, 27 Aug 2003 22:04:35 -0700
--- At Wed, 27 Aug 2003 21:43:40 -0700, Roy Lovejoy wrote:
>
I'm porting some linux code that drives a hardware device via low-level
>
ethernet frames.
>
>
What's the moral equivalent to sockaddr_ll on OSX??
>
>
the code expects to set
>
>
bindaddr.sll_family = AF_PACKET;
>
bindaddr.sll_protocol = kProto;
>
bindaddr.sll_ifindex = if_index;
>
>
I went down the path of trying to use OpenTransport, with RawIP, but I
>
could never NOT send the header (thus my packets
>
that were supposed to be 18 bytes bloated to 38 bytes), even though I
>
negotiated IP_HDRINCL and XTI_PROTOTYPE
>
successfully. (watching carefully in tcpdump)
>
>
Then I tried mach sockets, and though I could create & bind a SOCK_RAW,
>
I could not write() nor sendto() successfully.
>
>
Any & all help appreciated.
I'm not familiar with sockaddr_ll, but I do a lot of raw ethernet
packets. Take a look at the BSDLLCTest sample code. This uses a PF_NDRV
raw ethernet socket. Unlike OT, PF_NDRV sends the entire packet so I
suspect you can put anything you want into it.
Note that raw ethernet sockets require privilege to open, but you
probably know that.
...Duane
_______________________________________________
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.