musl version
This commit is contained in:
parent
f8c213c8c7
commit
78351e0493
@ -1,5 +1,5 @@
|
||||
[target.x86_64-unknown-linux-musl]
|
||||
linker = "x86_64-linux-musl-gcc"
|
||||
linker = "musl-gcc"
|
||||
|
||||
[target.aarch64-unknown-linux-gnu]
|
||||
linker = "aarch64-linux-gnu-gcc"
|
||||
|
||||
734
Cargo.lock
generated
734
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "punchnet"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
@ -30,7 +30,7 @@ tracing = "0.1.40"
|
||||
myactor = { git = "https://gitea.s5s8.com/rust/actor-rs.git" }
|
||||
bytes = "1.11.1"
|
||||
quinn = "0.11.9"
|
||||
rustls = "0.23.37"
|
||||
rustls = { version = "0.23.37", features = ["ring", "std"]}
|
||||
rustls-pemfile = "2.2.0"
|
||||
clap = { version = "4.5.60", features = ["derive", "env"] }
|
||||
rpassword = "7.4.0"
|
||||
|
||||
13
Makefile
13
Makefile
@ -22,16 +22,23 @@ libtun-so-clang:
|
||||
cd src/network && clang -fPIC -shared -o libtuntap.so tuntap.c && cd -
|
||||
|
||||
libtun-so:
|
||||
cd src/network && gcc -fPIC -shared -o libtuntap.so tuntap.c && cp libtuntap.so ../.. && cd -
|
||||
rm libtuntap.* && cd src/network && gcc -fPIC -shared -o libtuntap.so tuntap.c && cp libtuntap.so ../.. && cd -
|
||||
|
||||
libtun-so-aarch64:
|
||||
cd src/network && aarch64-linux-gnu-gcc -fPIC -shared -o libtuntap.so tuntap.c && cp libtuntap.so ../.. && cd -
|
||||
rm libtuntap.* && cd src/network && aarch64-linux-gnu-gcc -fPIC -shared -o libtuntap.so tuntap.c && cp libtuntap.so ../.. && cd -
|
||||
|
||||
pack:
|
||||
tar -czvf punchnet.tar.gz punchnet punchnet.service libtuntap.so install.sh
|
||||
|
||||
libtun-musl:
|
||||
rm libtuntap.* && touch libtuntap.so && cd src/network && musl-gcc -c tuntap.c -o libtuntap.o && ar rcs libtuntap.a libtuntap.o && cp libtuntap.a ../.. && cd -
|
||||
|
||||
|
||||
deb-musl: libtun-musl
|
||||
RUSTFLAGS="-L ." cargo deb --target x86_64-unknown-linux-musl --deb-revision="1-static"
|
||||
|
||||
deb: libtun-so
|
||||
RUSTFLAGS="-L ." cargo deb
|
||||
RUSTFLAGS="-L ." cargo deb --deb-revision="1-dynamic"
|
||||
|
||||
deb-aarch64: libtun-so-aarch64
|
||||
RUSTFLAGS="-L ." cargo deb --target aarch64-unknown-linux-gnu
|
||||
|
||||
@ -354,7 +354,7 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
let should_daemonize = false;
|
||||
let should_daemonize = true;
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
if should_daemonize {
|
||||
|
||||
@ -8,16 +8,16 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/socket.h>
|
||||
#ifdef __linux__
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_tun.h>
|
||||
#else
|
||||
// #ifdef __linux__
|
||||
// #include <linux/if.h>
|
||||
// #include <linux/if_tun.h>
|
||||
// #else
|
||||
#include <net/if.h>
|
||||
#define IFF_TUN 0x0001
|
||||
#define IFF_TAP 0x0002
|
||||
#define IFF_NO_PI 0x1000
|
||||
#define TUNSETIFF _IOW('T', 202, int)
|
||||
#endif
|
||||
// #endif
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user