From 5566f1847f1a6ca3b8a3cd59fea4addfccaec22e Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 12 May 2025 11:04:17 +1000 Subject: [PATCH] refactor(rust): move crates into a more sensical hierarchy (#9066) The current `rust/` directory is a bit of a wild-west in terms of how the crates are organised. Most of them are simply at the top-level when in reality, they are all `connlib`-related. The Apple and Android FFI crates - which are entrypoints in the Rust code are defined several layers deep. To improve the situation, we move around and rename several crates. The end result is that all top-level crates / directories are: - Either entrypoints into the Rust code, i.e. applications such as Gateway, Relay or a Client - Or crates shared across all those entrypoints, such as `telemetry` or `logging` --- .github/actions/setup-rust/action.yml | 8 +- kotlin/android/app/build.gradle.kts | 2 +- rust/Cargo.lock | 190 +++++++++--------- rust/Cargo.toml | 44 ++-- .../android => android-client-ffi}/Cargo.toml | 4 +- .../android => android-client-ffi}/src/lib.rs | 2 +- .../src/make_writer.rs | 0 .../android => android-client-ffi}/src/tun.rs | 0 .../apple => apple-client-ffi}/.gitignore | 0 .../apple => apple-client-ffi}/Cargo.toml | 4 +- .../apple => apple-client-ffi}/README.md | 0 .../apple => apple-client-ffi}/build-rust.sh | 0 .../apple => apple-client-ffi}/build.rs | 2 +- .../apple => apple-client-ffi}/src/lib.rs | 2 +- .../src/make_writer.rs | 0 .../apple => apple-client-ffi}/src/tun.rs | 0 rust/bin-shared/src/device_id.rs | 2 +- .../shared => client-shared}/Cargo.toml | 2 +- .../shared => client-shared}/src/callbacks.rs | 0 .../shared => client-shared}/src/eventloop.rs | 0 .../shared => client-shared}/src/lib.rs | 0 .../src/serde_routelist.rs | 0 rust/{ => connlib}/bufferpool/Cargo.toml | 0 rust/{ => connlib}/bufferpool/lib.rs | 0 rust/{ => connlib}/dns-over-tcp/Cargo.toml | 0 rust/{ => connlib}/dns-over-tcp/src/client.rs | 0 rust/{ => connlib}/dns-over-tcp/src/codec.rs | 0 .../dns-over-tcp/src/interface.rs | 0 rust/{ => connlib}/dns-over-tcp/src/lib.rs | 0 rust/{ => connlib}/dns-over-tcp/src/server.rs | 0 .../dns-over-tcp/src/stub_device.rs | 0 rust/{ => connlib}/dns-over-tcp/src/time.rs | 0 .../dns-over-tcp/tests/client_and_server.rs | 0 .../dns-over-tcp/tests/smoke_server.rs | 0 rust/{ => connlib}/dns-types/Cargo.toml | 0 rust/{ => connlib}/dns-types/lib.rs | 0 rust/{ => connlib}/etherparse-ext/Cargo.toml | 0 .../src/icmpv4_header_slice_mut.rs | 0 .../src/icmpv6_header_slice_mut.rs | 0 .../src/ipv4_header_slice_mut.rs | 0 .../src/ipv6_header_slice_mut.rs | 0 rust/{ => connlib}/etherparse-ext/src/lib.rs | 0 .../etherparse-ext/src/slice_utils.rs | 0 .../src/tcp_header_slice_mut.rs | 0 .../src/udp_header_slice_mut.rs | 0 rust/{ => connlib}/ip-packet/Cargo.toml | 0 .../proptest-regressions/proptests.txt | 0 .../ip-packet/src/fz_p2p_control.rs | 0 .../ip-packet/src/fz_p2p_control_slice.rs | 0 .../ip-packet/src/icmp_dest_unreachable.rs | 0 rust/{ => connlib}/ip-packet/src/lib.rs | 0 rust/{ => connlib}/ip-packet/src/make.rs | 0 rust/{ => connlib}/ip-packet/src/nat46.rs | 0 rust/{ => connlib}/ip-packet/src/nat64.rs | 0 rust/{ => connlib}/ip-packet/src/proptest.rs | 0 rust/{ => connlib}/ip-packet/src/proptests.rs | 0 rust/{ => connlib}/phoenix-channel/Cargo.toml | 0 .../phoenix-channel/src/get_user_agent.rs | 0 rust/{ => connlib}/phoenix-channel/src/lib.rs | 0 .../phoenix-channel/src/login_url.rs | 0 rust/{ => connlib}/socket-factory/Cargo.toml | 0 rust/{ => connlib}/socket-factory/src/lib.rs | 0 rust/{ => connlib}/tun/Cargo.toml | 0 rust/{ => connlib}/tun/src/ioctl.rs | 0 rust/{ => connlib}/tun/src/lib.rs | 0 rust/{ => connlib}/tun/src/unix.rs | 0 rust/gui-client/src-tauri/Cargo.toml | 2 +- rust/gui-client/src-tauri/src/service.rs | 8 +- rust/headless-client/Cargo.toml | 2 +- rust/headless-client/src/main.rs | 2 +- swift/apple/.swiftlint.yml | 2 +- .../apple/Firezone.xcodeproj/project.pbxproj | 20 +- .../Connlib.xcfilelist | 4 +- .../apple-client-ffi.h} | 0 .../apple-client-ffi.swift} | 0 .../Connlib/connlib.h | 2 +- swift/apple/Makefile | 4 +- swift/apple/cleanup.sh | 2 +- 78 files changed, 155 insertions(+), 155 deletions(-) rename rust/{connlib/clients/android => android-client-ffi}/Cargo.toml (94%) rename rust/{connlib/clients/android => android-client-ffi}/src/lib.rs (99%) rename rust/{connlib/clients/android => android-client-ffi}/src/make_writer.rs (100%) rename rust/{connlib/clients/android => android-client-ffi}/src/tun.rs (100%) rename rust/{connlib/clients/apple => apple-client-ffi}/.gitignore (100%) rename rust/{connlib/clients/apple => apple-client-ffi}/Cargo.toml (94%) rename rust/{connlib/clients/apple => apple-client-ffi}/README.md (100%) rename rust/{connlib/clients/apple => apple-client-ffi}/build-rust.sh (100%) rename rust/{connlib/clients/apple => apple-client-ffi}/build.rs (81%) rename rust/{connlib/clients/apple => apple-client-ffi}/src/lib.rs (99%) rename rust/{connlib/clients/apple => apple-client-ffi}/src/make_writer.rs (100%) rename rust/{connlib/clients/apple => apple-client-ffi}/src/tun.rs (100%) rename rust/{connlib/clients/shared => client-shared}/Cargo.toml (97%) rename rust/{connlib/clients/shared => client-shared}/src/callbacks.rs (100%) rename rust/{connlib/clients/shared => client-shared}/src/eventloop.rs (100%) rename rust/{connlib/clients/shared => client-shared}/src/lib.rs (100%) rename rust/{connlib/clients/shared => client-shared}/src/serde_routelist.rs (100%) rename rust/{ => connlib}/bufferpool/Cargo.toml (100%) rename rust/{ => connlib}/bufferpool/lib.rs (100%) rename rust/{ => connlib}/dns-over-tcp/Cargo.toml (100%) rename rust/{ => connlib}/dns-over-tcp/src/client.rs (100%) rename rust/{ => connlib}/dns-over-tcp/src/codec.rs (100%) rename rust/{ => connlib}/dns-over-tcp/src/interface.rs (100%) rename rust/{ => connlib}/dns-over-tcp/src/lib.rs (100%) rename rust/{ => connlib}/dns-over-tcp/src/server.rs (100%) rename rust/{ => connlib}/dns-over-tcp/src/stub_device.rs (100%) rename rust/{ => connlib}/dns-over-tcp/src/time.rs (100%) rename rust/{ => connlib}/dns-over-tcp/tests/client_and_server.rs (100%) rename rust/{ => connlib}/dns-over-tcp/tests/smoke_server.rs (100%) rename rust/{ => connlib}/dns-types/Cargo.toml (100%) rename rust/{ => connlib}/dns-types/lib.rs (100%) rename rust/{ => connlib}/etherparse-ext/Cargo.toml (100%) rename rust/{ => connlib}/etherparse-ext/src/icmpv4_header_slice_mut.rs (100%) rename rust/{ => connlib}/etherparse-ext/src/icmpv6_header_slice_mut.rs (100%) rename rust/{ => connlib}/etherparse-ext/src/ipv4_header_slice_mut.rs (100%) rename rust/{ => connlib}/etherparse-ext/src/ipv6_header_slice_mut.rs (100%) rename rust/{ => connlib}/etherparse-ext/src/lib.rs (100%) rename rust/{ => connlib}/etherparse-ext/src/slice_utils.rs (100%) rename rust/{ => connlib}/etherparse-ext/src/tcp_header_slice_mut.rs (100%) rename rust/{ => connlib}/etherparse-ext/src/udp_header_slice_mut.rs (100%) rename rust/{ => connlib}/ip-packet/Cargo.toml (100%) rename rust/{ => connlib}/ip-packet/proptest-regressions/proptests.txt (100%) rename rust/{ => connlib}/ip-packet/src/fz_p2p_control.rs (100%) rename rust/{ => connlib}/ip-packet/src/fz_p2p_control_slice.rs (100%) rename rust/{ => connlib}/ip-packet/src/icmp_dest_unreachable.rs (100%) rename rust/{ => connlib}/ip-packet/src/lib.rs (100%) rename rust/{ => connlib}/ip-packet/src/make.rs (100%) rename rust/{ => connlib}/ip-packet/src/nat46.rs (100%) rename rust/{ => connlib}/ip-packet/src/nat64.rs (100%) rename rust/{ => connlib}/ip-packet/src/proptest.rs (100%) rename rust/{ => connlib}/ip-packet/src/proptests.rs (100%) rename rust/{ => connlib}/phoenix-channel/Cargo.toml (100%) rename rust/{ => connlib}/phoenix-channel/src/get_user_agent.rs (100%) rename rust/{ => connlib}/phoenix-channel/src/lib.rs (100%) rename rust/{ => connlib}/phoenix-channel/src/login_url.rs (100%) rename rust/{ => connlib}/socket-factory/Cargo.toml (100%) rename rust/{ => connlib}/socket-factory/src/lib.rs (100%) rename rust/{ => connlib}/tun/Cargo.toml (100%) rename rust/{ => connlib}/tun/src/ioctl.rs (100%) rename rust/{ => connlib}/tun/src/lib.rs (100%) rename rust/{ => connlib}/tun/src/unix.rs (100%) rename swift/apple/FirezoneNetworkExtension/Connlib/Generated/{connlib-client-apple/connlib-client-apple.h => apple-client-ffi/apple-client-ffi.h} (100%) rename swift/apple/FirezoneNetworkExtension/Connlib/Generated/{connlib-client-apple/connlib-client-apple.swift => apple-client-ffi/apple-client-ffi.swift} (100%) diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index ecd51a0a9..8345d9f5f 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -18,14 +18,14 @@ outputs: description: Compilable packages for the current OS value: ${{ (runner.os == 'Linux' && '--workspace') || - (runner.os == 'macOS' && '--workspace --exclude ebpf-turn-router --exclude gui-smoke-test --exclude connlib-client-android') || - (runner.os == 'Windows' && '--workspace --exclude ebpf-turn-router --exclude connlib-client-apple --exclude connlib-client-android') }} + (runner.os == 'macOS' && '--workspace --exclude ebpf-turn-router --exclude gui-smoke-test --exclude android-client-ffi') || + (runner.os == 'Windows' && '--workspace --exclude ebpf-turn-router --exclude apple-client-ffi --exclude android-client-ffi') }} test-packages: description: Testable packages for the current OS value: ${{ (runner.os == 'Linux' && '--workspace') || - (runner.os == 'macOS' && '-p connlib-client-apple -p connlib-client-shared -p firezone-tunnel -p snownet') || - (runner.os == 'Windows' && '-p connlib-client-shared -p connlib-model -p firezone-bin-shared -p firezone-gui-client -p firezone-headless-client -p firezone-logging -p firezone-telemetry -p firezone-tunnel -p gui-smoke-test -p http-test-server -p ip-packet -p phoenix-channel -p snownet -p socket-factory -p tun') }} + (runner.os == 'macOS' && '-p apple-client-ffi -p client-shared -p firezone-tunnel -p snownet') || + (runner.os == 'Windows' && '-p client-shared -p connlib-model -p firezone-bin-shared -p firezone-gui-client -p firezone-headless-client -p firezone-logging -p firezone-telemetry -p firezone-tunnel -p gui-smoke-test -p http-test-server -p ip-packet -p phoenix-channel -p snownet -p socket-factory -p tun') }} nightly_version: description: The nightly version of Rust value: ${{ steps.nightly.outputs.nightly }} diff --git a/kotlin/android/app/build.gradle.kts b/kotlin/android/app/build.gradle.kts index 10cb842c5..93dee7abb 100644 --- a/kotlin/android/app/build.gradle.kts +++ b/kotlin/android/app/build.gradle.kts @@ -233,7 +233,7 @@ cargo { // Needed for Ubuntu 22.04 pythonCommand = "python3" prebuiltToolchains = true - module = "../../../rust/connlib/clients/android" + module = "../../../rust/android-client-ffi" libname = "connlib" verbose = true targets = diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 4274e9c75..fcf97ee81 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -78,6 +78,39 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "android-client-ffi" +version = "1.4.9" +dependencies = [ + "android_log-sys", + "anyhow", + "backoff", + "client-shared", + "connlib-model", + "dns-types", + "firezone-logging", + "firezone-telemetry", + "flume", + "futures", + "ip-packet", + "ip_network", + "jni", + "libc", + "log", + "phoenix-channel", + "rustls", + "secrecy", + "serde_json", + "socket-factory", + "thiserror 1.0.69", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", + "tun", + "url", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -154,6 +187,38 @@ version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" +[[package]] +name = "apple-client-ffi" +version = "1.4.15" +dependencies = [ + "anyhow", + "backoff", + "client-shared", + "connlib-model", + "dns-types", + "firezone-logging", + "firezone-telemetry", + "flume", + "futures", + "ip-packet", + "ip_network", + "libc", + "oslog", + "phoenix-channel", + "rustls", + "secrecy", + "serde_json", + "socket-factory", + "swift-bridge", + "swift-bridge-build", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", + "tun", + "url", +] + [[package]] name = "arbitrary" version = "1.4.1" @@ -1054,6 +1119,34 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +[[package]] +name = "client-shared" +version = "0.1.0" +dependencies = [ + "anyhow", + "backoff", + "bimap", + "chrono", + "connlib-model", + "dns-types", + "firezone-logging", + "firezone-tunnel", + "ip_network", + "phoenix-channel", + "rayon", + "secrecy", + "serde", + "serde_json", + "snownet", + "socket-factory", + "thiserror 1.0.69", + "time", + "tokio", + "tracing", + "tun", + "url", +] + [[package]] name = "clipboard-win" version = "5.4.0" @@ -1124,99 +1217,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf0a07a401f374238ab8e2f11a104d2851bf9ce711ec69804834de8af45c7af" -[[package]] -name = "connlib-client-android" -version = "1.4.9" -dependencies = [ - "android_log-sys", - "anyhow", - "backoff", - "connlib-client-shared", - "connlib-model", - "dns-types", - "firezone-logging", - "firezone-telemetry", - "flume", - "futures", - "ip-packet", - "ip_network", - "jni", - "libc", - "log", - "phoenix-channel", - "rustls", - "secrecy", - "serde_json", - "socket-factory", - "thiserror 1.0.69", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "tun", - "url", -] - -[[package]] -name = "connlib-client-apple" -version = "1.4.15" -dependencies = [ - "anyhow", - "backoff", - "connlib-client-shared", - "connlib-model", - "dns-types", - "firezone-logging", - "firezone-telemetry", - "flume", - "futures", - "ip-packet", - "ip_network", - "libc", - "oslog", - "phoenix-channel", - "rustls", - "secrecy", - "serde_json", - "socket-factory", - "swift-bridge", - "swift-bridge-build", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "tun", - "url", -] - -[[package]] -name = "connlib-client-shared" -version = "0.1.0" -dependencies = [ - "anyhow", - "backoff", - "bimap", - "chrono", - "connlib-model", - "dns-types", - "firezone-logging", - "firezone-tunnel", - "ip_network", - "phoenix-channel", - "rayon", - "secrecy", - "serde", - "serde_json", - "snownet", - "socket-factory", - "thiserror 1.0.69", - "time", - "tokio", - "tracing", - "tun", - "url", -] - [[package]] name = "connlib-model" version = "0.1.0" @@ -2196,7 +2196,7 @@ dependencies = [ "backoff", "chrono", "clap", - "connlib-client-shared", + "client-shared", "connlib-model", "derive_more 1.0.0", "dirs 5.0.1", @@ -2258,7 +2258,7 @@ dependencies = [ "anyhow", "backoff", "clap", - "connlib-client-shared", + "client-shared", "connlib-model", "dns-types", "firezone-bin-shared", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index b481564a4..caabde042 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,32 +1,32 @@ [workspace] members = [ + "android-client-ffi", + "apple-client-ffi", "bin-shared", - "bufferpool", - "connlib/clients/android", - "connlib/clients/apple", - "connlib/clients/shared", + "client-shared", + "connlib/bufferpool", + "connlib/dns-over-tcp", + "connlib/dns-types", + "connlib/etherparse-ext", + "connlib/ip-packet", "connlib/l4-tcp-dns-server", "connlib/l4-udp-dns-server", "connlib/model", + "connlib/phoenix-channel", "connlib/snownet", + "connlib/socket-factory", + "connlib/tun", "connlib/tunnel", - "dns-over-tcp", - "dns-types", - "etherparse-ext", "gateway", "gui-client/src-tauri", "headless-client", - "ip-packet", "logging", - "phoenix-channel", "relay/ebpf-shared", "relay/ebpf-turn-router", "relay/server", - "socket-factory", "telemetry", "tests/gui-smoke-test", "tests/http-test-server", - "tun", ] resolver = "2" @@ -36,7 +36,9 @@ license = "Apache-2.0" edition = "2024" [workspace.dependencies] +android-client-ffi = { path = "android-client-ffi" } anyhow = "1.0.98" +apple-client-ffi = { path = "apple-client-ffi" } arboard = { version = "3.5.0", default-features = false } async-trait = { version = "0.1", default-features = false } atomicwrites = "0.4.4" @@ -50,28 +52,26 @@ backoff = { version = "0.4", features = ["tokio"] } base64 = { version = "0.22.1", default-features = false } bimap = "0.6" boringtun = { version = "0.6", default-features = false } -bufferpool = { path = "bufferpool" } +bufferpool = { path = "connlib/bufferpool" } bytecodec = "0.5.0" bytes = { version = "1.9.0", default-features = false } caps = "0.5.5" chrono = { version = "0.4", default-features = false, features = ["std", "clock", "oldtime", "serde"] } clap = "4.5.37" -connlib-client-android = { path = "connlib/clients/android" } -connlib-client-apple = { path = "connlib/clients/apple" } -connlib-client-shared = { path = "connlib/clients/shared" } +client-shared = { path = "client-shared" } connlib-model = { path = "connlib/model" } derive_more = "1.0.0" difference = "2.0.0" dirs = "5.0.1" divan = "0.1.17" dns-lookup = "2.0" -dns-over-tcp = { path = "dns-over-tcp" } -dns-types = { path = "dns-types" } +dns-over-tcp = { path = "connlib/dns-over-tcp" } +dns-types = { path = "connlib/dns-types" } ebpf-shared = { path = "relay/ebpf-shared" } either = "1" env_logger = "0.11.6" etherparse = { version = "0.17", default-features = false } -etherparse-ext = { path = "etherparse-ext" } +etherparse-ext = { path = "connlib/etherparse-ext" } firezone-bin-shared = { path = "bin-shared" } firezone-headless-client = { path = "headless-client" } firezone-logging = { path = "logging" } @@ -87,7 +87,7 @@ hex = "0.4.3" hex-display = "0.3.0" hex-literal = "0.4.1" humantime = "2.2" -ip-packet = { path = "ip-packet" } +ip-packet = { path = "connlib/ip-packet" } ip_network = { version = "0.4", default-features = false } ip_network_table = { version = "0.2", default-features = false } itertools = "0.13" @@ -116,7 +116,7 @@ opentelemetry_sdk = "0.29.0" os_info = { version = "3", default-features = false } output_vt100 = "0.1" parking_lot = "0.12.3" -phoenix-channel = { path = "phoenix-channel" } +phoenix-channel = { path = "connlib/phoenix-channel" } png = "0.17.16" proptest = "1.6.0" proptest-state-machine = "0.3.1" @@ -144,7 +144,7 @@ smallvec = "1.13.2" smbios-lib = "0.9.2" smoltcp = { version = "0.12", default-features = false } snownet = { path = "connlib/snownet" } -socket-factory = { path = "socket-factory" } +socket-factory = { path = "connlib/socket-factory" } socket2 = { version = "0.5" } static_assertions = "1.1.0" str0m = { version = "0.8.0", default-features = false, features = ["sha1"] } @@ -182,7 +182,7 @@ tracing-opentelemetry = "0.30.0" tracing-stackdriver = "0.11.0" tracing-subscriber = { version = "0.3.19", features = ["parking_lot"] } trackable = "1.3.0" -tun = { path = "tun" } +tun = { path = "connlib/tun" } url = "2.5.2" uuid = "1.16.0" which = "4.4.2" diff --git a/rust/connlib/clients/android/Cargo.toml b/rust/android-client-ffi/Cargo.toml similarity index 94% rename from rust/connlib/clients/android/Cargo.toml rename to rust/android-client-ffi/Cargo.toml index 6691ca43f..4c61c3c4e 100644 --- a/rust/connlib/clients/android/Cargo.toml +++ b/rust/android-client-ffi/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "connlib-client-android" +name = "android-client-ffi" # mark:next-android-version version = "1.4.9" edition = { workspace = true } @@ -13,7 +13,7 @@ doc = false [dependencies] anyhow = { workspace = true } backoff = { workspace = true } -connlib-client-shared = { workspace = true } +client-shared = { workspace = true } connlib-model = { workspace = true } dns-types = { workspace = true } firezone-logging = { workspace = true } diff --git a/rust/connlib/clients/android/src/lib.rs b/rust/android-client-ffi/src/lib.rs similarity index 99% rename from rust/connlib/clients/android/src/lib.rs rename to rust/android-client-ffi/src/lib.rs index 15305c807..b753a5e2d 100644 --- a/rust/connlib/clients/android/src/lib.rs +++ b/rust/android-client-ffi/src/lib.rs @@ -8,7 +8,7 @@ use crate::tun::Tun; use anyhow::{Context as _, Result}; use backoff::ExponentialBackoffBuilder; -use connlib_client_shared::{Callbacks, DisconnectError, Session, V4RouteList, V6RouteList}; +use client_shared::{Callbacks, DisconnectError, Session, V4RouteList, V6RouteList}; use connlib_model::ResourceView; use dns_types::DomainName; use firezone_logging::{err_with_src, sentry_layer}; diff --git a/rust/connlib/clients/android/src/make_writer.rs b/rust/android-client-ffi/src/make_writer.rs similarity index 100% rename from rust/connlib/clients/android/src/make_writer.rs rename to rust/android-client-ffi/src/make_writer.rs diff --git a/rust/connlib/clients/android/src/tun.rs b/rust/android-client-ffi/src/tun.rs similarity index 100% rename from rust/connlib/clients/android/src/tun.rs rename to rust/android-client-ffi/src/tun.rs diff --git a/rust/connlib/clients/apple/.gitignore b/rust/apple-client-ffi/.gitignore similarity index 100% rename from rust/connlib/clients/apple/.gitignore rename to rust/apple-client-ffi/.gitignore diff --git a/rust/connlib/clients/apple/Cargo.toml b/rust/apple-client-ffi/Cargo.toml similarity index 94% rename from rust/connlib/clients/apple/Cargo.toml rename to rust/apple-client-ffi/Cargo.toml index 45d14889f..cf7bbad69 100644 --- a/rust/connlib/clients/apple/Cargo.toml +++ b/rust/apple-client-ffi/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "connlib-client-apple" +name = "apple-client-ffi" # mark:next-apple-version version = "1.4.15" edition = { workspace = true } @@ -11,7 +11,7 @@ swift-bridge-build = { workspace = true } [dependencies] anyhow = { workspace = true } backoff = { workspace = true } -connlib-client-shared = { workspace = true } +client-shared = { workspace = true } connlib-model = { workspace = true } dns-types = { workspace = true } firezone-logging = { workspace = true } diff --git a/rust/connlib/clients/apple/README.md b/rust/apple-client-ffi/README.md similarity index 100% rename from rust/connlib/clients/apple/README.md rename to rust/apple-client-ffi/README.md diff --git a/rust/connlib/clients/apple/build-rust.sh b/rust/apple-client-ffi/build-rust.sh similarity index 100% rename from rust/connlib/clients/apple/build-rust.sh rename to rust/apple-client-ffi/build-rust.sh diff --git a/rust/connlib/clients/apple/build.rs b/rust/apple-client-ffi/build.rs similarity index 81% rename from rust/connlib/clients/apple/build.rs rename to rust/apple-client-ffi/build.rs index ea87f3e71..117a2b5ba 100644 --- a/rust/connlib/clients/apple/build.rs +++ b/rust/apple-client-ffi/build.rs @@ -1,7 +1,7 @@ const XCODE_CONFIGURATION_ENV: &str = "CONFIGURATION"; fn main() { - let out_dir = "../../../../swift/apple/FirezoneNetworkExtension/Connlib/Generated"; + let out_dir = "../../swift/apple/FirezoneNetworkExtension/Connlib/Generated"; let bridges = vec!["src/lib.rs"]; for path in &bridges { diff --git a/rust/connlib/clients/apple/src/lib.rs b/rust/apple-client-ffi/src/lib.rs similarity index 99% rename from rust/connlib/clients/apple/src/lib.rs rename to rust/apple-client-ffi/src/lib.rs index 4a1e48a5f..559e9449e 100644 --- a/rust/connlib/clients/apple/src/lib.rs +++ b/rust/apple-client-ffi/src/lib.rs @@ -8,7 +8,7 @@ mod tun; use anyhow::Context; use anyhow::Result; use backoff::ExponentialBackoffBuilder; -use connlib_client_shared::{Callbacks, DisconnectError, Session, V4RouteList, V6RouteList}; +use client_shared::{Callbacks, DisconnectError, Session, V4RouteList, V6RouteList}; use connlib_model::ResourceView; use dns_types::DomainName; use firezone_logging::err_with_src; diff --git a/rust/connlib/clients/apple/src/make_writer.rs b/rust/apple-client-ffi/src/make_writer.rs similarity index 100% rename from rust/connlib/clients/apple/src/make_writer.rs rename to rust/apple-client-ffi/src/make_writer.rs diff --git a/rust/connlib/clients/apple/src/tun.rs b/rust/apple-client-ffi/src/tun.rs similarity index 100% rename from rust/connlib/clients/apple/src/tun.rs rename to rust/apple-client-ffi/src/tun.rs diff --git a/rust/bin-shared/src/device_id.rs b/rust/bin-shared/src/device_id.rs index c76e5de4a..ee9e488fa 100644 --- a/rust/bin-shared/src/device_id.rs +++ b/rust/bin-shared/src/device_id.rs @@ -40,7 +40,7 @@ pub fn get() -> Result { /// Per and , /// clients must generate their own random IDs and persist them to disk, to handle situations like VMs where a hardware ID is not unique or not available. /// -/// Returns: The UUID as a String, suitable for sending verbatim to `connlib_client_shared::Session::connect`. +/// Returns: The UUID as a String, suitable for sending verbatim to `client_shared::Session::connect`. /// /// Errors: If the disk is unwritable when initially generating the ID, or unwritable when re-generating an invalid ID. pub fn get_or_create() -> Result { diff --git a/rust/connlib/clients/shared/Cargo.toml b/rust/client-shared/Cargo.toml similarity index 97% rename from rust/connlib/clients/shared/Cargo.toml rename to rust/client-shared/Cargo.toml index 4661c391a..07e6e59f3 100644 --- a/rust/connlib/clients/shared/Cargo.toml +++ b/rust/client-shared/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "connlib-client-shared" +name = "client-shared" version = "0.1.0" edition = { workspace = true } license = { workspace = true } diff --git a/rust/connlib/clients/shared/src/callbacks.rs b/rust/client-shared/src/callbacks.rs similarity index 100% rename from rust/connlib/clients/shared/src/callbacks.rs rename to rust/client-shared/src/callbacks.rs diff --git a/rust/connlib/clients/shared/src/eventloop.rs b/rust/client-shared/src/eventloop.rs similarity index 100% rename from rust/connlib/clients/shared/src/eventloop.rs rename to rust/client-shared/src/eventloop.rs diff --git a/rust/connlib/clients/shared/src/lib.rs b/rust/client-shared/src/lib.rs similarity index 100% rename from rust/connlib/clients/shared/src/lib.rs rename to rust/client-shared/src/lib.rs diff --git a/rust/connlib/clients/shared/src/serde_routelist.rs b/rust/client-shared/src/serde_routelist.rs similarity index 100% rename from rust/connlib/clients/shared/src/serde_routelist.rs rename to rust/client-shared/src/serde_routelist.rs diff --git a/rust/bufferpool/Cargo.toml b/rust/connlib/bufferpool/Cargo.toml similarity index 100% rename from rust/bufferpool/Cargo.toml rename to rust/connlib/bufferpool/Cargo.toml diff --git a/rust/bufferpool/lib.rs b/rust/connlib/bufferpool/lib.rs similarity index 100% rename from rust/bufferpool/lib.rs rename to rust/connlib/bufferpool/lib.rs diff --git a/rust/dns-over-tcp/Cargo.toml b/rust/connlib/dns-over-tcp/Cargo.toml similarity index 100% rename from rust/dns-over-tcp/Cargo.toml rename to rust/connlib/dns-over-tcp/Cargo.toml diff --git a/rust/dns-over-tcp/src/client.rs b/rust/connlib/dns-over-tcp/src/client.rs similarity index 100% rename from rust/dns-over-tcp/src/client.rs rename to rust/connlib/dns-over-tcp/src/client.rs diff --git a/rust/dns-over-tcp/src/codec.rs b/rust/connlib/dns-over-tcp/src/codec.rs similarity index 100% rename from rust/dns-over-tcp/src/codec.rs rename to rust/connlib/dns-over-tcp/src/codec.rs diff --git a/rust/dns-over-tcp/src/interface.rs b/rust/connlib/dns-over-tcp/src/interface.rs similarity index 100% rename from rust/dns-over-tcp/src/interface.rs rename to rust/connlib/dns-over-tcp/src/interface.rs diff --git a/rust/dns-over-tcp/src/lib.rs b/rust/connlib/dns-over-tcp/src/lib.rs similarity index 100% rename from rust/dns-over-tcp/src/lib.rs rename to rust/connlib/dns-over-tcp/src/lib.rs diff --git a/rust/dns-over-tcp/src/server.rs b/rust/connlib/dns-over-tcp/src/server.rs similarity index 100% rename from rust/dns-over-tcp/src/server.rs rename to rust/connlib/dns-over-tcp/src/server.rs diff --git a/rust/dns-over-tcp/src/stub_device.rs b/rust/connlib/dns-over-tcp/src/stub_device.rs similarity index 100% rename from rust/dns-over-tcp/src/stub_device.rs rename to rust/connlib/dns-over-tcp/src/stub_device.rs diff --git a/rust/dns-over-tcp/src/time.rs b/rust/connlib/dns-over-tcp/src/time.rs similarity index 100% rename from rust/dns-over-tcp/src/time.rs rename to rust/connlib/dns-over-tcp/src/time.rs diff --git a/rust/dns-over-tcp/tests/client_and_server.rs b/rust/connlib/dns-over-tcp/tests/client_and_server.rs similarity index 100% rename from rust/dns-over-tcp/tests/client_and_server.rs rename to rust/connlib/dns-over-tcp/tests/client_and_server.rs diff --git a/rust/dns-over-tcp/tests/smoke_server.rs b/rust/connlib/dns-over-tcp/tests/smoke_server.rs similarity index 100% rename from rust/dns-over-tcp/tests/smoke_server.rs rename to rust/connlib/dns-over-tcp/tests/smoke_server.rs diff --git a/rust/dns-types/Cargo.toml b/rust/connlib/dns-types/Cargo.toml similarity index 100% rename from rust/dns-types/Cargo.toml rename to rust/connlib/dns-types/Cargo.toml diff --git a/rust/dns-types/lib.rs b/rust/connlib/dns-types/lib.rs similarity index 100% rename from rust/dns-types/lib.rs rename to rust/connlib/dns-types/lib.rs diff --git a/rust/etherparse-ext/Cargo.toml b/rust/connlib/etherparse-ext/Cargo.toml similarity index 100% rename from rust/etherparse-ext/Cargo.toml rename to rust/connlib/etherparse-ext/Cargo.toml diff --git a/rust/etherparse-ext/src/icmpv4_header_slice_mut.rs b/rust/connlib/etherparse-ext/src/icmpv4_header_slice_mut.rs similarity index 100% rename from rust/etherparse-ext/src/icmpv4_header_slice_mut.rs rename to rust/connlib/etherparse-ext/src/icmpv4_header_slice_mut.rs diff --git a/rust/etherparse-ext/src/icmpv6_header_slice_mut.rs b/rust/connlib/etherparse-ext/src/icmpv6_header_slice_mut.rs similarity index 100% rename from rust/etherparse-ext/src/icmpv6_header_slice_mut.rs rename to rust/connlib/etherparse-ext/src/icmpv6_header_slice_mut.rs diff --git a/rust/etherparse-ext/src/ipv4_header_slice_mut.rs b/rust/connlib/etherparse-ext/src/ipv4_header_slice_mut.rs similarity index 100% rename from rust/etherparse-ext/src/ipv4_header_slice_mut.rs rename to rust/connlib/etherparse-ext/src/ipv4_header_slice_mut.rs diff --git a/rust/etherparse-ext/src/ipv6_header_slice_mut.rs b/rust/connlib/etherparse-ext/src/ipv6_header_slice_mut.rs similarity index 100% rename from rust/etherparse-ext/src/ipv6_header_slice_mut.rs rename to rust/connlib/etherparse-ext/src/ipv6_header_slice_mut.rs diff --git a/rust/etherparse-ext/src/lib.rs b/rust/connlib/etherparse-ext/src/lib.rs similarity index 100% rename from rust/etherparse-ext/src/lib.rs rename to rust/connlib/etherparse-ext/src/lib.rs diff --git a/rust/etherparse-ext/src/slice_utils.rs b/rust/connlib/etherparse-ext/src/slice_utils.rs similarity index 100% rename from rust/etherparse-ext/src/slice_utils.rs rename to rust/connlib/etherparse-ext/src/slice_utils.rs diff --git a/rust/etherparse-ext/src/tcp_header_slice_mut.rs b/rust/connlib/etherparse-ext/src/tcp_header_slice_mut.rs similarity index 100% rename from rust/etherparse-ext/src/tcp_header_slice_mut.rs rename to rust/connlib/etherparse-ext/src/tcp_header_slice_mut.rs diff --git a/rust/etherparse-ext/src/udp_header_slice_mut.rs b/rust/connlib/etherparse-ext/src/udp_header_slice_mut.rs similarity index 100% rename from rust/etherparse-ext/src/udp_header_slice_mut.rs rename to rust/connlib/etherparse-ext/src/udp_header_slice_mut.rs diff --git a/rust/ip-packet/Cargo.toml b/rust/connlib/ip-packet/Cargo.toml similarity index 100% rename from rust/ip-packet/Cargo.toml rename to rust/connlib/ip-packet/Cargo.toml diff --git a/rust/ip-packet/proptest-regressions/proptests.txt b/rust/connlib/ip-packet/proptest-regressions/proptests.txt similarity index 100% rename from rust/ip-packet/proptest-regressions/proptests.txt rename to rust/connlib/ip-packet/proptest-regressions/proptests.txt diff --git a/rust/ip-packet/src/fz_p2p_control.rs b/rust/connlib/ip-packet/src/fz_p2p_control.rs similarity index 100% rename from rust/ip-packet/src/fz_p2p_control.rs rename to rust/connlib/ip-packet/src/fz_p2p_control.rs diff --git a/rust/ip-packet/src/fz_p2p_control_slice.rs b/rust/connlib/ip-packet/src/fz_p2p_control_slice.rs similarity index 100% rename from rust/ip-packet/src/fz_p2p_control_slice.rs rename to rust/connlib/ip-packet/src/fz_p2p_control_slice.rs diff --git a/rust/ip-packet/src/icmp_dest_unreachable.rs b/rust/connlib/ip-packet/src/icmp_dest_unreachable.rs similarity index 100% rename from rust/ip-packet/src/icmp_dest_unreachable.rs rename to rust/connlib/ip-packet/src/icmp_dest_unreachable.rs diff --git a/rust/ip-packet/src/lib.rs b/rust/connlib/ip-packet/src/lib.rs similarity index 100% rename from rust/ip-packet/src/lib.rs rename to rust/connlib/ip-packet/src/lib.rs diff --git a/rust/ip-packet/src/make.rs b/rust/connlib/ip-packet/src/make.rs similarity index 100% rename from rust/ip-packet/src/make.rs rename to rust/connlib/ip-packet/src/make.rs diff --git a/rust/ip-packet/src/nat46.rs b/rust/connlib/ip-packet/src/nat46.rs similarity index 100% rename from rust/ip-packet/src/nat46.rs rename to rust/connlib/ip-packet/src/nat46.rs diff --git a/rust/ip-packet/src/nat64.rs b/rust/connlib/ip-packet/src/nat64.rs similarity index 100% rename from rust/ip-packet/src/nat64.rs rename to rust/connlib/ip-packet/src/nat64.rs diff --git a/rust/ip-packet/src/proptest.rs b/rust/connlib/ip-packet/src/proptest.rs similarity index 100% rename from rust/ip-packet/src/proptest.rs rename to rust/connlib/ip-packet/src/proptest.rs diff --git a/rust/ip-packet/src/proptests.rs b/rust/connlib/ip-packet/src/proptests.rs similarity index 100% rename from rust/ip-packet/src/proptests.rs rename to rust/connlib/ip-packet/src/proptests.rs diff --git a/rust/phoenix-channel/Cargo.toml b/rust/connlib/phoenix-channel/Cargo.toml similarity index 100% rename from rust/phoenix-channel/Cargo.toml rename to rust/connlib/phoenix-channel/Cargo.toml diff --git a/rust/phoenix-channel/src/get_user_agent.rs b/rust/connlib/phoenix-channel/src/get_user_agent.rs similarity index 100% rename from rust/phoenix-channel/src/get_user_agent.rs rename to rust/connlib/phoenix-channel/src/get_user_agent.rs diff --git a/rust/phoenix-channel/src/lib.rs b/rust/connlib/phoenix-channel/src/lib.rs similarity index 100% rename from rust/phoenix-channel/src/lib.rs rename to rust/connlib/phoenix-channel/src/lib.rs diff --git a/rust/phoenix-channel/src/login_url.rs b/rust/connlib/phoenix-channel/src/login_url.rs similarity index 100% rename from rust/phoenix-channel/src/login_url.rs rename to rust/connlib/phoenix-channel/src/login_url.rs diff --git a/rust/socket-factory/Cargo.toml b/rust/connlib/socket-factory/Cargo.toml similarity index 100% rename from rust/socket-factory/Cargo.toml rename to rust/connlib/socket-factory/Cargo.toml diff --git a/rust/socket-factory/src/lib.rs b/rust/connlib/socket-factory/src/lib.rs similarity index 100% rename from rust/socket-factory/src/lib.rs rename to rust/connlib/socket-factory/src/lib.rs diff --git a/rust/tun/Cargo.toml b/rust/connlib/tun/Cargo.toml similarity index 100% rename from rust/tun/Cargo.toml rename to rust/connlib/tun/Cargo.toml diff --git a/rust/tun/src/ioctl.rs b/rust/connlib/tun/src/ioctl.rs similarity index 100% rename from rust/tun/src/ioctl.rs rename to rust/connlib/tun/src/ioctl.rs diff --git a/rust/tun/src/lib.rs b/rust/connlib/tun/src/lib.rs similarity index 100% rename from rust/tun/src/lib.rs rename to rust/connlib/tun/src/lib.rs diff --git a/rust/tun/src/unix.rs b/rust/connlib/tun/src/unix.rs similarity index 100% rename from rust/tun/src/unix.rs rename to rust/connlib/tun/src/unix.rs diff --git a/rust/gui-client/src-tauri/Cargo.toml b/rust/gui-client/src-tauri/Cargo.toml index f1e368b5e..c654a8803 100644 --- a/rust/gui-client/src-tauri/Cargo.toml +++ b/rust/gui-client/src-tauri/Cargo.toml @@ -19,7 +19,7 @@ atomicwrites = { workspace = true } backoff = { workspace = true } chrono = { workspace = true } clap = { workspace = true, features = ["derive", "env"] } -connlib-client-shared = { workspace = true } +client-shared = { workspace = true } connlib-model = { workspace = true } derive_more = { workspace = true, features = ["debug"] } firezone-bin-shared = { workspace = true } diff --git a/rust/gui-client/src-tauri/src/service.rs b/rust/gui-client/src-tauri/src/service.rs index b545c5546..0f03edd24 100644 --- a/rust/gui-client/src-tauri/src/service.rs +++ b/rust/gui-client/src-tauri/src/service.rs @@ -1,7 +1,7 @@ use anyhow::{Context as _, Result, bail}; use atomicwrites::{AtomicFile, OverwriteBehavior}; use backoff::ExponentialBackoffBuilder; -use connlib_client_shared::ConnlibMsg; +use client_shared::ConnlibMsg; use firezone_bin_shared::{ DnsControlMethod, DnsController, TunDeviceManager, device_id, device_info, known_dirs, platform::{tcp_socket_factory, udp_socket_factory}, @@ -101,7 +101,7 @@ struct Handler<'a> { struct Session { cb_rx: mpsc::Receiver, - connlib: connlib_client_shared::Session, + connlib: client_shared::Session, } enum Event { @@ -383,7 +383,7 @@ impl<'a> Handler<'a> { .context("Failed to create `LoginUrl`")?; self.last_connlib_start_instant = Some(Instant::now()); - let (callbacks, cb_rx) = connlib_client_shared::ChannelCallbackHandler::new(); + let (callbacks, cb_rx) = client_shared::ChannelCallbackHandler::new(); // Synchronous DNS resolution here let portal = PhoenixChannel::disconnected( @@ -404,7 +404,7 @@ impl<'a> Handler<'a> { // Read the resolvers before starting connlib, in case connlib's startup interferes. let dns = self.dns_controller.system_resolvers(); - let connlib = connlib_client_shared::Session::connect( + let connlib = client_shared::Session::connect( Arc::new(tcp_socket_factory), Arc::new(udp_socket_factory), callbacks, diff --git a/rust/headless-client/Cargo.toml b/rust/headless-client/Cargo.toml index 9895a018b..38322c93c 100644 --- a/rust/headless-client/Cargo.toml +++ b/rust/headless-client/Cargo.toml @@ -11,7 +11,7 @@ license = { workspace = true } anyhow = { workspace = true } backoff = { workspace = true } clap = { workspace = true, features = ["derive", "env", "string"] } -connlib-client-shared = { workspace = true } +client-shared = { workspace = true } connlib-model = { workspace = true } dns-types = { workspace = true } firezone-bin-shared = { workspace = true } diff --git a/rust/headless-client/src/main.rs b/rust/headless-client/src/main.rs index cb6a8b45a..1f2d07e09 100644 --- a/rust/headless-client/src/main.rs +++ b/rust/headless-client/src/main.rs @@ -5,7 +5,7 @@ use anyhow::{Context as _, Result, anyhow}; use backoff::ExponentialBackoffBuilder; use clap::Parser; -use connlib_client_shared::{ChannelCallbackHandler, ConnlibMsg, Session}; +use client_shared::{ChannelCallbackHandler, ConnlibMsg, Session}; use firezone_bin_shared::{ DnsControlMethod, DnsController, TOKEN_ENV_KEY, TunDeviceManager, device_id, device_info, new_dns_notifier, new_network_notifier, diff --git a/swift/apple/.swiftlint.yml b/swift/apple/.swiftlint.yml index ed31c01ae..e666f1761 100644 --- a/swift/apple/.swiftlint.yml +++ b/swift/apple/.swiftlint.yml @@ -3,5 +3,5 @@ disabled_rules: # necessarily imply immediate action needs to be taken. - todo excluded: - - FirezoneNetworkExtension/Connlib/Generated/connlib-client-apple/connlib-client-apple.swift + - FirezoneNetworkExtension/Connlib/Generated/apple-client-ffi/apple-client-ffi.swift - FirezoneNetworkExtension/Connlib/Generated/SwiftBridgeCore.swift diff --git a/swift/apple/Firezone.xcodeproj/project.pbxproj b/swift/apple/Firezone.xcodeproj/project.pbxproj index 894226e6d..f74ebe2ae 100644 --- a/swift/apple/Firezone.xcodeproj/project.pbxproj +++ b/swift/apple/Firezone.xcodeproj/project.pbxproj @@ -13,7 +13,7 @@ 6FE454F62A5BFB93006549B1 /* Adapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE454EA2A5BFABA006549B1 /* Adapter.swift */; }; 6FE455092A5D110D006549B1 /* CallbackHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE455082A5D110D006549B1 /* CallbackHandler.swift */; }; 6FE4550C2A5D111E006549B1 /* SwiftBridgeCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE4550B2A5D111D006549B1 /* SwiftBridgeCore.swift */; }; - 6FE4550F2A5D112C006549B1 /* connlib-client-apple.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE4550E2A5D112C006549B1 /* connlib-client-apple.swift */; }; + 6FE4550F2A5D112C006549B1 /* apple-client-ffi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE4550E2A5D112C006549B1 /* apple-client-ffi.swift */; }; 6FE93AFB2A738D7E002D278A /* NetworkSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE93AFA2A738D7E002D278A /* NetworkSettings.swift */; }; 794C38152970A2660029F38F /* FirezoneKit in Frameworks */ = {isa = PBXBuildFile; productRef = 794C38142970A2660029F38F /* FirezoneKit */; }; 79756C6629704A7A0018E2D5 /* FirezoneKit in Frameworks */ = {isa = PBXBuildFile; productRef = 79756C6529704A7A0018E2D5 /* FirezoneKit */; }; @@ -25,7 +25,7 @@ 8D5047F82CE6AA22009802E9 /* FirezoneKit in Frameworks */ = {isa = PBXBuildFile; productRef = 8D5047F72CE6AA22009802E9 /* FirezoneKit */; }; 8D5047FB2CE6AA37009802E9 /* FirezoneNetworkExtension-Bridging-Header.h in Sources */ = {isa = PBXBuildFile; fileRef = 6FE455112A5D13A2006549B1 /* FirezoneNetworkExtension-Bridging-Header.h */; }; 8D5047FC2CE6AA47009802E9 /* CallbackHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE455082A5D110D006549B1 /* CallbackHandler.swift */; }; - 8D5047FD2CE6AA47009802E9 /* connlib-client-apple.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE4550E2A5D112C006549B1 /* connlib-client-apple.swift */; }; + 8D5047FD2CE6AA47009802E9 /* apple-client-ffi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE4550E2A5D112C006549B1 /* apple-client-ffi.swift */; }; 8D5047FE2CE6AA54009802E9 /* PacketTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05833DFA28F73B070008FAB0 /* PacketTunnelProvider.swift */; }; 8D5047FF2CE6AA54009802E9 /* Adapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FE454EA2A5BFABA006549B1 /* Adapter.swift */; }; 8D5048002CE6AA60009802E9 /* SystemConfigurationResolvers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D6939312BA2521A00AF4396 /* SystemConfigurationResolvers.swift */; }; @@ -96,7 +96,7 @@ 6FE454EA2A5BFABA006549B1 /* Adapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Adapter.swift; sourceTree = ""; }; 6FE455082A5D110D006549B1 /* CallbackHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallbackHandler.swift; sourceTree = ""; }; 6FE4550B2A5D111D006549B1 /* SwiftBridgeCore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftBridgeCore.swift; path = Connlib/Generated/SwiftBridgeCore.swift; sourceTree = ""; }; - 6FE4550E2A5D112C006549B1 /* connlib-client-apple.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "connlib-client-apple.swift"; path = "Connlib/Generated/connlib-client-apple/connlib-client-apple.swift"; sourceTree = ""; }; + 6FE4550E2A5D112C006549B1 /* apple-client-ffi.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "apple-client-ffi.swift"; path = "Connlib/Generated/apple-client-ffi/apple-client-ffi.swift"; sourceTree = ""; }; 6FE455112A5D13A2006549B1 /* FirezoneNetworkExtension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FirezoneNetworkExtension-Bridging-Header.h"; sourceTree = ""; }; 6FE93AFA2A738D7E002D278A /* NetworkSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkSettings.swift; sourceTree = ""; }; 6FFECD5B2AD6998400E00273 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; @@ -174,7 +174,7 @@ 6FE455082A5D110D006549B1 /* CallbackHandler.swift */, 6FE4550B2A5D111D006549B1 /* SwiftBridgeCore.swift */, 8D41B9A42D15DD6800D16065 /* TunnelLogArchive.swift */, - 6FE4550E2A5D112C006549B1 /* connlib-client-apple.swift */, + 6FE4550E2A5D112C006549B1 /* apple-client-ffi.swift */, 6FE455112A5D13A2006549B1 /* FirezoneNetworkExtension-Bridging-Header.h */, ); path = FirezoneNetworkExtension; @@ -457,7 +457,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Type a script or drag a script file from your workspace to insert its path.\ncd ../../rust/connlib/clients/apple\n./build-rust.sh\n"; + shellScript = "cd ../../rust/apple-client-ffi\n./build-rust.sh\n"; }; 8D8555832D0A7CBB00A1EA09 /* Build Connlib */ = { isa = PBXShellScriptBuildPhase; @@ -477,7 +477,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "cd ../../rust/connlib/clients/apple\n./build-rust.sh\n"; + shellScript = "cd ../../rust/apple-client-ffi\n./build-rust.sh\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -488,7 +488,7 @@ files = ( 8DC08BD72B297DB400675F46 /* FirezoneNetworkExtension-Bridging-Header.h in Sources */, 6FE455092A5D110D006549B1 /* CallbackHandler.swift in Sources */, - 6FE4550F2A5D112C006549B1 /* connlib-client-apple.swift in Sources */, + 6FE4550F2A5D112C006549B1 /* apple-client-ffi.swift in Sources */, 8D41B9A52D15DD6800D16065 /* TunnelLogArchive.swift in Sources */, 05CF1D17290B1FE700CF4755 /* PacketTunnelProvider.swift in Sources */, 6FE454F62A5BFB93006549B1 /* Adapter.swift in Sources */, @@ -506,7 +506,7 @@ 8DE452A82CE6C194004CEDF9 /* main.swift in Sources */, 8D5047FB2CE6AA37009802E9 /* FirezoneNetworkExtension-Bridging-Header.h in Sources */, 8D5048042CE6B0AE009802E9 /* SwiftBridgeCore.swift in Sources */, - 8D5047FD2CE6AA47009802E9 /* connlib-client-apple.swift in Sources */, + 8D5047FD2CE6AA47009802E9 /* apple-client-ffi.swift in Sources */, 8D5047FC2CE6AA47009802E9 /* CallbackHandler.swift in Sources */, 8D5047FE2CE6AA54009802E9 /* PacketTunnelProvider.swift in Sources */, 8D5048002CE6AA60009802E9 /* SystemConfigurationResolvers.swift in Sources */, @@ -734,7 +734,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CONNLIB_SOURCE_DIR = "$(PROJECT_DIR)/../../rust/connlib/clients/apple"; + CONNLIB_SOURCE_DIR = "$(PROJECT_DIR)/../../rust/apple-client-ffi"; CONNLIB_TARGET_DIR = "$(PROJECT_DIR)/../../rust/target"; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; @@ -802,7 +802,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CONNLIB_SOURCE_DIR = "$(PROJECT_DIR)/../../rust/connlib/clients/apple"; + CONNLIB_SOURCE_DIR = "$(PROJECT_DIR)/../../rust/apple-client-ffi"; CONNLIB_TARGET_DIR = "$(PROJECT_DIR)/../../rust/target"; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; diff --git a/swift/apple/FirezoneNetworkExtension/Connlib.xcfilelist b/swift/apple/FirezoneNetworkExtension/Connlib.xcfilelist index 3298f595a..29fa0d553 100644 --- a/swift/apple/FirezoneNetworkExtension/Connlib.xcfilelist +++ b/swift/apple/FirezoneNetworkExtension/Connlib.xcfilelist @@ -1,5 +1,5 @@ -$(PROJECT_DIR)/FirezoneNetworkExtension/Connlib/Generated/connlib-client-apple/connlib-client-apple.swift -$(PROJECT_DIR)/FirezoneNetworkExtension/Connlib/Generated/connlib-client-apple/connlib-client-apple.h +$(PROJECT_DIR)/FirezoneNetworkExtension/Connlib/Generated/apple-client-ffi/apple-client-ffi.swift +$(PROJECT_DIR)/FirezoneNetworkExtension/Connlib/Generated/apple-client-ffi/apple-client-ffi.h $(PROJECT_DIR)/FirezoneNetworkExtension/Connlib/Generated/SwiftBridgeCore.h $(PROJECT_DIR)/FirezoneNetworkExtension/Connlib/Generated/SwiftBridgeCore.swift $(PROJECT_DIR)/FirezoneNetworkExtension/Connlib/connlib.h diff --git a/swift/apple/FirezoneNetworkExtension/Connlib/Generated/connlib-client-apple/connlib-client-apple.h b/swift/apple/FirezoneNetworkExtension/Connlib/Generated/apple-client-ffi/apple-client-ffi.h similarity index 100% rename from swift/apple/FirezoneNetworkExtension/Connlib/Generated/connlib-client-apple/connlib-client-apple.h rename to swift/apple/FirezoneNetworkExtension/Connlib/Generated/apple-client-ffi/apple-client-ffi.h diff --git a/swift/apple/FirezoneNetworkExtension/Connlib/Generated/connlib-client-apple/connlib-client-apple.swift b/swift/apple/FirezoneNetworkExtension/Connlib/Generated/apple-client-ffi/apple-client-ffi.swift similarity index 100% rename from swift/apple/FirezoneNetworkExtension/Connlib/Generated/connlib-client-apple/connlib-client-apple.swift rename to swift/apple/FirezoneNetworkExtension/Connlib/Generated/apple-client-ffi/apple-client-ffi.swift diff --git a/swift/apple/FirezoneNetworkExtension/Connlib/connlib.h b/swift/apple/FirezoneNetworkExtension/Connlib/connlib.h index 4d2afe004..b94029a15 100644 --- a/swift/apple/FirezoneNetworkExtension/Connlib/connlib.h +++ b/swift/apple/FirezoneNetworkExtension/Connlib/connlib.h @@ -4,6 +4,6 @@ #define connlib_h #include "Generated/SwiftBridgeCore.h" -#include "Generated/connlib-client-apple/connlib-client-apple.h" +#include "Generated/apple-client-ffi/apple-client-ffi.h" #endif diff --git a/swift/apple/Makefile b/swift/apple/Makefile index 54d584766..f2952fc68 100644 --- a/swift/apple/Makefile +++ b/swift/apple/Makefile @@ -5,12 +5,12 @@ ARCH=$(shell uname -m) build-macos: echo "Building debug build for ${PLATFORM}, ${ARCH}" - cd ../../rust/connlib/clients/apple && rm -rf ./Connlib.xcframework && ./build-rust.sh && ./build-xcframework-dev.sh + cd ../../rust/apple-client-ffi && rm -rf ./Connlib.xcframework && ./build-rust.sh && ./build-xcframework-dev.sh @xcodebuild build -scheme Firezone -sdk macosx -destination 'platform=${PLATFORM},arch=${ARCH}' clean: @xcodebuild clean -scheme Firezone -sdk macosx -destination 'platform=${PLATFORM},arch=${ARCH}' - cd ../../rust/connlib/clients/apple && rm -rf ./Connlib.xcframework + cd ../../rust/apple-client-ffi && rm -rf ./Connlib.xcframework .PHONY: format format: diff --git a/swift/apple/cleanup.sh b/swift/apple/cleanup.sh index ddcdd43cf..08f3892d1 100755 --- a/swift/apple/cleanup.sh +++ b/swift/apple/cleanup.sh @@ -24,7 +24,7 @@ fi if [[ $ARG == "rust" ]] || [[ $ARG == "all" ]]; then set -x - cd ../../rust/connlib/clients/apple && cargo clean + cd ../../rust/apple-client-ffi && cargo clean cd Sources/Connlib/Generated && git clean -df set +x fi