dndx / phantun

Transforms UDP stream into (fake) TCP streams that can go through Layer 3 & Layer 4 (NAPT) firewalls/NATs.
Apache License 2.0
1.66k stars 133 forks source link

Building phantun in FreeBSD failed #90

Closed hshh closed 1 year ago

hshh commented 1 year ago

Tested git version. Here is error log.

Compiling tokio-util v0.7.4 error[E0433]: failed to resolve: could not find linux in the crate root --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-tun-0.7.0/src/tun.rs:1:12 | 1 | use crate::linux::interface::Interface; | ^^^^^ could not find linux in the crate root

error[E0433]: failed to resolve: could not find linux in the crate root --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-tun-0.7.0/src/tun.rs:2:12 | 2 | use crate::linux::io::TunIo; | ^^^^^ could not find linux in the crate root

error[E0433]: failed to resolve: could not find linux in the crate root --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-tun-0.7.0/src/tun.rs:3:12 | 3 | use crate::linux::params::Params; | ^^^^^ could not find linux in the crate root

error[E0432]: unresolved imports libc::IFF_NO_PI, libc::IFF_TAP, libc::IFF_TUN --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-tun-0.7.0/src/builder.rs:7:12 7 use libc::{IFF_NO_PI, IFF_TAP, IFF_TUN}; ^^^^^^^^^ ^^^^^^^ ^^^^^^^ no IFF_TUN in the root
no IFF_TAP in the root
no IFF_NO_PI in the root
help: a similar name exists in the module 7 use libc::{IFF_NOARP, IFF_TAP, IFF_TUN}; ~~~~~ help: a similar name exists in the module
7 use libc::{IFF_NO_PI, IFF_UP, IFF_TUN};
~~

help: a similar name exists in the module | 7 | use libc::{IFF_NO_PI, IFF_TAP, IFF_UP}; | ~~

error[E0412]: cannot find type Tun in this scope --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-tun-0.7.0/src/builder.rs:166:38 166 pub fn try_build(self) -> Result { ^^^ not found in this scope
help: consider importing this struct 1 use crate::Tun;
error[E0433]: failed to resolve: use of undeclared type Tun --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-tun-0.7.0/src/builder.rs:167:9 167 Tun::new(self.into()) ^^^ not found in this scope
help: consider importing this struct 1 use crate::Tun;

error[E0412]: cannot find type Params in this scope --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-tun-0.7.0/src/builder.rs:179:35 | 179 | impl<'a> From<TunBuilder<'a>> for Params { | ^^^^^^ not found in this scope

error[E0599]: no method named files found for struct Arc<_> in the current scope --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-tun-0.7.0/src/tun.rs:110:26 | 110 | for &fd in iface.files() { | ^^^^^ method not found in Arc<_>

error[E0599]: no method named clone found for struct Arc<_> in the current scope --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-tun-0.7.0/src/tun.rs:112:30 | 112 | iface: iface.clone(), | ^^^^^ method not found in Arc<_>

Some errors have detailed explanations: E0412, E0432, E0433, E0599. For more information about an error, try rustc --explain E0412. error: could not compile tokio-tun due to 9 previous errors warning: build failed, waiting for other jobs to finish...

dndx commented 1 year ago

tokio-tun which Phantun uses lacks BSD support for now. This is really not high on my priority list to contribute this to tokio-tun as I am not a BSD user. But if anyone could contribute this Phantun should work with FreeBSD easily.