close to final of fake ip resolving

This commit is contained in:
2026-03-08 00:11:52 +07:00
parent b1cc4c14f4
commit 8bad1b0162
8 changed files with 91 additions and 42 deletions
+2 -10
View File
@@ -4,7 +4,6 @@ use smoltcp::{
iface::{Config, Interface, SocketSet},
phy::DeviceCapabilities,
};
use std::net::Ipv4Addr;
use std::{
mem,
sync::{Arc, LazyLock, atomic::AtomicBool},
@@ -38,8 +37,8 @@ impl Engine {
let (mut device, bridge_rx, bridge_tx, avail) = VirtTunDevice::new(caps);
let interface = Interface::new(config, &mut device, now);
let mut socket_set = ConnectionManager::setup_sockets(16, 4, 1);
let mut manager = ConnectionManager::new(ip);
let socket_set = ConnectionManager::setup_sockets(16, 4, 1);
let manager = ConnectionManager::new(ip);
Self {
interface,
socket_set,
@@ -104,13 +103,6 @@ impl Engine {
break;
}
if n >= 20 {
let dst_ip = std::net::Ipv4Addr::new(buf[16], buf[17], buf[18], buf[19]);
let dst_port = u16::from_be_bytes([buf[22], buf[23]]); // Порт для TCP
debug!("Сырой пакет: назначение {}:{}", dst_ip, dst_port);
}
let mut token = TokenBuffer::with_capacity(n);
token.extend_from_slice(&buf[..n]);