Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Oct 1, 2024
1 parent 00dc334 commit 2a780ba
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#[cfg(feature = "tokio")]
pub mod client;
pub mod error;
pub(crate) mod error;
pub mod protocol;
#[cfg(feature = "tokio")]
pub mod server;
Expand Down
3 changes: 2 additions & 1 deletion src/protocol/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ use std::{
#[cfg(feature = "tokio")]
use tokio::io::{AsyncRead, AsyncReadExt};

#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Default)]
#[repr(u8)]
pub enum AddressType {
#[default]
IPv4 = 0x01,
Domain = 0x03,
IPv6 = 0x04,
Expand Down
3 changes: 2 additions & 1 deletion src/protocol/handshake/auth_method.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/// A proxy authentication method.
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Default)]
pub enum AuthMethod {
/// No authentication required.
#[default]
NoAuth = 0x00,
/// GSS API.
GssApi = 0x01,
Expand Down
3 changes: 2 additions & 1 deletion src/protocol/handshake/password_method/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ use async_trait::async_trait;
use tokio::io::{AsyncRead, AsyncReadExt};

#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Default)]
pub enum Status {
#[default]
Succeeded = 0x00,
Failed = 0xff,
}
Expand Down
3 changes: 2 additions & 1 deletion src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt};

/// SOCKS protocol version, either 4 or 5
#[repr(u8)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Default)]
pub enum Version {
V4 = 4,
#[default]
V5 = 5,
}

Expand Down
3 changes: 2 additions & 1 deletion src/protocol/reply.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Default)]
pub enum Reply {
#[default]
Succeeded = 0x00,
GeneralFailure = 0x01,
ConnectionNotAllowed = 0x02,
Expand Down

0 comments on commit 2a780ba

Please sign in to comment.