-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How we are using smoltcp
#999
Comments
I'm not sure what you mean with these adapters. Could you point to the source more specific?
Currently, there is no public function that just handles one IP packet. Interacting with smoltcp is only done using the poll functions. This is because smoltcp does more than just handling a packet. For example, it needs to update fragmentation buffers, it needs to clear outdated neighbours. We have private functions that process single packets, but making them public will be a foot gun. |
Sure. Here is the Here is the accompanying Here is how it is initialised: https://github.com/firezone/firezone/blob/3a62709c77931644e33f5c76f5c9f93b1fbaa7f4/rust/dns-over-tcp/src/server.rs#L53 And how we feed packets to it: https://github.com/firezone/firezone/blob/3a62709c77931644e33f5c76f5c9f93b1fbaa7f4/rust/dns-over-tcp/src/server.rs#L141 Overall, the current API feels a bit "object-oriented". I need to create a kind of stub-device that I feed with a buffer because The |
I reached for
smoltcp
because I needed to implement a TCP DNS server inside a TUN driver. The code is here: https://github.com/firezone/firezone/tree/main/rust/dns-over-tcp/srcBecause we are also handling all sorts of other traffic and
smoltcp
is only responsible for managing TCP sockets, I had to create some adapter structs and workarounds to be able to selectively dispatch IP packets to it. It actually works pretty well but it took me a while to figure these things out.smoltcp
if you already have IP packets and want to just give it tosmoltcp
for processing?The text was updated successfully, but these errors were encountered: