From 16278dae62b7c5f575a0fc038f22140e749ce105 Mon Sep 17 00:00:00 2001 From: lbl8603 <49143209+lbl8603@users.noreply.github.com> Date: Sun, 9 Jun 2024 00:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnt-cli/src/callback.rs | 5 +++-- vnt/src/channel/mod.rs | 4 ++-- vnt/src/handle/handshaker.rs | 7 ------- vnt/src/lib.rs | 12 ++++++------ 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/vnt-cli/src/callback.rs b/vnt-cli/src/callback.rs index 7ac67c7..4aed239 100644 --- a/vnt-cli/src/callback.rs +++ b/vnt-cli/src/callback.rs @@ -2,8 +2,9 @@ use std::process; use console::style; -use vnt::handle::callback::{ConnectInfo, ErrorType}; -use vnt::{DeviceInfo, ErrorInfo, HandshakeInfo, RegisterInfo, VntCallback}; +use vnt::{ + ConnectInfo, DeviceInfo, ErrorInfo, ErrorType, HandshakeInfo, RegisterInfo, VntCallback, +}; #[derive(Clone)] pub struct VntHandler {} diff --git a/vnt/src/channel/mod.rs b/vnt/src/channel/mod.rs index 7536edb..e8bb276 100644 --- a/vnt/src/channel/mod.rs +++ b/vnt/src/channel/mod.rs @@ -138,7 +138,7 @@ impl RouteKey { } } -pub fn init_context( +pub(crate) fn init_context( ports: Vec, use_channel_type: UseChannelType, first_latency: bool, @@ -233,7 +233,7 @@ pub fn init_context( Ok((context, tcp_listener)) } -pub fn init_channel( +pub(crate) fn init_channel( tcp_listener: mio::net::TcpListener, context: ChannelContext, stop_manager: StopManager, diff --git a/vnt/src/handle/handshaker.rs b/vnt/src/handle/handshaker.rs index 9ee3493..9a1eb3d 100644 --- a/vnt/src/handle/handshaker.rs +++ b/vnt/src/handle/handshaker.rs @@ -19,13 +19,6 @@ use crate::proto::message::SecretHandshakeRequest; use crate::protocol::body::RSA_ENCRYPTION_RESERVED; use crate::protocol::{service_packet, NetPacket, Protocol, MAX_TTL}; -pub enum HandshakeEnum { - NotSecret, - KeyError, - Timeout, - ServerError(String), - Other(String), -} #[derive(Clone)] pub struct Handshake { time: Arc>, diff --git a/vnt/src/lib.rs b/vnt/src/lib.rs index d0b5669..f085cfc 100644 --- a/vnt/src/lib.rs +++ b/vnt/src/lib.rs @@ -3,16 +3,16 @@ pub const VNT_VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub mod channel; pub mod cipher; pub mod core; -pub mod external_route; -pub mod handle; +mod external_route; +mod handle; #[cfg(feature = "ip_proxy")] -pub mod ip_proxy; +mod ip_proxy; pub mod nat; #[cfg(feature = "port_mapping")] -pub mod port_mapping; -pub mod proto; +mod port_mapping; +mod proto; pub mod protocol; -pub mod tun_tap_device; +mod tun_tap_device; pub mod util; pub use handle::callback::*;