mirror of
https://github.com/egor-white/zaprett.git
synced 2026-01-20 01:29:43 +05:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32b1bc9de9 | ||
|
|
0dabe2f4e7 | ||
|
|
634f9245b2 | ||
|
|
4526c6d313 | ||
|
|
cceed3a1d7 | ||
|
|
60f112656a | ||
|
|
389e350746 |
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "rust/crates/libnfqws/zapret"]
|
||||
path = rust/crates/libnfqws/zapret
|
||||
url = https://github.com/bol-van/zapret.git
|
||||
[submodule "rust/crates/libnfqws2/zapret2"]
|
||||
path = rust/crates/libnfqws2/zapret2
|
||||
url = https://github.com/bol-van/zapret2
|
||||
|
||||
@@ -1 +1 @@
|
||||
Список изменений: 1. Использование команды restart 2. Исправление customize.sh 3. Обновление hosts-файла
|
||||
Список изменений: Обновление zapret Добавление файлов для стратегий alt 10 и alt 11
|
||||
|
||||
20
rust/Cargo.lock
generated
20
rust/Cargo.lock
generated
@@ -385,6 +385,16 @@ dependencies = [
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libnfqws2"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
"cc",
|
||||
"glob",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
version = "0.4.14"
|
||||
@@ -400,6 +410,15 @@ version = "0.4.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
|
||||
|
||||
[[package]]
|
||||
name = "luajit"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "216ed8eb8f7edfb5bfc1163cce9747517ed2ea7656a884640791a2be86b86e54"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.7.6"
|
||||
@@ -1114,6 +1133,7 @@ dependencies = [
|
||||
"libc",
|
||||
"libnfqws",
|
||||
"log",
|
||||
"luajit",
|
||||
"nix",
|
||||
"pretty_env_logger",
|
||||
"regex",
|
||||
|
||||
11
rust/crates/libnfqws2/Cargo.toml
Normal file
11
rust/crates/libnfqws2/Cargo.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
[package]
|
||||
name = "libnfqws2"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[build-dependencies]
|
||||
cc = "1.2.43"
|
||||
once_cell = "1.21.3"
|
||||
glob = "0.3.3"
|
||||
bindgen = "0.72.1"
|
||||
68
rust/crates/libnfqws2/build.rs
Normal file
68
rust/crates/libnfqws2/build.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
use once_cell::sync::Lazy;
|
||||
use std::env;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
macro_rules! rel_manifest_path {
|
||||
($name:ident, $path:expr) => {
|
||||
static $name: Lazy<PathBuf> = Lazy::new(|| {
|
||||
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
Path::new(&manifest_dir).join($path)
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
rel_manifest_path!(NFQ, "zapret2/nfq2");
|
||||
rel_manifest_path!(NFQ_CRYPTO, "zapret2/nfq2/crypto");
|
||||
|
||||
fn main() {
|
||||
cc::Build::new()
|
||||
.files(
|
||||
glob::glob(&format!("{}/*.c", NFQ.display()))
|
||||
.unwrap()
|
||||
.filter_map(Result::ok),
|
||||
)
|
||||
.files(
|
||||
glob::glob(&format!("{}/*.c", NFQ_CRYPTO.display()))
|
||||
.unwrap()
|
||||
.filter_map(Result::ok),
|
||||
)
|
||||
.include(&*NFQ)
|
||||
.include(&*NFQ_CRYPTO)
|
||||
.flag("-w")
|
||||
.define("main", "nfqws2_main")
|
||||
.compile("libnfqws2.a");
|
||||
|
||||
println!("cargo:rustc-link-lib=z");
|
||||
println!("cargo:rustc-link-lib=netfilter_queue");
|
||||
println!("cargo:rustc-link-lib=nfnetlink");
|
||||
println!("cargo:rustc-link-lib=mnl");
|
||||
|
||||
let _ = env::var("NETFILTER_LIBS")
|
||||
.map(|libs| println!("cargo:rustc-link-search=native={libs}/lib"));
|
||||
|
||||
println!("cargo:rustc-link-lib=static=nfqws2");
|
||||
println!("cargo:rerun-if-changed={}", NFQ.display());
|
||||
println!("cargo:rerun-if-changed={}", NFQ_CRYPTO.display());
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
|
||||
let mut builder = bindgen::Builder::default();
|
||||
|
||||
for header in glob::glob(&format!("{}/*.h", NFQ.display()))
|
||||
.unwrap()
|
||||
.filter_map(Result::ok)
|
||||
{
|
||||
builder = builder.header(header.to_string_lossy());
|
||||
}
|
||||
|
||||
builder = builder.clang_arg("-Dmain=nfqws2_main");
|
||||
|
||||
let bindings = builder
|
||||
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
|
||||
.generate()
|
||||
.expect("Unable to generate libnfqws2");
|
||||
|
||||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
bindings
|
||||
.write_to_file(out_path.join("libnfqws2.rs"))
|
||||
.expect("Couldn't write libnfqws2");
|
||||
}
|
||||
2
rust/crates/libnfqws2/src/lib.rs
Normal file
2
rust/crates/libnfqws2/src/lib.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
#![allow(warnings)]
|
||||
include!(concat!(env!("OUT_DIR"), "/libnfqws2.rs"));
|
||||
1
rust/crates/libnfqws2/zapret2
Submodule
1
rust/crates/libnfqws2/zapret2
Submodule
Submodule rust/crates/libnfqws2/zapret2 added at 36ee42bc8c
@@ -21,3 +21,4 @@ log = { workspace = true }
|
||||
nix = { workspace = true, features = ["user"] }
|
||||
getset = { workspace = true }
|
||||
sysinfo = { workspace = true }
|
||||
luajit = "0.1.1"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "6.3",
|
||||
"versionCode": 63,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/6.3.0/zaprett-hosts.zip",
|
||||
"version": "6.4",
|
||||
"versionCode": 64,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/6.4.0/zaprett-hosts.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/egor-white/zaprett/refs/heads/main/changelog.md"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "6.0",
|
||||
"versionCode": 60,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/6.0.0/zaprett.zip",
|
||||
"version": "6.4",
|
||||
"versionCode": 100,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/6.4.0/zaprett.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/egor-white/zaprett/refs/heads/main/changelog.md"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "6.3",
|
||||
"versionCode": 63,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/6.3.0/zaprett.zip",
|
||||
"version": "6.4",
|
||||
"versionCode": 64,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/6.4.0/zaprett.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/egor-white/zaprett/refs/heads/main/changelog.md"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user