diff options
author | Roger Dingledine <arma@torproject.org> | 2007-10-28 08:16:19 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-10-28 08:16:19 +0000 |
commit | e5885deab578188582052c6885ffe0b59cba6151 (patch) | |
tree | 9412d741665ecc6fc34c20fc3864138f877e255f /src/or/or.h | |
parent | 2dea44181b20a2fe6a5b7a9b7267f17365e8fa3c (diff) | |
download | tor-e5885deab578188582052c6885ffe0b59cba6151.tar tor-e5885deab578188582052c6885ffe0b59cba6151.tar.gz |
Separate "SOCKS_COMMAND_CONNECT_DIR" into two flags in
edge_connection_t: want_onehop if it must attach to a circuit with
only one hop (e.g. for the current tunnelled connections that use
begin_dir), and use_begindir if we mean to use a BEGIN_DIR relay
command to establish the stream rather than the normal BEGIN. Now
we can make anonymized begin_dir connections for (e.g.) more secure
hidden service posting and fetching.
svn:r12244
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/or/or.h b/src/or/or.h index 344745d8e..e151a678c 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -910,6 +910,12 @@ typedef struct edge_connection_t { /** True iff this connection is for a dns request only. */ unsigned int is_dns_request : 1; + /** True iff this stream wants a one-hop circuit (e.g. for begin_dir). */ + int want_onehop:1; + /** True iff this stream should use a begin_dir connection (either via + * onehop or via a whole circuit). */ + int use_begindir:1; + /** If this is a DNSPort connection, this field holds the pending DNS * request that we're going to try to answer. */ struct evdns_server_request *dns_server_request; @@ -2212,13 +2218,7 @@ static INLINE void or_state_mark_dirty(or_state_t *state, time_t when) /** Please turn this IP address into an FQDN, privately. */ #define SOCKS_COMMAND_RESOLVE_PTR 0xF1 -/** Please open an encrypted direct TCP connection to the directory port - * of the Tor server specified by address:port. (In this case address:port - * specifies the ORPort of the server.) */ -#define SOCKS_COMMAND_CONNECT_DIR 0xF2 - -#define SOCKS_COMMAND_IS_CONNECT(c) ((c)==SOCKS_COMMAND_CONNECT || \ - (c)==SOCKS_COMMAND_CONNECT_DIR) +#define SOCKS_COMMAND_IS_CONNECT(c) ((c)==SOCKS_COMMAND_CONNECT) #define SOCKS_COMMAND_IS_RESOLVE(c) ((c)==SOCKS_COMMAND_RESOLVE || \ (c)==SOCKS_COMMAND_RESOLVE_PTR) @@ -2583,7 +2583,8 @@ int connection_ap_handshake_send_begin(edge_connection_t *ap_conn); int connection_ap_handshake_send_resolve(edge_connection_t *ap_conn); edge_connection_t *connection_ap_make_link(char *address, uint16_t port, - const char *digest, int command); + const char *digest, + int use_begindir, int want_onehop); void connection_ap_handshake_socks_reply(edge_connection_t *conn, char *reply, size_t replylen, int endreason); |