socks5_protocol_async/protocol/
constant.rs

1pub mod protocol_version {
2    pub type ProtocolVersion = u8;
3
4    pub const SOCKS5: ProtocolVersion = 5;
5}
6
7pub mod auth_method {
8    pub type AuthMethod = u8;
9
10    pub const NO_AUTHENTICATION_REQUIRED: AuthMethod = 0x00;
11    pub const GSSAPI: AuthMethod = 0x01;
12    pub const USERNAME_PASSWORD: AuthMethod = 0x02;
13    pub const NO_ACCEPTABLE_METHODS: AuthMethod = 0xFF;
14
15}
16
17pub mod command_type {
18    pub type CommandType = u8;
19
20    pub const CONNECT: CommandType = 0x01;
21    pub const BIND: CommandType = 0x02;
22    pub const UDP_ASSOCIATE: CommandType = 0x03;
23}
24
25pub mod address_type {
26    pub type AddressType = u8;
27
28    pub const IPV4: AddressType = 0x01;
29    pub const DOMAIN_NAME: AddressType = 0x03;
30    pub const IPV6: AddressType = 0x04;
31}
32
33pub mod reply_code {
34    pub type ReplyCode = u8;
35
36    pub const SUCCEEDED: ReplyCode = 0x00;
37    pub const GENERAL_SOCKS_SERVER_FAILURE: ReplyCode = 0x01;
38    pub const CONNECTION_NOT_ALLOWED_BY_RULESET: ReplyCode = 0x02;
39    pub const NETWORK_UNREACHABLE: ReplyCode = 0x03;
40    pub const HOST_UNREACHABLE: ReplyCode = 0x04;
41    pub const CONNECTION_REFUSED: ReplyCode = 0x05;
42    pub const TTL_EXPIRED: ReplyCode = 0x06;
43    pub const COMMAND_NOT_SUPPORTED: ReplyCode = 0x07;
44    pub const ADDRESS_TYPE_NOT_SUPPORTED: ReplyCode = 0x08;
45}