1#[derive(thiserror::Error, Debug)]
3pub enum Error {
4 #[error("{0}")]
6 Io(#[from] std::io::Error),
7 #[error("{0}")]
9 ParseError(#[from] std::string::ParseError),
10 #[error("Target address is invalid: {0}")]
13 InvalidTargetAddress(&'static str),
14 #[error("Proxy server unreachable")]
16 ProxyServerUnreachable,
17 #[error("Invalid response version")]
19 InvalidResponseVersion,
20 #[error("No acceptable auth methods")]
22 NoAcceptableAuthMethods,
23 #[error("Unknown auth method")]
25 UnknownAuthMethod,
26 #[error("General SOCKS server failure")]
28 GeneralSocksServerFailure,
29 #[error("Connection not allowed by ruleset")]
31 ConnectionNotAllowedByRuleset,
32 #[error("Network unreachable")]
34 NetworkUnreachable,
35 #[error("Host unreachable")]
37 HostUnreachable,
38 #[error("Connection refused")]
40 ConnectionRefused,
41 #[error("TTL expired")]
43 TtlExpired,
44 #[error("Command not supported")]
46 CommandNotSupported,
47 #[error("Address type not supported")]
49 AddressTypeNotSupported,
50 #[error("Unknown error")]
52 UnknownError,
53 #[error("Invalid reserved byte")]
55 InvalidReservedByte,
56 #[error("Unknown address type")]
58 UnknownAddressType,
59 #[error("Invalid auth values: {0}")]
61 InvalidAuthValues(&'static str),
62 #[error("Password auth failure, code: {0}")]
64 PasswordAuthFailure(u8),
65
66 #[error("Authorization required")]
67 AuthorizationRequired,
68
69 #[error("Request rejected because SOCKS server cannot connect to identd on the client")]
70 IdentdAuthFailure,
71
72 #[error("Request rejected because the client program and identd report different user-ids")]
73 InvalidUserIdAuthFailure,
74}
75
76