1

I have to work with some device that sends me raw ethernet frames (dst MAC,Src MAC,type,data) with size 4088 bytes at rate 25Hz

and another raw ethernet frame (dst MAC,Src MAC,type,data) at size 30 bytes at rate 100Hz. Could someone please advice me how to read them in elegant way?

For now I simply check size and decide what type of packet is. As far as I got I can't use two sockets to read different frames.

Yu Hao
  • 119,891
  • 44
  • 235
  • 294
  • Would this answer your question? http://stackoverflow.com/questions/3366812/linux-raw-ethernet-socket-bind-to-specific-protocol – thuovila Oct 17 '13 at 08:17
  • Thank you! With filters it works. – Roman Grigoriev Oct 18 '13 at 10:44
  • I was thinking about the answer with the >= 0x0600 ethertypes, but I guess the filtering works equally well. Notice that if you are implementing for Linux only, you do not need libpcap. You can use linux socket filters https://www.kernel.org/doc/Documentation/networking/filter.txt a random example at http://blog.fpmurphy.com/2011/01/spoof-arp-and-icmp-echoreply-using-linux-packet-filter.html – thuovila Oct 18 '13 at 12:22

0 Answers0