The "POSIX port" of lwip does the same. It takes the raw Ethernet bytes from a TUN/TAP device.
https://github.com/lwip-tcpip/lwip/blob/master/contrib/ports...