tokio-tun icon indicating copy to clipboard operation
tokio-tun copied to clipboard

Create a device from a `RawFd`

Open cbranch opened this issue 3 years ago • 0 comments

Tun implements AsRawFd but it would be useful to support FromRawFd or moral equivalent. The use case is if you inherit a fd for a tun device or receive it from another process, but want to use it in an async context with tokio-tun instead of treating it as a standard file.

Obviously in this case you do not have a handle to the tun interface description and can't get MTU/address etc. which prevents a trivial implementation of FromRawFd.

cbranch avatar Oct 10 '22 13:10 cbranch