[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] raw ethernet questions
On Wed, Apr 12, 2000 at 10:44:49AM -0400, j_clifton@aerosimulation.com wrote:
> Anyone (especially simulation types) have any examples of using raw ethernet? I
> am trying to connect a Evans & Sutherland ESIG 5350 Image generator and they use
> raw ethernet. I am running Redhat 6.0/6.1 SMP.
>
> I read the network newsgroups and cobbled up some code but it doesn't compile.
> Man 4 packet refers to using a sockaddr_ll struct to pass the MAC address but
> bind, sendto, and recvfrom all complain about type errors because they want a
> sockaddr, not a sockaddr_ll.
You generally may freely cast struct sockaddr_* to struct sockaddr, which is
appropriate here.
> Also, what is a sll_ifindex?
ifindex is the network interface index. Each interface has an index, such as
lo=0, eth0=1, eth1=2, etc. This is necessary in order for the kernel to send
your packet out the correct interface. You can match interface names to
indices using the SIOCGIFINDEX ioctl.
dave...