aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gns_proxy_proto.h
diff options
context:
space:
mode:
authorBertrand Marc <beberking@gmail.com>2012-06-06 20:47:48 +0200
committerBertrand Marc <beberking@gmail.com>2012-06-06 20:47:48 +0200
commit740b30688bd745a527f96f9116c19acb3480971a (patch)
tree2709a3f4dba11c174aa9e1ba3612e30c578e76a9 /src/gns/gns_proxy_proto.h
parent2b81464a43485fcc8ce079fafdee7b7a171835f4 (diff)
Imported Upstream version 0.9.3upstream/0.9.3
Diffstat (limited to 'src/gns/gns_proxy_proto.h')
-rw-r--r--src/gns/gns_proxy_proto.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/gns/gns_proxy_proto.h b/src/gns/gns_proxy_proto.h
new file mode 100644
index 0000000..ef30d5c
--- /dev/null
+++ b/src/gns/gns_proxy_proto.h
@@ -0,0 +1,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];
+};