chore: anti pretendo people note and cleanup
This commit is contained in:
parent
4e83068662
commit
c698e0b3dd
25 changed files with 69 additions and 682 deletions
|
|
@ -2,17 +2,11 @@
|
|||
use rnex_core::reggie::UnitPacketRead;
|
||||
use rnex_core::reggie::UnitPacketWrite;
|
||||
use rnex_core::rmc::structures::RmcSerialize;
|
||||
use std::env;
|
||||
use std::ffi::CStr;
|
||||
use std::io::{Read, Write};
|
||||
use std::net::{Ipv4Addr, SocketAddrV4};
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use std::net::SocketAddrV4;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use log::{error, warn};
|
||||
use once_cell::sync::Lazy;
|
||||
use tokio::net::{TcpSocket, TcpStream};
|
||||
use tokio::sync::RwLock;
|
||||
use log::error;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::task;
|
||||
use tokio::time::sleep;
|
||||
use prudpv1::executables::common::{FORWARD_DESTINATION, EDGE_NODE_HOLDER};
|
||||
|
|
@ -110,4 +104,5 @@ async fn main() {
|
|||
}
|
||||
});
|
||||
}
|
||||
drop(conn);
|
||||
}
|
||||
|
|
@ -1,23 +1,16 @@
|
|||
use rnex_core::reggie::UnitPacketRead;
|
||||
use rnex_core::reggie::UnitPacketWrite;
|
||||
use rnex_core::rmc::structures::RmcSerialize;
|
||||
use std::env;
|
||||
use std::ffi::CStr;
|
||||
use std::io::{Read, Write};
|
||||
use std::net::{Ipv4Addr, SocketAddrV4};
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use std::net::SocketAddrV4;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use log::{error, warn};
|
||||
use once_cell::sync::Lazy;
|
||||
use tokio::net::{TcpSocket, TcpStream};
|
||||
use tokio::sync::RwLock;
|
||||
use log::error;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::task;
|
||||
use tokio::time::sleep;
|
||||
use prudpv1::executables::common::{FORWARD_DESTINATION, EDGE_NODE_HOLDER};
|
||||
use prudpv1::prudp::router::Router;
|
||||
use prudpv1::prudp::secure::Secure;
|
||||
use prudpv1::prudp::unsecure::Unsecure;
|
||||
use rnex_core::common::setup;
|
||||
use rnex_core::executables::common::{OWN_IP_PRIVATE, OWN_IP_PUBLIC, SECURE_SERVER_ACCOUNT, SERVER_PORT};
|
||||
use rnex_core::prudp::virtual_port::VirtualPort;
|
||||
|
|
@ -113,4 +106,6 @@ async fn main() {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
drop(conn);
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
use std::net::Ipv4Addr;
|
||||
|
||||
pub trait AuthModule{
|
||||
fn get_auth_key(addr: Ipv4Addr) -> [u8; 32];
|
||||
}
|
||||
}*/
|
||||
/*
|
||||
struct AuthServerAuthModule;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
use std::{env, io};
|
||||
use std::io;
|
||||
use std::io::Cursor;
|
||||
use std::marker::PhantomData;
|
||||
use tokio::net::UdpSocket;
|
||||
use std::net::{SocketAddr, SocketAddrV4};
|
||||
use std::net::SocketAddr::V4;
|
||||
use std::sync::{Arc, Weak};
|
||||
use std::sync::atomic::{AtomicBool};
|
||||
use std::time::Duration;
|
||||
use tokio::task::JoinHandle;
|
||||
use once_cell::sync::Lazy;
|
||||
use log::{error, info};
|
||||
use thiserror::Error;
|
||||
use tokio::select;
|
||||
|
|
@ -19,16 +17,11 @@ use crate::prudp::packet::{PRUDPV1Packet};
|
|||
use rnex_core::prudp::virtual_port::VirtualPort;
|
||||
use crate::prudp::router::Error::VirtualPortTaken;
|
||||
|
||||
static SERVER_DATAGRAMS: Lazy<u8> = Lazy::new(||{
|
||||
env::var("SERVER_DATAGRAM_COUNT").ok()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.unwrap_or(1)
|
||||
});
|
||||
|
||||
|
||||
pub struct Router {
|
||||
endpoints: RwLock<[Option<Arc<dyn AnyInternalSocket>>; 16]>,
|
||||
running: AtomicBool,
|
||||
//running: AtomicBool,
|
||||
socket: Arc<UdpSocket>,
|
||||
_no_outside_construction: PhantomData<()>
|
||||
}
|
||||
|
|
@ -114,7 +107,7 @@ impl Router {
|
|||
|
||||
let own_impl = Router {
|
||||
endpoints: Default::default(),
|
||||
running: AtomicBool::new(true),
|
||||
// running: AtomicBool::new(true),
|
||||
socket: socket.clone(),
|
||||
_no_outside_construction: Default::default()
|
||||
};
|
||||
|
|
|
|||
|
|
@ -679,7 +679,7 @@ impl<T: CryptoHandler> AnyInternalSocket for InternalSocket<T> {
|
|||
|
||||
self.send_packet_unbuffered(address, packet).await;
|
||||
|
||||
let Some(connect_ack_packet) = recv.recv().await else {
|
||||
let Some(_connect_ack_packet) = recv.recv().await else {
|
||||
error!("what");
|
||||
return None;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ impl CryptoHandlerConnectionInstance for UnsecureInstance {
|
|||
packet.calculate_and_assign_signature(self.key, None, Some(self.self_signature));
|
||||
}
|
||||
|
||||
fn verify_packet(&self, packet: &PRUDPV1Packet) -> bool {
|
||||
fn verify_packet(&self, _packet: &PRUDPV1Packet) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue