summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock38
-rw-r--r--Cargo.toml4
-rw-r--r--packet-detector/src/.main.rs.swpbin16384 -> 16384 bytes
-rw-r--r--packet-detector/src/main.rs4
4 files changed, 24 insertions, 22 deletions
diff --git a/Cargo.lock b/Cargo.lock
index be5fb54..60933ca 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -210,18 +210,18 @@ dependencies = [
210 210
211[[package]] 211[[package]]
212name = "aya" 212name = "aya"
213version = "0.12.0" 213version = "0.13.1"
214source = "registry+https://github.com/rust-lang/crates.io-index" 214source = "registry+https://github.com/rust-lang/crates.io-index"
215checksum = "90eea657cc8028447cbda5068f4e10c4fadba0131624f4f7dd1a9c46ffc8d81f" 215checksum = "d18bc4e506fbb85ab7392ed993a7db4d1a452c71b75a246af4a80ab8c9d2dd50"
216dependencies = [ 216dependencies = [
217 "assert_matches", 217 "assert_matches",
218 "aya-obj", 218 "aya-obj",
219 "bitflags", 219 "bitflags",
220 "bytes", 220 "bytes",
221 "lazy_static",
222 "libc", 221 "libc",
223 "log", 222 "log",
224 "object", 223 "object",
224 "once_cell",
225 "thiserror 1.0.69", 225 "thiserror 1.0.69",
226] 226]
227 227
@@ -266,13 +266,13 @@ dependencies = [
266 266
267[[package]] 267[[package]]
268name = "aya-obj" 268name = "aya-obj"
269version = "0.1.0" 269version = "0.2.1"
270source = "registry+https://github.com/rust-lang/crates.io-index" 270source = "registry+https://github.com/rust-lang/crates.io-index"
271checksum = "2c02024a307161cf3d1f052161958fd13b1a33e3e038083e58082c0700fdab85" 271checksum = "c51b96c5a8ed8705b40d655273bc4212cbbf38d4e3be2788f36306f154523ec7"
272dependencies = [ 272dependencies = [
273 "bytes", 273 "bytes",
274 "core-error", 274 "core-error",
275 "hashbrown 0.14.5", 275 "hashbrown 0.15.5",
276 "log", 276 "log",
277 "object", 277 "object",
278 "thiserror 1.0.69", 278 "thiserror 1.0.69",
@@ -413,6 +413,15 @@ dependencies = [
413] 413]
414 414
415[[package]] 415[[package]]
416name = "crc32fast"
417version = "1.5.0"
418source = "registry+https://github.com/rust-lang/crates.io-index"
419checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
420dependencies = [
421 "cfg-if",
422]
423
424[[package]]
416name = "crossbeam-utils" 425name = "crossbeam-utils"
417version = "0.8.21" 426version = "0.8.21"
418source = "registry+https://github.com/rust-lang/crates.io-index" 427source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -809,16 +818,6 @@ dependencies = [
809 818
810[[package]] 819[[package]]
811name = "hashbrown" 820name = "hashbrown"
812version = "0.14.5"
813source = "registry+https://github.com/rust-lang/crates.io-index"
814checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
815dependencies = [
816 "ahash",
817 "allocator-api2",
818]
819
820[[package]]
821name = "hashbrown"
822version = "0.15.5" 821version = "0.15.5"
823source = "registry+https://github.com/rust-lang/crates.io-index" 822source = "registry+https://github.com/rust-lang/crates.io-index"
824checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" 823checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
@@ -1388,10 +1387,13 @@ dependencies = [
1388 1387
1389[[package]] 1388[[package]]
1390name = "object" 1389name = "object"
1391version = "0.32.2" 1390version = "0.36.7"
1392source = "registry+https://github.com/rust-lang/crates.io-index" 1391source = "registry+https://github.com/rust-lang/crates.io-index"
1393checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" 1392checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
1394dependencies = [ 1393dependencies = [
1394 "crc32fast",
1395 "hashbrown 0.15.5",
1396 "indexmap",
1395 "memchr", 1397 "memchr",
1396] 1398]
1397 1399
diff --git a/Cargo.toml b/Cargo.toml
index 17750ae..cf5a1d8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,8 +3,8 @@ members = ["packet-detector", "packet-detector-ebpf", "xtask"]
3resolver = "2" 3resolver = "2"
4 4
5[workspace.dependencies] 5[workspace.dependencies]
6aya = "0.12" 6aya = "0.13.1"
7aya-ebpf = "0.1" 7aya-ebpf = "0.1.1"
8 8
9[profile.dev] 9[profile.dev]
10opt-level = 3 10opt-level = 3
diff --git a/packet-detector/src/.main.rs.swp b/packet-detector/src/.main.rs.swp
index 6037596..4a73a5f 100644
--- a/packet-detector/src/.main.rs.swp
+++ b/packet-detector/src/.main.rs.swp
Binary files differ
diff --git a/packet-detector/src/main.rs b/packet-detector/src/main.rs
index 69cccec..fd79e8b 100644
--- a/packet-detector/src/main.rs
+++ b/packet-detector/src/main.rs
@@ -7,7 +7,7 @@ use std::net::Ipv4Addr;
7use anyhow::{Context, Result}; 7use anyhow::{Context, Result};
8use aya::maps::{HashMap as AyaHashMap, RingBuf}; 8use aya::maps::{HashMap as AyaHashMap, RingBuf};
9use aya::programs::{Xdp, XdpFlags}; 9use aya::programs::{Xdp, XdpFlags};
10use aya::{include_bytes_aligned, Bpf}; 10use aya::{include_bytes_aligned, Ebpf};
11use log::{info, warn}; 11use log::{info, warn};
12use tls_parser::{parse_tls_plaintext, TlsMessage, TlsMessageHandshake}; 12use tls_parser::{parse_tls_plaintext, TlsMessage, TlsMessageHandshake};
13use tokio::signal; 13use tokio::signal;
@@ -111,7 +111,7 @@ async fn main() -> Result<()> {
111 let validator = args.get(2).map(|p| CertValidator::with_ca_file(p)).transpose()?; 111 let validator = args.get(2).map(|p| CertValidator::with_ca_file(p)).transpose()?;
112 info!("Mode: {}", if validator.is_some() { "TLS cert validation" } else { "UDP magic detection" }); 112 info!("Mode: {}", if validator.is_some() { "TLS cert validation" } else { "UDP magic detection" });
113 113
114 let mut bpf = Bpf::load(include_bytes_aligned!("../../target/bpfel-unknown-none/release/packet-detector"))?; 114 let mut bpf = Ebpf::load(include_bytes_aligned!("../../target/bpfel-unknown-none/release/packet-detector"))?;
115 let program: &mut Xdp = bpf.program_mut("packet_detector").unwrap().try_into()?; 115 let program: &mut Xdp = bpf.program_mut("packet_detector").unwrap().try_into()?;
116 program.load()?; 116 program.load()?;
117 program.attach(iface, XdpFlags::default()).context("XDP attach failed")?; 117 program.attach(iface, XdpFlags::default()).context("XDP attach failed")?;