mirror of
https://github.com/bolucat/Archive.git
synced 2025-10-07 17:12:03 +08:00
Update On Tue Aug 6 20:32:53 CEST 2024
This commit is contained in:
@@ -20,8 +20,7 @@ use hickory_resolver::{
|
||||
udp::{DnsUdpSocket, QuicLocalAddr},
|
||||
TokioTime,
|
||||
},
|
||||
AsyncResolver,
|
||||
TokioHandle,
|
||||
AsyncResolver, TokioHandle,
|
||||
};
|
||||
use log::trace;
|
||||
use tokio::{io::ReadBuf, net::UdpSocket};
|
||||
|
@@ -8,16 +8,8 @@ use super::{
|
||||
datagram::ManagerDatagram,
|
||||
error::Error,
|
||||
protocol::{
|
||||
AddRequest,
|
||||
AddResponse,
|
||||
ListRequest,
|
||||
ListResponse,
|
||||
ManagerProtocol,
|
||||
PingRequest,
|
||||
PingResponse,
|
||||
RemoveRequest,
|
||||
RemoveResponse,
|
||||
StatRequest,
|
||||
AddRequest, AddResponse, ListRequest, ListResponse, ManagerProtocol, PingRequest, PingResponse, RemoveRequest,
|
||||
RemoveResponse, StatRequest,
|
||||
},
|
||||
};
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
use std::{
|
||||
io,
|
||||
mem,
|
||||
io, mem,
|
||||
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr},
|
||||
os::unix::io::{AsRawFd, RawFd},
|
||||
pin::Pin,
|
||||
@@ -21,9 +20,7 @@ use tokio_tfo::TfoStream;
|
||||
use crate::net::{
|
||||
sys::{set_common_sockopt_after_connect, set_common_sockopt_for_connect, socket_bind_dual_stack},
|
||||
udp::{BatchRecvMessage, BatchSendMessage},
|
||||
AcceptOpts,
|
||||
AddrFamily,
|
||||
ConnectOpts,
|
||||
AcceptOpts, AddrFamily, ConnectOpts,
|
||||
};
|
||||
|
||||
/// A `TcpStream` that supports TFO (TCP Fast Open)
|
||||
|
@@ -24,9 +24,7 @@ use tokio_tfo::TfoStream;
|
||||
use crate::net::{
|
||||
sys::{set_common_sockopt_after_connect, set_common_sockopt_for_connect, socket_bind_dual_stack},
|
||||
udp::{BatchRecvMessage, BatchSendMessage},
|
||||
AcceptOpts,
|
||||
AddrFamily,
|
||||
ConnectOpts,
|
||||
AcceptOpts, AddrFamily, ConnectOpts,
|
||||
};
|
||||
|
||||
/// A `TcpStream` that supports TFO (TCP Fast Open)
|
||||
|
@@ -1,6 +1,5 @@
|
||||
use std::{
|
||||
io,
|
||||
mem,
|
||||
io, mem,
|
||||
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr},
|
||||
os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd},
|
||||
pin::Pin,
|
||||
@@ -22,9 +21,7 @@ use tokio_tfo::TfoStream;
|
||||
use crate::net::{
|
||||
sys::{set_common_sockopt_after_connect, set_common_sockopt_for_connect, socket_bind_dual_stack},
|
||||
udp::{BatchRecvMessage, BatchSendMessage},
|
||||
AcceptOpts,
|
||||
AddrFamily,
|
||||
ConnectOpts,
|
||||
AcceptOpts, AddrFamily, ConnectOpts,
|
||||
};
|
||||
|
||||
/// A `TcpStream` that supports TFO (TCP Fast Open)
|
||||
|
@@ -15,9 +15,7 @@ use tokio::{
|
||||
|
||||
use crate::net::{
|
||||
sys::{set_common_sockopt_after_connect, set_common_sockopt_for_connect, ErrorKind},
|
||||
AcceptOpts,
|
||||
AddrFamily,
|
||||
ConnectOpts,
|
||||
AcceptOpts, AddrFamily, ConnectOpts,
|
||||
};
|
||||
|
||||
/// A wrapper of `TcpStream`
|
||||
|
@@ -10,8 +10,7 @@ use std::{
|
||||
io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket},
|
||||
},
|
||||
pin::Pin,
|
||||
ptr,
|
||||
slice,
|
||||
ptr, slice,
|
||||
task::{self, Poll},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
@@ -30,32 +29,13 @@ use windows_sys::{
|
||||
Win32::{
|
||||
Foundation::{BOOL, ERROR_BUFFER_OVERFLOW, ERROR_NO_DATA, ERROR_SUCCESS},
|
||||
NetworkManagement::IpHelper::{
|
||||
if_nametoindex,
|
||||
GetAdaptersAddresses,
|
||||
GAA_FLAG_SKIP_ANYCAST,
|
||||
GAA_FLAG_SKIP_DNS_SERVER,
|
||||
GAA_FLAG_SKIP_MULTICAST,
|
||||
GAA_FLAG_SKIP_UNICAST,
|
||||
IP_ADAPTER_ADDRESSES_LH,
|
||||
if_nametoindex, GetAdaptersAddresses, GAA_FLAG_SKIP_ANYCAST, GAA_FLAG_SKIP_DNS_SERVER,
|
||||
GAA_FLAG_SKIP_MULTICAST, GAA_FLAG_SKIP_UNICAST, IP_ADAPTER_ADDRESSES_LH,
|
||||
},
|
||||
Networking::WinSock::{
|
||||
htonl,
|
||||
setsockopt,
|
||||
WSAGetLastError,
|
||||
WSAIoctl,
|
||||
AF_UNSPEC,
|
||||
IPPROTO_IP,
|
||||
IPPROTO_IPV6,
|
||||
IPPROTO_TCP,
|
||||
IPV6_MTU_DISCOVER,
|
||||
IPV6_UNICAST_IF,
|
||||
IP_MTU_DISCOVER,
|
||||
IP_PMTUDISC_DO,
|
||||
IP_UNICAST_IF,
|
||||
SIO_UDP_CONNRESET,
|
||||
SOCKET,
|
||||
SOCKET_ERROR,
|
||||
TCP_FASTOPEN,
|
||||
htonl, setsockopt, WSAGetLastError, WSAIoctl, AF_UNSPEC, IPPROTO_IP, IPPROTO_IPV6, IPPROTO_TCP,
|
||||
IPV6_MTU_DISCOVER, IPV6_UNICAST_IF, IP_MTU_DISCOVER, IP_PMTUDISC_DO, IP_UNICAST_IF, SIO_UDP_CONNRESET,
|
||||
SOCKET, SOCKET_ERROR, TCP_FASTOPEN,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -66,9 +46,7 @@ const FALSE: BOOL = 0;
|
||||
use crate::net::{
|
||||
is_dual_stack_addr,
|
||||
sys::{set_common_sockopt_for_connect, socket_bind_dual_stack},
|
||||
AcceptOpts,
|
||||
AddrFamily,
|
||||
ConnectOpts,
|
||||
AcceptOpts, AddrFamily, ConnectOpts,
|
||||
};
|
||||
|
||||
/// A `TcpStream` that supports TFO (TCP Fast Open)
|
||||
|
@@ -24,14 +24,10 @@ use crate::{context::Context, relay::socks5::Address, ServerAddr};
|
||||
use super::{
|
||||
is_dual_stack_addr,
|
||||
sys::{
|
||||
create_inbound_tcp_socket,
|
||||
set_common_sockopt_after_accept,
|
||||
set_tcp_fastopen,
|
||||
socket_bind_dual_stack,
|
||||
create_inbound_tcp_socket, set_common_sockopt_after_accept, set_tcp_fastopen, socket_bind_dual_stack,
|
||||
TcpStream as SysTcpStream,
|
||||
},
|
||||
AcceptOpts,
|
||||
ConnectOpts,
|
||||
AcceptOpts, ConnectOpts,
|
||||
};
|
||||
|
||||
/// TcpStream for outbound connections
|
||||
|
@@ -39,9 +39,7 @@ use crate::{context::Context, relay::socks5::Address, ServerAddr};
|
||||
|
||||
use super::{
|
||||
sys::{bind_outbound_udp_socket, create_inbound_udp_socket, create_outbound_udp_socket},
|
||||
AcceptOpts,
|
||||
AddrFamily,
|
||||
ConnectOpts,
|
||||
AcceptOpts, AddrFamily, ConnectOpts,
|
||||
};
|
||||
|
||||
/// Message struct for `batch_send`
|
||||
|
@@ -16,10 +16,7 @@ use bytes::{Buf, BufMut, BytesMut};
|
||||
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
|
||||
|
||||
pub use self::consts::{
|
||||
SOCKS5_AUTH_METHOD_GSSAPI,
|
||||
SOCKS5_AUTH_METHOD_NONE,
|
||||
SOCKS5_AUTH_METHOD_NOT_ACCEPTABLE,
|
||||
SOCKS5_AUTH_METHOD_PASSWORD,
|
||||
SOCKS5_AUTH_METHOD_GSSAPI, SOCKS5_AUTH_METHOD_NONE, SOCKS5_AUTH_METHOD_NOT_ACCEPTABLE, SOCKS5_AUTH_METHOD_PASSWORD,
|
||||
};
|
||||
|
||||
#[rustfmt::skip]
|
||||
|
@@ -55,9 +55,7 @@ use std::{
|
||||
|
||||
use aes::{
|
||||
cipher::{BlockDecrypt, BlockEncrypt, KeyInit},
|
||||
Aes128,
|
||||
Aes256,
|
||||
Block,
|
||||
Aes128, Aes256, Block,
|
||||
};
|
||||
use byte_string::ByteStr;
|
||||
use bytes::{Buf, BufMut, Bytes, BytesMut};
|
||||
|
@@ -58,9 +58,7 @@ use std::{
|
||||
|
||||
use aes::{
|
||||
cipher::{BlockDecrypt, BlockEncrypt, KeyInit},
|
||||
Aes128,
|
||||
Aes256,
|
||||
Block,
|
||||
Aes128, Aes256, Block,
|
||||
};
|
||||
use byte_string::ByteStr;
|
||||
use bytes::{Buf, BufMut, Bytes, BytesMut};
|
||||
|
@@ -32,9 +32,7 @@ use crate::{
|
||||
|
||||
#[cfg(feature = "aead-cipher-2022")]
|
||||
use super::aead_2022::{
|
||||
decrypt_client_payload_aead_2022,
|
||||
decrypt_server_payload_aead_2022,
|
||||
encrypt_client_payload_aead_2022,
|
||||
decrypt_client_payload_aead_2022, decrypt_server_payload_aead_2022, encrypt_client_payload_aead_2022,
|
||||
encrypt_server_payload_aead_2022,
|
||||
};
|
||||
#[cfg(feature = "stream-cipher")]
|
||||
|
@@ -23,11 +23,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use super::crypto_io::{
|
||||
decrypt_client_payload,
|
||||
decrypt_server_payload,
|
||||
encrypt_client_payload,
|
||||
encrypt_server_payload,
|
||||
ProtocolError,
|
||||
decrypt_client_payload, decrypt_server_payload, encrypt_client_payload, encrypt_server_payload, ProtocolError,
|
||||
ProtocolResult,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user