[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Support for raw Ethernet packets?

From: address@hidden
Subject: Re: [lwip-users] Support for raw Ethernet packets?
Date: Mon, 22 Nov 2021 19:59:22 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2

Am 22.11.2021 um 18:55 schrieb Grant Edwards:

Does lwIP support applications that need to send/receive raw Ethernet
packets? It looks like lwIP's raw "connection" type is only for
sending and receiving IP packets.

What I'm looking for would the equivalent to the code below on Linux:

     import socket
     eth_proto = 0x12345
     s = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, eth_proto)

     #include <sys/socket.h>
     eth_proto = 0x12345;
     s = socket(AF_PACKET, SOCK_RAW, htons(eth_proto));

Not, this is not implemented yet: while it would probably be easy to add
that, it seemed overkill for the systems using lwIP in the past: every
matching packet needs to be copied (unless noone else is interested in
the pbuf) and sent to another thread. In the past, the answer to request
like this was to add a hook into input processing to check for matching
packets. However, this then runs in the tcpip_thread, not in an
application thread.

That's not to say I would mind accepting a patch that implemented this,
it just hasn't really been requested yet...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]