aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gns_proxy_proto.h
diff options
context:
space:
mode:
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];
+};