From e8b24118643e91ecda03d353cfbfea535a2b18dc Mon Sep 17 00:00:00 2001 From: zedddie Date: Sun, 15 Mar 2026 15:44:34 +0100 Subject: sniff things wip --- src/sniffing/headers.rs | 10 ++++++++++ src/startup.rs | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/sniffing/headers.rs b/src/sniffing/headers.rs index 836cf32..7ed1a88 100644 --- a/src/sniffing/headers.rs +++ b/src/sniffing/headers.rs @@ -1 +1,11 @@ // Here we will recieve bytes and try to get their destanation & apply Rules for them. +use crate::config::Config; + +struct PacketInfo; +pub fn sniff_raw_packets(packet: &[u8]) -> Result> { + todo!() +} + +pub fn apply_rules(config: Config, pinfo: PacketInfo) { + todo!() +} diff --git a/src/startup.rs b/src/startup.rs index 32ed278..b9e0191 100644 --- a/src/startup.rs +++ b/src/startup.rs @@ -1,5 +1,6 @@ // Here we iniitialize systems crucial for nsc use std::io::Read; +use sniffing::headers::sniff_raw_packets; pub fn init() -> Result<(), Box> { let mut config = tun::Configuration::default(); @@ -20,6 +21,8 @@ pub fn init() -> Result<(), Box> loop { let amount = dev.read(&mut buf)?; - println!("{:?}", &buf[0..amount]); + sniff_raw_packets(&buf[0..amount]); + dbg!("{:?}", &buf[0..amount]); + } } -- cgit v1.2.3