aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gns_proxy_proto.h
blob: ef30d5c034bf4a8af2c012fd6579ca16aba5649e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#define SOCKS_VERSION_5 0x05
#define SOCKS_AUTH_NONE 0

/* The socks phases */
enum
{
  SOCKS5_INIT,
  SOCKS5_REQUEST,
  SOCKS5_DATA_TRANSFER
};

/* Client hello */
struct socks5_client_hello
{
  uint8_t version;
  uint8_t num_auth_methods;
  char* auth_methods;
};

/* Client socks request */
struct socks5_client_request
{
  uint8_t version;
  uint8_t command;
  uint8_t resvd;
  uint8_t addr_type;
  /* 
   * followed by either an ip4/ipv6 address
   * or a domain name with a length field in front
   */
};

/* Server hello */
struct socks5_server_hello
{
  uint8_t version;
  uint8_t auth_method;
};

/* Server response to client requests */
struct socks5_server_response
{
  uint8_t version;
  uint8_t reply;
  uint8_t reserved;
  uint8_t addr_type;
  uint8_t add_port[18];
};