diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml
index 19a680d..3f99454 100644
--- a/.github/workflows/linters.yml
+++ b/.github/workflows/linters.yml
@@ -21,7 +21,7 @@ jobs:
- os: macos-12
packages: ""
- os: windows-2022
- packages: "-p boringtun"
+ packages: "-p neptun"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -38,7 +38,7 @@ jobs:
- os: macos-12
packages: ""
- os: windows-2022
- packages: -p boringtun
+ packages: -p neptun
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 1ff1609..bbbfe95 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -12,7 +12,7 @@ jobs:
- os: macos-12
packages: ""
- os: windows-2022
- packages: -p boringtun
+ packages: -p neptun
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -39,4 +39,4 @@ jobs:
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f # v1.0.6
- - run: cargo bench -p boringtun --no-run
+ - run: cargo bench -p neptun --no-run
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..0b8d146
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,32 @@
+# Contributing
+We happily accept both issues and pull requests for bug reports, bug fixes, feature requests, features implementations and documentation improvements.
+
+For new features we recommend that you create an issue first so the feature can be discussed and to prevent unnecessary work in case it's not a feature we want to support. Although, we do realize that sometimes code needs to be in place to allow for a meaningful discussion so creating an issue upfront is not a requirement.
+
+## Building and testing
+The steps for how to build and test NepTUN are described in the [README](README.md)
+
+## PR workflow
+We want to get your changes merged as fast as possible, and we know you want that too. To help with this there are a few things you can do to speed up the process:
+
+### Build, test and lint locally
+The local feedback cycle is faster than waiting for the CI. Make sure your changes can be built locally and that tests, rustfmt and clippy all pass locally. A green CI is a happy CI.
+
+### PR Hygiene
+On top of the CI being green, every PR will go through code review, and you can help us speed up the review process by making your PR easier to review. Here are some guidelines:
+
+**Small PRs are easier to review than big PRs**, so try to keep your PRs small and focused. To achieve that, try to make sure you PR doesn't contain multiple unrelated changes and if you are doing some bigger feature work, try to split the work into multiple smaller PRs that solve the problem together.
+
+**A clean history can make things easier**. Some PRs are easier to review commit-by-commit, rather than looking at the full changelist in one go. To enable that, prefer `rebase` over `merge` when updating your branch. Keeping PRs small and short-lived will also help keep your history clean since there's less time for upstream to change that much.
+
+## Licensing
+NepTUN is released under 3-Clause BSD License. For more details please refer to [LICENSE.md](LICENSE.md).
+
+## Contributing Documents
+Before we can accept your pull request we may need you to submit documents (e.g., DCO, CLA) that either be provided automatically or manually by us.
+In any case, we will guide you through and provide you with the support, if needed.
+
+## Code of conduct
+Nord Security and all of it's projects adhere to the [Contributor Covenant Code of Conduct](https://github.com/NordSecurity/.github/blob/master/CODE_OF_CONDUCT.md). When participating, you are expected to honor this code.
+
+## Thank you!
diff --git a/Cargo.lock b/Cargo.lock
index 26e6cdb..06fbd13 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -148,49 +148,6 @@ dependencies = [
"generic-array",
]
-[[package]]
-name = "boringtun"
-version = "0.6.0"
-dependencies = [
- "aead",
- "base64",
- "blake2",
- "chacha20poly1305",
- "criterion",
- "dispatch",
- "etherparse",
- "hex",
- "hmac",
- "ip_network",
- "ip_network_table",
- "libc",
- "mock_instant",
- "nix",
- "parking_lot",
- "rand",
- "rand_core",
- "ring",
- "socket2",
- "thiserror",
- "tokio",
- "tracing",
- "tracing-subscriber",
- "untrusted",
- "x25519-dalek",
-]
-
-[[package]]
-name = "boringtun-cli"
-version = "0.6.0"
-dependencies = [
- "boringtun",
- "clap",
- "daemonize",
- "tracing",
- "tracing-appender",
- "tracing-subscriber",
-]
-
[[package]]
name = "bumpalo"
version = "3.16.0"
@@ -697,6 +654,49 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "717e29a243b81f8130e31e24e04fb151b04a44b5a7d05370935f7d937e9de06d"
+[[package]]
+name = "neptun"
+version = "0.6.0"
+dependencies = [
+ "aead",
+ "base64",
+ "blake2",
+ "chacha20poly1305",
+ "criterion",
+ "dispatch",
+ "etherparse",
+ "hex",
+ "hmac",
+ "ip_network",
+ "ip_network_table",
+ "libc",
+ "mock_instant",
+ "nix",
+ "parking_lot",
+ "rand",
+ "rand_core",
+ "ring",
+ "socket2",
+ "thiserror",
+ "tokio",
+ "tracing",
+ "tracing-subscriber",
+ "untrusted",
+ "x25519-dalek",
+]
+
+[[package]]
+name = "neptun-cli"
+version = "0.6.0"
+dependencies = [
+ "clap",
+ "daemonize",
+ "neptun",
+ "tracing",
+ "tracing-appender",
+ "tracing-subscriber",
+]
+
[[package]]
name = "nix"
version = "0.28.0"
diff --git a/Cargo.toml b/Cargo.toml
index 388b88f..5148113 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
-members = ["boringtun", "boringtun-cli"]
+members = ["neptun", "neptun-cli"]
[profile.release]
lto = true # Enable full link-time optimization.
diff --git a/LICENSE.md b/LICENSE.md
index dfd871a..69d7969 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,4 +1,5 @@
-Copyright (c) 2019 Cloudflare, Inc. All rights reserved.
+Copyright (c) 2024 Nord Security. All rights reserved.
+Copyright (c) 2019-2024 Cloudflare, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
diff --git a/README.md b/README.md
index 4c4195c..2161c98 100644
--- a/README.md
+++ b/README.md
@@ -1,50 +1,29 @@
-![boringtun logo banner](./banner.png)
+# NepTUN
-# BoringTun
-
-## Warning
-Boringtun is currently undergoing a restructuring. You should probably not rely on or link to
-the master branch right now. Instead you should use the crates.io page.
-
-- boringtun: [![crates.io](https://img.shields.io/crates/v/boringtun.svg)](https://crates.io/crates/boringtun)
-- boringtun-cli [![crates.io](https://img.shields.io/crates/v/boringtun-cli.svg)](https://crates.io/crates/boringtun-cli)
-
-**BoringTun** is an implementation of the [WireGuard®](https://www.wireguard.com/) protocol designed for portability and speed.
-
-**BoringTun** is successfully deployed on millions of [iOS](https://apps.apple.com/us/app/1-1-1-1-faster-internet/id1423538627) and [Android](https://play.google.com/store/apps/details?id=com.cloudflare.onedotonedotonedotone&hl=en_US) consumer devices as well as thousands of Cloudflare Linux servers.
+**NepTUN** is an implementation of the [WireGuard®](https://www.wireguard.com/) protocol designed for portability and speed.
The project consists of two parts:
-
-* The executable `boringtun-cli`, a [userspace WireGuard](https://www.wireguard.com/xplatform/)
- implementation for Linux and macOS.
-* The library `boringtun` that can be used to implement fast and efficient WireGuard client apps on various platforms, including iOS and Android. It implements the underlying WireGuard protocol, without the network or tunnel stacks, those can be implemented in a platform idiomatic way.
-
-### Installation
-
-You can install this project using `cargo`:
-
-```
-cargo install boringtun-cli
-```
+* The executable `neptun-cli`, a [userspace WireGuard](https://www.wireguard.com/xplatform/) implementation for Linux and macOS.
+* The library `neptun` that can be used to implement fast and efficient WireGuard client apps on various platforms, including iOS and Android. It implements the underlying WireGuard protocol, without the network or tunnel stacks, those can be implemented in a platform idiomatic way.
### Building
- Library only: `cargo build --lib --no-default-features --release [--target $(TARGET_TRIPLE)]`
-- Executable: `cargo build --bin boringtun-cli --release [--target $(TARGET_TRIPLE)]`
+- Executable: `cargo build --bin neptun-cli --release [--target $(TARGET_TRIPLE)]`
-By default the executable is placed in the `./target/release` folder. You can copy it to a desired location manually, or install it using `cargo install --bin boringtun --path .`.
+By default the executable is placed in the `./target/release` folder. You can copy it to a desired location manually, or install it using `cargo install --bin neptun --path .`.
### Running
As per the specification, to start a tunnel use:
-`boringtun-cli [-f/--foreground] INTERFACE-NAME`
+`neptun-cli [-f/--foreground] INTERFACE-NAME`
The tunnel can then be configured using [wg](https://git.zx2c4.com/WireGuard/about/src/tools/man/wg.8), as a regular WireGuard tunnel, or any other tool.
-It is also possible to use with [wg-quick](https://git.zx2c4.com/WireGuard/about/src/tools/man/wg-quick.8) by setting the environment variable `WG_QUICK_USERSPACE_IMPLEMENTATION` to `boringtun`. For example:
+It is also possible to use with [wg-quick](https://git.zx2c4.com/WireGuard/about/src/tools/man/wg-quick.8) by setting the environment variable `WG_QUICK_USERSPACE_IMPLEMENTATION` to `neptun`. For example:
-`sudo WG_QUICK_USERSPACE_IMPLEMENTATION=boringtun-cli WG_SUDO=1 wg-quick up CONFIGURATION`
+`sudo WG_QUICK_USERSPACE_IMPLEMENTATION=neptun-cli WG_SUDO=1 wg-quick up CONFIGURATION`
### Testing
@@ -74,24 +53,14 @@ arm-linux-androideabi | | ✓ |
`x86-64`, `aarch64` and `armv7` architectures are supported. The behaviour should be identical to that of [wireguard-go](https://git.zx2c4.com/wireguard-go/about/), with the following difference:
-`boringtun` will drop privileges when started. When privileges are dropped it is not possible to set `fwmark`. If `fwmark` is required, such as when using `wg-quick`, run with `--disable-drop-privileges` or set the environment variable `WG_SUDO=1`.
+`neptun` will drop privileges when started. When privileges are dropped it is not possible to set `fwmark`. If `fwmark` is required, such as when using `wg-quick`, run with `--disable-drop-privileges` or set the environment variable `WG_SUDO=1`.
-You will need to give the executable the `CAP_NET_ADMIN` capability using: `sudo setcap cap_net_admin+epi boringtun`. sudo is not needed.
+You will need to give the executable the `CAP_NET_ADMIN` capability using: `sudo setcap cap_net_admin+epi neptun`. sudo is not needed.
#### macOS
The behaviour is similar to that of [wireguard-go](https://git.zx2c4.com/wireguard-go/about/). Specifically the interface name must be `utun[0-9]+` for an explicit interface name or `utun` to have the kernel select the lowest available. If you choose `utun` as the interface name, and the environment variable `WG_TUN_NAME_FILE` is defined, then the actual name of the interface chosen by the kernel is written to the file specified by that variable.
----
-
-#### FFI bindings
-
-The library exposes a set of C ABI bindings, those are defined in the `wireguard_ffi.h` header file. The C bindings can be used with C/C++, Swift (using a bridging header) or C# (using [DLLImport](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.dllimportattribute?view=netcore-2.2) with [CallingConvention](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention?view=netcore-2.2) set to `Cdecl`).
-
-#### JNI bindings
-
-The library exposes a set of Java Native Interface bindings, those are defined in `src/jni.rs`.
-
## License
The project is licensed under the [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause).
@@ -104,5 +73,9 @@ If you want to contribute to this project, please read our [`CONTRIBUTING.md`].
[`CONTRIBUTING.md`]: https://github.com/cloudflare/.github/blob/master/CONTRIBUTING.md
+## Acknowledgements
+
+This project is based on the [BoringTun](https://github.com/cloudflare/boringtun) project by Cloudflare.
+
---
-WireGuard is a registered trademark of Jason A. Donenfeld. BoringTun is not sponsored or endorsed by Jason A. Donenfeld.
+WireGuard is a registered trademark of Jason A. Donenfeld. NepTUN is not sponsored or endorsed by Jason A. Donenfeld.
diff --git a/banner.png b/banner.png
deleted file mode 100644
index d039deb..0000000
Binary files a/banner.png and /dev/null differ
diff --git a/logo.png b/logo.png
deleted file mode 100644
index 63f4b14..0000000
Binary files a/logo.png and /dev/null differ
diff --git a/boringtun-cli/Cargo.toml b/neptun-cli/Cargo.toml
similarity index 72%
rename from boringtun-cli/Cargo.toml
rename to neptun-cli/Cargo.toml
index 931a66e..efeb765 100644
--- a/boringtun-cli/Cargo.toml
+++ b/neptun-cli/Cargo.toml
@@ -1,11 +1,10 @@
[package]
-name = "boringtun-cli"
+name = "neptun-cli"
description = "an implementation of the WireGuard® protocol designed for portability and speed"
version = "0.6.0"
authors = ["Noah Kennedy ", "Andy Grover ", "Jeff Hiner "]
license = "BSD-3-Clause"
-repository = "https://github.com/cloudflare/boringtun"
-documentation = "https://docs.rs/boringtun/0.5.2/boringtun/"
+repository = "https://github.com/nordsecurity/neptun"
edition = "2021"
[dependencies]
@@ -15,7 +14,7 @@ tracing = "0.1.31"
tracing-subscriber = "0.3.18"
tracing-appender = "0.2.1"
-[dependencies.boringtun]
+[dependencies.neptun]
version = "0.6.0"
-path = "../boringtun"
+path = "../neptun"
features = ["device"]
diff --git a/boringtun-cli/src/main.rs b/neptun-cli/src/main.rs
similarity index 90%
rename from boringtun-cli/src/main.rs
rename to neptun-cli/src/main.rs
index ecf7083..fac128e 100644
--- a/boringtun-cli/src/main.rs
+++ b/neptun-cli/src/main.rs
@@ -1,10 +1,11 @@
-// Copyright (c) 2019 Cloudflare, Inc. All rights reserved.
+// Copyright (c) 2024 Nord Security. All rights reserved.
+// Copyright (c) 2019-2024 Cloudflare, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
-use boringtun::device::drop_privileges::drop_privileges;
-use boringtun::device::{DeviceConfig, DeviceHandle};
use clap::{value_parser, Arg, Command};
use daemonize::{Daemonize, Outcome, Parent};
+use neptun::device::drop_privileges::drop_privileges;
+use neptun::device::{DeviceConfig, DeviceHandle};
use std::fs::File;
use std::os::unix::net::UnixDatagram;
use std::path::PathBuf;
@@ -15,7 +16,7 @@ use tracing::Level;
fn check_tun_name(name: &str) -> Result {
#[cfg(any(target_os = "macos", target_os = "ios"))]
{
- if boringtun::device::tun::parse_utun_name(name).is_ok() {
+ if neptun::device::tun::parse_utun_name(name).is_ok() {
Ok(name.to_owned())
} else {
Err("Tunnel name must have the format 'utun[0-9]+', use 'utun' for automatic assignment".to_owned())
@@ -28,7 +29,7 @@ fn check_tun_name(name: &str) -> Result {
}
fn main() {
- let matches = Command::new("boringtun")
+ let matches = Command::new("neptun")
.version(env!("CARGO_PKG_VERSION"))
.author("Vlad Krasnov ")
.args(&[
@@ -77,7 +78,7 @@ fn main() {
.env("WG_LOG_FILE")
.value_parser(value_parser!(PathBuf))
.help("Log file")
- .default_value("/tmp/boringtun.out"),
+ .default_value("/tmp/neptun.out"),
Arg::new("disable-drop-privileges")
.long("disable-drop-privileges")
.env("WG_SUDO")
@@ -136,10 +137,10 @@ fn main() {
})) => {
let mut b = [0u8; 1];
if sock2.recv(&mut b).is_ok() && b[0] == 1 {
- println!("BoringTun started successfully");
+ println!("NepTUN started successfully");
exit(first_child_exit_code)
} else {
- eprintln!("BoringTun failed to start");
+ eprintln!("NepTUN failed to start");
exit(1);
};
}
@@ -147,7 +148,7 @@ fn main() {
eprintln!("Failed to fork process: {err}");
exit(1);
}
- Outcome::Child(Ok(_)) => tracing::info!("BoringTun started successfully"),
+ Outcome::Child(Ok(_)) => tracing::info!("NepTUN started successfully"),
Outcome::Child(Err(err)) => {
tracing::error!(error = ?err);
exit(1);
@@ -168,7 +169,7 @@ fn main() {
#[cfg(target_os = "linux")]
use_multi_queue: !matches.get_flag("disable-multi-queue"),
open_uapi_socket: false,
- protect: Arc::new(boringtun::device::MakeExternalBoringtunNoop),
+ protect: Arc::new(neptun::device::MakeExternalNeptunNoop),
firewall_process_inbound_callback: None,
firewall_process_outbound_callback: None,
};
@@ -195,7 +196,7 @@ fn main() {
sock1.send(&[1]).unwrap();
drop(sock1);
- tracing::info!("BoringTun started successfully");
+ tracing::info!("NepTUN started successfully");
device_handle.wait();
}
diff --git a/boringtun/Cargo.toml b/neptun/Cargo.toml
similarity index 96%
rename from boringtun/Cargo.toml
rename to neptun/Cargo.toml
index 35ff2f0..6981736 100644
--- a/boringtun/Cargo.toml
+++ b/neptun/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "boringtun"
+name = "neptun"
description = "an implementation of the WireGuard® protocol designed for portability and speed"
version = "0.6.0"
authors = [
@@ -8,7 +8,6 @@ authors = [
"Jeff Hiner ",
]
license = "BSD-3-Clause"
-documentation = "https://docs.rs/boringtun/0.5.2/boringtun/"
edition = "2018"
[features]
diff --git a/boringtun/benches/crypto_benches/blake2s_benching.rs b/neptun/benches/crypto_benches/blake2s_benching.rs
similarity index 100%
rename from boringtun/benches/crypto_benches/blake2s_benching.rs
rename to neptun/benches/crypto_benches/blake2s_benching.rs
diff --git a/boringtun/benches/crypto_benches/chacha20poly1305_benching.rs b/neptun/benches/crypto_benches/chacha20poly1305_benching.rs
similarity index 100%
rename from boringtun/benches/crypto_benches/chacha20poly1305_benching.rs
rename to neptun/benches/crypto_benches/chacha20poly1305_benching.rs
diff --git a/boringtun/benches/crypto_benches/main.rs b/neptun/benches/crypto_benches/main.rs
similarity index 100%
rename from boringtun/benches/crypto_benches/main.rs
rename to neptun/benches/crypto_benches/main.rs
diff --git a/boringtun/benches/crypto_benches/x25519_public_key_benching.rs b/neptun/benches/crypto_benches/x25519_public_key_benching.rs
similarity index 100%
rename from boringtun/benches/crypto_benches/x25519_public_key_benching.rs
rename to neptun/benches/crypto_benches/x25519_public_key_benching.rs
diff --git a/boringtun/benches/crypto_benches/x25519_shared_key_benching.rs b/neptun/benches/crypto_benches/x25519_shared_key_benching.rs
similarity index 100%
rename from boringtun/benches/crypto_benches/x25519_shared_key_benching.rs
rename to neptun/benches/crypto_benches/x25519_shared_key_benching.rs
diff --git a/boringtun/src/device/allowed_ips.rs b/neptun/src/device/allowed_ips.rs
similarity index 100%
rename from boringtun/src/device/allowed_ips.rs
rename to neptun/src/device/allowed_ips.rs
diff --git a/boringtun/src/device/api.rs b/neptun/src/device/api.rs
similarity index 99%
rename from boringtun/src/device/api.rs
rename to neptun/src/device/api.rs
index 098b04f..eccba44 100644
--- a/boringtun/src/device/api.rs
+++ b/neptun/src/device/api.rs
@@ -1,4 +1,5 @@
-// Copyright (c) 2019 Cloudflare, Inc. All rights reserved.
+// Copyright (c) 2024 Nord Security. All rights reserved.
+// Copyright (c) 2019-2024 Cloudflare, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
use super::dev_lock::LockReadGuard;
diff --git a/boringtun/src/device/dev_lock.rs b/neptun/src/device/dev_lock.rs
similarity index 100%
rename from boringtun/src/device/dev_lock.rs
rename to neptun/src/device/dev_lock.rs
diff --git a/boringtun/src/device/drop_privileges.rs b/neptun/src/device/drop_privileges.rs
similarity index 100%
rename from boringtun/src/device/drop_privileges.rs
rename to neptun/src/device/drop_privileges.rs
diff --git a/boringtun/src/device/epoll.rs b/neptun/src/device/epoll.rs
similarity index 100%
rename from boringtun/src/device/epoll.rs
rename to neptun/src/device/epoll.rs
diff --git a/boringtun/src/device/integration_tests/mod.rs b/neptun/src/device/integration_tests/mod.rs
similarity index 98%
rename from boringtun/src/device/integration_tests/mod.rs
rename to neptun/src/device/integration_tests/mod.rs
index a4f4799..9f76ed0 100644
--- a/boringtun/src/device/integration_tests/mod.rs
+++ b/neptun/src/device/integration_tests/mod.rs
@@ -1,7 +1,8 @@
-// Copyright (c) 2019 Cloudflare, Inc. All rights reserved.
+// Copyright (c) 2024 Nord Security. All rights reserved.
+// Copyright (c) 2019-2024 Cloudflare, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
-// This module contains some integration tests for boringtun
+// This module contains some integration tests for neptun
// Those tests require docker and sudo privileges to run
#[cfg(all(test, not(target_os = "macos")))]
mod tests {
@@ -268,7 +269,7 @@ mod tests {
open_uapi_socket: true,
#[cfg(target_os = "linux")]
uapi_fd: -1,
- protect: Arc::new(crate::device::MakeExternalBoringtunNoop),
+ protect: Arc::new(crate::device::MakeExternalNeptunNoop),
firewall_process_inbound_callback: None,
firewall_process_outbound_callback: None,
},
@@ -563,7 +564,7 @@ mod tests {
open_uapi_socket: true,
#[cfg(target_os = "linux")]
uapi_fd: -1,
- protect: Arc::new(crate::device::MakeExternalBoringtunNoop),
+ protect: Arc::new(crate::device::MakeExternalNeptunNoop),
firewall_process_inbound_callback: None,
firewall_process_outbound_callback: None,
},
@@ -767,7 +768,7 @@ mod tests {
open_uapi_socket: true,
#[cfg(target_os = "linux")]
uapi_fd: -1,
- protect: Arc::new(crate::device::MakeExternalBoringtunNoop),
+ protect: Arc::new(crate::device::MakeExternalNeptunNoop),
firewall_process_inbound_callback: None,
firewall_process_outbound_callback: None,
},
diff --git a/boringtun/src/device/kqueue.rs b/neptun/src/device/kqueue.rs
similarity index 100%
rename from boringtun/src/device/kqueue.rs
rename to neptun/src/device/kqueue.rs
diff --git a/boringtun/src/device/mod.rs b/neptun/src/device/mod.rs
similarity index 99%
rename from boringtun/src/device/mod.rs
rename to neptun/src/device/mod.rs
index d73849d..1f308d4 100644
--- a/boringtun/src/device/mod.rs
+++ b/neptun/src/device/mod.rs
@@ -1,4 +1,5 @@
-// Copyright (c) 2019 Cloudflare, Inc. All rights reserved.
+// Copyright (c) 2024 Nord Security. All rights reserved.
+// Copyright (c) 2019-2024 Cloudflare, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
pub mod allowed_ips;
@@ -104,13 +105,13 @@ enum Action {
// Event handler function
type Handler = Box, &mut ThreadData) -> Action + Send + Sync>;
-pub trait MakeExternalBoringtun: Send + Sync {
+pub trait MakeExternalNeptun: Send + Sync {
fn make_external(&self, socket: RawFd);
}
-pub struct MakeExternalBoringtunNoop;
+pub struct MakeExternalNeptunNoop;
-impl MakeExternalBoringtun for MakeExternalBoringtunNoop {
+impl MakeExternalNeptun for MakeExternalNeptunNoop {
fn make_external(&self, _socket: std::os::fd::RawFd) {}
}
@@ -129,7 +130,7 @@ pub struct DeviceConfig {
#[cfg(target_os = "linux")]
pub use_multi_queue: bool,
pub open_uapi_socket: bool,
- pub protect: Arc,
+ pub protect: Arc,
pub firewall_process_inbound_callback:
Option bool + Send + Sync>>,
pub firewall_process_outbound_callback:
@@ -218,7 +219,7 @@ impl DeviceHandle {
threads.push({
let dev = Arc::clone(&interface_lock);
thread::Builder::new()
- .name(format!("boringtun"))
+ .name(format!("neptun"))
.spawn(move || DeviceHandle::event_loop(i, &dev))?
});
}
diff --git a/boringtun/src/device/peer.rs b/neptun/src/device/peer.rs
similarity index 95%
rename from boringtun/src/device/peer.rs
rename to neptun/src/device/peer.rs
index 8e0440e..24c58de 100644
--- a/boringtun/src/device/peer.rs
+++ b/neptun/src/device/peer.rs
@@ -1,4 +1,5 @@
-// Copyright (c) 2019 Cloudflare, Inc. All rights reserved.
+// Copyright (c) 2024 Nord Security. All rights reserved.
+// Copyright (c) 2019-2024 Cloudflare, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
use parking_lot::{Mutex, RwLock};
@@ -8,7 +9,7 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, Shutdown, SocketAddr, SocketAddrV4, S
use std::str::FromStr;
use std::sync::Arc;
-use crate::device::{AllowedIps, Error, MakeExternalBoringtun};
+use crate::device::{AllowedIps, Error, MakeExternalNeptun};
use crate::noise::Tunn;
use std::os::fd::AsRawFd;
@@ -29,7 +30,7 @@ pub struct Peer {
endpoint: RwLock,
allowed_ips: RwLock>,
preshared_key: RwLock