[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: Thu, 25 Nov 2021 20:41:30 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2

Am 25.11.2021 um 17:02 schrieb Grant Edwards:
On 2021-11-24, goldsimon@gmx.de <goldsimon@gmx.de> wrote:
Am 24.11.2021 um 16:33 schrieb Grant Edwards:
On 2021-11-24, Simon Küppers <simon.kueppers@2pi-labs.com> wrote:

If I understand you correctly, you could also use
LWIP_HOOK_UNKNOWN_ETH_PROTOCOL provided by LWIP, so you do not need to
implement separate receive queues.

That's interesting — it would allow you to receive arbitrary Ethernet
protocols, but there's no way to send them?

It's an integration for raw lwIP, not for the socket API. Sending raw
packets from raw lwIP is easy: just call netif->linkoutput() with the
pbuf to send on the netif you want to send on (or use ip_route() to get

That would be fine. On the non-Linux systems in the past, it's been
done using non-sockets functions like that.

When using core locking (LOCK_TCPIP_CORE()), you can even use this from
any application thread for TX.

You were previously asking about a linux-ish socket way to do that

It doesn't actually need to be the socket API signature or to use
socket file descriptors.

Well, if this threading model is ok for you, than the hook provided by
Simon should work, yes. You just have to watch out for which packet your
driver actually delivers to lwIP.

However, in situations where I have used other ETH protocols, I also
needed to use a hiegher priority for these packets, so I had to divert
them before passing packets to the tcpip_thread and handle the packets
in a higher priority thread. But for this scenario, there is no help in
the lwIP code available, it was implemented at driver level.


reply via email to

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