aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-11-15 15:34:19 +0100
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-11-15 15:34:19 +0100
commit7f71249f4bd23225f8d74a921a463170d121d9b0 (patch)
tree5951f613906dec6bfb18c6450d7d090cb13a4f55
parent2def62bdf42841e44effa8d2679e14b26a381a17 (diff)
migrate to netlinklib
-rw-r--r--Cargo.lock60
-rw-r--r--Cargo.toml2
-rw-r--r--src/error.rs4
-rw-r--r--src/main.rs2
4 files changed, 8 insertions, 60 deletions
diff --git a/Cargo.lock b/Cargo.lock
index af49b03..7decf37 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -56,12 +56,6 @@ dependencies = [
]
[[package]]
-name = "bitfield"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac"
-
-[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -622,7 +616,7 @@ dependencies = [
"libc",
"linkaddrs",
"rand",
- "rsdsl_netlinkd",
+ "rsdsl_netlinklib",
"serde",
"serde_derive",
"serde_json",
@@ -632,43 +626,19 @@ dependencies = [
]
[[package]]
-name = "rsdsl_ip_config"
-version = "0.2.4"
-source = "git+https://github.com/rsdsl/ip_config.git#b68885346f4aa8a3216645c65e92f7c7a2c5ff51"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "rsdsl_netlinkd"
-version = "0.7.1"
-source = "git+https://github.com/rsdsl/netlinkd.git#ed35bb384a77ba78baa6898df45ef4e7150a9df2"
+name = "rsdsl_netlinklib"
+version = "0.2.0"
+source = "git+https://github.com/rsdsl/netlinklib.git#fa4720e74d3f93f6c908e479d9fbb90d54b9ba8c"
dependencies = [
- "bitfield",
"futures",
- "futures-util",
- "ipnet",
"libc",
"netlink-packet-route",
- "rsdsl_ip_config",
- "rsdsl_pd_config",
"rtnetlink",
- "serde_json",
- "signal-hook",
- "sysinfo",
"thiserror",
"tokio",
]
[[package]]
-name = "rsdsl_pd_config"
-version = "0.1.0"
-source = "git+https://github.com/rsdsl/pd_config.git#6cf4dbd588730396d5d03f5d01ad88ff37bf79b0"
-dependencies = [
- "serde",
-]
-
-[[package]]
name = "rtnetlink"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -709,9 +679,6 @@ name = "serde"
version = "1.0.177"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63ba2516aa6bf82e0b19ca8b50019d52df58455d3cf9bdaf6315225fdd0c560a"
-dependencies = [
- "serde_derive",
-]
[[package]]
name = "serde_derive"
@@ -736,25 +703,6 @@ dependencies = [
]
[[package]]
-name = "signal-hook"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801"
-dependencies = [
- "libc",
- "signal-hook-registry",
-]
-
-[[package]]
-name = "signal-hook-registry"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
-dependencies = [
- "libc",
-]
-
-[[package]]
name = "slab"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 1dfed6f..b0058ff 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ ipnet = "2.7.1"
libc = "0.2"
linkaddrs = { git = "https://github.com/HimbeerserverDE/linkaddrs.git", version = "0.1.0" }
rand = "0.8.5"
-rsdsl_netlinkd = { git = "https://github.com/rsdsl/netlinkd.git", version = "0.7.1" }
+rsdsl_netlinklib = { git = "https://github.com/rsdsl/netlinklib.git", version = "0.2.0", default-features = false, features = ["blocking", "status"] }
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
diff --git a/src/error.rs b/src/error.rs
index 2c85284..7f44d4c 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -37,8 +37,8 @@ pub enum Error {
DhcprotoEncode(#[from] dhcproto::error::EncodeError),
#[error("linkaddrs error")]
LinkAddrs(#[from] linkaddrs::Error),
- #[error("rsdsl_netlinkd error")]
- RsdslNetlinkd(#[from] rsdsl_netlinkd::Error),
+ #[error("netlinklib error: {0}")]
+ Netlinklib(#[from] rsdsl_netlinklib::Error),
#[error("serde_json error")]
SerdeJson(#[from] serde_json::Error),
}
diff --git a/src/main.rs b/src/main.rs
index 2495963..368e143 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -15,7 +15,7 @@ use std::time::Duration;
use dhcproto::v4::{DhcpOption, Flags, Message, MessageType, Opcode, OptionCode};
use dhcproto::{Decodable, Decoder, Encodable, Encoder};
-use rsdsl_netlinkd::link;
+use rsdsl_netlinklib::blocking::link;
use socket2::{Domain, Socket, Type};
use sysinfo::{ProcessExt, Signal, System, SystemExt};