/*****************************************************************************/
/*
                                 ProxySocks.h

10-MAR-2021  MGD  initial
*/
/*****************************************************************************/

#ifndef PROXYSOCKS_H_LOADED
#define PROXYSOCKS_H_LOADED 1

#include "proxystruct.h"

#define SOCKS5_VERSION         5
#define SOCKS5_RESERVED        0

#define SOCKS5_AUTH_NONE       0
#define SOCKS5_AUTH_GSSAPI     1
#define SOCKS5_AUTH_USERPASS   2
#define SOCKS5_AUTH_OK         0
#define SOCKS5_AUTH_NOTOK      0xff
#define SOCKS5_AUTH_BASIC_VERSION 0x01

#define SOCKS5_CMD_CONNECT     1
#define SOCKS5_CMD_BIND        2
#define SOCKS5_CMD_UDPASSOC    3

#define SOCKS5_ATYPE_IPV4      1
#define SOCKS5_ATYPE_DOMAIN    3
#define SOCKS5_ATYPE_IPV6      4

#define SOCKS5_REPLY_SUCCESS   0
#define SOCKS5_REPLY_FAILURE   1
#define SOCKS5_REPLY_RULESET   2
#define SOCKS5_REPLY_NETREACH  3
#define SOCKS5_REPLY_HOSTREACH 4
#define SOCKS5_REPLY_REFUSED   5
#define SOCKS5_REPLY_TTLEXPIRE 6
#define SOCKS5_REPLY_COMMAND   7
#define SOCKS5_REPLY_ADDRESS   8

/***********************/
/* function prototypes */
/***********************/

void ProxySocks4 (REQUEST_STRUCT*);
void ProxySocks5 (REQUEST_STRUCT*);
void ProxySocks5BasicAst (REQUEST_STRUCT*);
void ProxySocks5End (REQUEST_STRUCT*);
void ProxySocks5GetRequest (REQUEST_STRUCT*);
void ProxySocks5Reply (REQUEST_STRUCT*, int);
void ProxySocks5ReplyFail (REQUEST_STRUCT*);
void ProxySocks5RequestAst (REQUEST_STRUCT*);

#endif /* PROXYSOCKS_H_LOADED */

/*****************************************************************************/

