remove codec folder in nxrp
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use netrunner_core::nrxp::codec::socks::TargetAddress;
|
use netrunner_core::nrxp::socks::TargetAddress;
|
||||||
use netrunner_logger::{debug, error, info, trace, warn};
|
use netrunner_logger::{debug, error, info, trace, warn};
|
||||||
use smoltcp::{
|
use smoltcp::{
|
||||||
iface::{SocketHandle, SocketSet},
|
iface::{SocketHandle, SocketSet},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use crate::nrxp::codec::frame::FrameType;
|
|
||||||
use crate::net::connection::muxer::{MuxMessage, Muxer};
|
use crate::net::connection::muxer::{MuxMessage, Muxer};
|
||||||
use crate::net::network::NetworkConfig;
|
use crate::net::network::NetworkConfig;
|
||||||
|
use crate::nrxp::frame::FrameType;
|
||||||
use bytes::{Bytes, BytesMut};
|
use bytes::{Bytes, BytesMut};
|
||||||
use netrunner_logger::{debug, error};
|
use netrunner_logger::{debug, error};
|
||||||
use tokio::net::UdpSocket;
|
use tokio::net::UdpSocket;
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ use crate::{
|
|||||||
network::NetworkConfig,
|
network::NetworkConfig,
|
||||||
},
|
},
|
||||||
nrxp::{
|
nrxp::{
|
||||||
codec::{
|
|
||||||
codec::Codec,
|
codec::Codec,
|
||||||
|
errors::ErrorAction,
|
||||||
frame::FrameType,
|
frame::FrameType,
|
||||||
socks::{SocksReply, SocksRequest},
|
socks::{SocksReply, SocksRequest},
|
||||||
},
|
},
|
||||||
errors::ErrorAction,
|
|
||||||
},
|
|
||||||
parser::Parser,
|
parser::Parser,
|
||||||
tlseng::profile::BrowserProfile,
|
tlseng::profile::BrowserProfile,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,10 +11,7 @@ use tokio_util::sync::CancellationToken;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
net::connection::{handler::StreamHandler, muxer::MuxMessage},
|
net::connection::{handler::StreamHandler, muxer::MuxMessage},
|
||||||
nrxp::{
|
nrxp::{codec::Codec, errors::ErrorAction, frame::FrameType},
|
||||||
codec::{codec::Codec, frame::FrameType},
|
|
||||||
errors::ErrorAction,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct TunnelEngine {
|
pub struct TunnelEngine {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use crate::{
|
|||||||
},
|
},
|
||||||
network::NetworkConfig,
|
network::NetworkConfig,
|
||||||
},
|
},
|
||||||
nrxp::codec::{
|
nrxp::{
|
||||||
frame::{Frame, FrameType},
|
frame::{Frame, FrameType},
|
||||||
socks::SocksReply,
|
socks::SocksReply,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
pub mod bridge;
|
mod bridge;
|
||||||
pub mod connection;
|
pub mod connection;
|
||||||
pub mod engine;
|
pub mod engine;
|
||||||
pub mod handler;
|
pub mod handler;
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
use crate::nrxp::codec::frame::FrameType;
|
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use dashmap::DashMap;
|
use dashmap::DashMap;
|
||||||
use std::sync::atomic::{AtomicU32, Ordering};
|
use std::sync::atomic::{AtomicU32, Ordering};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::mpsc::{error::SendError, Sender};
|
use tokio::sync::mpsc::{error::SendError, Sender};
|
||||||
|
|
||||||
|
use crate::nrxp::frame::FrameType;
|
||||||
|
|
||||||
pub struct IdGenerator {
|
pub struct IdGenerator {
|
||||||
counter: AtomicU32,
|
counter: AtomicU32,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
nrxp::codec::{frame::FRAME_HEADER_SIZE, MAX_PADDING_SIZE},
|
|
||||||
net::connection::connection::{
|
net::connection::connection::{
|
||||||
ClientHandler, Connection, ConnectionRole, ServerHandler, TunnelHandler,
|
ClientHandler, Connection, ConnectionRole, ServerHandler, TunnelHandler,
|
||||||
},
|
},
|
||||||
|
nrxp::frame::{FRAME_HEADER_SIZE, MAX_PADDING_SIZE},
|
||||||
};
|
};
|
||||||
use netrunner_logger::{error, info};
|
use netrunner_logger::{error, info};
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ use bytes::{Bytes, BytesMut};
|
|||||||
use crate::crypto::aead::AeadPacker;
|
use crate::crypto::aead::AeadPacker;
|
||||||
use crate::crypto::chacha::ChaChaCipher;
|
use crate::crypto::chacha::ChaChaCipher;
|
||||||
use crate::crypto::session::SessionKeys;
|
use crate::crypto::session::SessionKeys;
|
||||||
use crate::nrxp::codec::bridge::TlsBridge;
|
use crate::nrxp::bridge::TlsBridge;
|
||||||
use crate::nrxp::codec::frame::{Frame, FrameHeader, FrameType, Padding};
|
|
||||||
use crate::nrxp::errors::{ErrorAction, ErrorStage, TlsError};
|
use crate::nrxp::errors::{ErrorAction, ErrorStage, TlsError};
|
||||||
|
use crate::nrxp::frame::{Frame, FrameHeader, FrameType, Padding};
|
||||||
use crate::parser::Parser;
|
use crate::parser::Parser;
|
||||||
use crate::tlseng::profile::{BrowserProfile, ServerProfile};
|
use crate::tlseng::profile::{BrowserProfile, ServerProfile};
|
||||||
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
mod bridge;
|
|
||||||
pub mod codec;
|
|
||||||
pub mod frame;
|
|
||||||
pub mod socks;
|
|
||||||
|
|
||||||
pub const MAX_PADDING_SIZE: u32 = 255;
|
|
||||||
@@ -2,13 +2,15 @@ use bytes::{Buf, BufMut, Bytes, BytesMut};
|
|||||||
|
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
|
|
||||||
use crate::{nrxp::codec::MAX_PADDING_SIZE, parser::Parser};
|
use crate::parser::Parser;
|
||||||
|
|
||||||
pub struct Padding {
|
pub struct Padding {
|
||||||
pub len: u16,
|
pub len: u16,
|
||||||
pub data: Bytes,
|
pub data: Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const MAX_PADDING_SIZE: u32 = 255;
|
||||||
|
|
||||||
impl Padding {
|
impl Padding {
|
||||||
pub fn generate_padding() -> Padding {
|
pub fn generate_padding() -> Padding {
|
||||||
let mut rng = rand::rng();
|
let mut rng = rand::rng();
|
||||||
@@ -1,2 +1,5 @@
|
|||||||
|
mod bridge;
|
||||||
pub mod codec;
|
pub mod codec;
|
||||||
pub mod errors;
|
pub mod errors;
|
||||||
|
pub mod frame;
|
||||||
|
pub mod socks;
|
||||||
|
|||||||
Reference in New Issue
Block a user