summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-12-13 00:28:56 +0000
committerRoger Dingledine <arma@torproject.org>2006-12-13 00:28:56 +0000
commit0dbf725927c0b3a7f88b852b272573c91857be9b (patch)
treebea851e8726f18a8b463f950bfc1694ae6be6aa2 /src/or/or.h
parentf5164ba61d8cf062bbc1beb2dfbca0abb3415e93 (diff)
downloadtor-0dbf725927c0b3a7f88b852b272573c91857be9b.tar.gz
tor-0dbf725927c0b3a7f88b852b272573c91857be9b.zip
Infrastructure to test BEGIN_DIR cells.
New socks command CONNECT_DIR. New config option TunnelDirConns that builds a circ ending at the directory server and delivers a BEGIN_DIR cell if it's running 0.1.2.2-alpha or later. We still need to make one-hop circs when appropriate, while making other conns avoid them. svn:r9098
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 30a9992cf5..c6bcc18bc2 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1648,8 +1648,10 @@ typedef struct {
char *ServerDNSResolvConfFile; /**< If provided, we configure our internal
* resolver from the file here rather than from
* /etc/resolv.conf (Unix) or the registry (Windows). */
- int EnforceDistinctSubnets; /** If true, don't allow multiple routers in the
+ int EnforceDistinctSubnets; /**< If true, don't allow multiple routers in the
* same network zone in the same circuit. */
+ int TunnelDirConns; /**< If true, use BEGIN_DIR rather than BEGIN when
+ * possible. */
} or_options_t;
/** Persistent state for an onion router, as saved to disk. */
@@ -1705,17 +1707,21 @@ static INLINE void or_state_mark_dirty(or_state_t *state, time_t when)
#define MAX_SOCKS_REPLY_LEN 1024
#define MAX_SOCKS_ADDR_LEN 256
+
#define SOCKS_COMMAND_CONNECT 0x01
+#define SOCKS_COMMAND_CONNECT_DIR 0xE0
#define SOCKS_COMMAND_RESOLVE 0xF0
#define SOCKS_COMMAND_RESOLVE_PTR 0xF1
+#define SOCKS_COMMAND_IS_CONNECT(c) ((c)==SOCKS_COMMAND_CONNECT || \
+ (c)==SOCKS_COMMAND_CONNECT_DIR)
#define SOCKS_COMMAND_IS_RESOLVE(c) ((c)==SOCKS_COMMAND_RESOLVE || \
(c)==SOCKS_COMMAND_RESOLVE_PTR)
/** State of a SOCKS request from a user to an OP */
struct socks_request_t {
char socks_version; /**< Which version of SOCKS did the client use? */
- int command; /**< What has the user requested? One of CONNECT or RESOLVE. */
+ int command; /**< What has the user requested? One from the above list. */
size_t replylen; /**< Length of <b>reply</b>. */
char reply[MAX_SOCKS_REPLY_LEN]; /**< Write an entry into this string if
* we want to specify our own socks reply,
@@ -2017,7 +2023,8 @@ int connection_ap_handshake_send_begin(edge_connection_t *ap_conn,
int connection_ap_handshake_send_resolve(edge_connection_t *ap_conn,
origin_circuit_t *circ);
-int connection_ap_make_bridge(char *address, uint16_t port);
+int connection_ap_make_bridge(char *address, uint16_t port,
+ const char *digest, int command);
void connection_ap_handshake_socks_reply(edge_connection_t *conn, char *reply,
size_t replylen,
int endreason);