I managed to wire up rust-tun on Linux, but the detail is not essential, the important thing is to send IpPacket to the lwip component.
In lib.rs, in start_send of impl Sink for DnsTcpStack, with some logging, I can see that IpPacket is successfully parsed, when I use any program that uses tcp, it can be recognized as well, and self.tcp.start_send is called, then it's sent to netif, which goes into territory I'm not familiar with.
In src/tcp.rs, I see a TcpListener listening on 0.0.0.0, but when I add a simple println line in listener.for_each, nothing happends.
I think a simple test can be added to the lwip wrapper to confirm that when certain IpPacket is sent to it, the listener gets new connections. tun does not need to be involved in this test at all.
lwip wrapper still seems to be the easiest to use for a tun to socks program, I think I'm just a tiny step away from benefiting from it, it would be great if there is a test or example for the wrapper, it will help me a lot, right now I don't know how to start debugging, as I don't know either lwip or C