diff options
author | Roger Dingledine <arma@torproject.org> | 2002-09-22 11:09:07 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-09-22 11:09:07 +0000 |
commit | 155c9b80cadc18715697dc24164dbdfc47b3cf77 (patch) | |
tree | cc2364cc0664ab237168781e97018720b89a0859 /src/or/or.h | |
parent | 8d1aa27c462848b5111b874a51469761ca659f0d (diff) | |
download | tor-155c9b80cadc18715697dc24164dbdfc47b3cf77.tar tor-155c9b80cadc18715697dc24164dbdfc47b3cf77.tar.gz |
onion proxy now speaks socks4a
httpap is obsolete; we support privoxy directly now!
smtpap is obsolete; need to find a good socks4a-enabled smtp proxy/client
I dub thee 0.0.1.
svn:r107
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/src/or/or.h b/src/or/or.h index 316a6b8e2..7bfba7246 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -46,7 +46,7 @@ can be overridden by config file */ #define MAX_BUF_SIZE (640*1024) -#define DEFAULT_BANDWIDTH_OP 1024 +#define DEFAULT_BANDWIDTH_OP 102400 #define ACI_TYPE_LOWER 0 #define ACI_TYPE_HIGHER 1 @@ -100,7 +100,7 @@ #define EXIT_CONN_STATE_CLOSE_WAIT 4 /* have sent a destroy, awaiting a confirmation */ #endif -#define AP_CONN_STATE_SS_WAIT 0 +#define AP_CONN_STATE_SOCKS_WAIT 0 #define AP_CONN_STATE_OR_WAIT 1 #define AP_CONN_STATE_OPEN 2 @@ -147,6 +147,21 @@ typedef struct unsigned char payload[120]; } cell_t; +#define SOCKS4_REQUEST_GRANTED 90 +#define SOCKS4_REQUEST_REJECT 91 +#define SOCKS4_REQUEST_IDENT_FAILED 92 +#define SOCKS4_REQUEST_IDENT_CONFLICT 93 + +/* structure of a socks client operation */ +typedef struct { + unsigned char version; /* socks version number */ + unsigned char command; /* command code */ + unsigned char destport[2]; /* destination port, network order */ + unsigned char destip[4]; /* destination address */ + /* userid follows, terminated by a NULL */ + /* dest host follows, terminated by a NULL */ +} socks4_t; + typedef struct { @@ -190,12 +205,14 @@ typedef struct /* used by exit and ap: */ - ss_t ss; /* standard structure */ - int ss_received; /* size of ss, received so far */ +// ss_t ss; /* standard structure */ +// int ss_received; /* size of ss, received so far */ + + char socks_version; + char read_username; - char *dest_addr, *dest_port; - uint16_t dest_addr_len, dest_port_len; - uint16_t dest_addr_received, dest_port_received; + char *dest_addr; + uint16_t dest_port; /* used by OR, to keep state while connect()ing: Kludge. */ @@ -460,7 +477,7 @@ int connection_finished_flushing(connection_t *conn); int connection_ap_process_inbuf(connection_t *conn); -int ap_handshake_process_ss(connection_t *conn); +int ap_handshake_process_socks(connection_t *conn); int ap_handshake_create_onion(connection_t *conn); @@ -472,6 +489,7 @@ int ap_handshake_n_conn_open(connection_t *or_conn); int ap_handshake_send_onion(connection_t *ap_conn, connection_t *or_conn, circuit_t *circ); +int ap_handshake_socks_reply(connection_t *conn, char result); int connection_ap_send_connected(connection_t *conn); int connection_ap_process_data_cell(cell_t *cell, connection_t *conn); |