diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-10-03 18:58:40 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-10-03 18:58:40 +0000 |
commit | 6e0b90a90276e90b8a0d7b5c683f4dc5d29fd33f (patch) | |
tree | cbbb20e7a573c31fde6b3251b14f0c2b2481c660 /src/or/or.h | |
parent | 246fecb585cef56af5a0c4bf08365d2d040c3c73 (diff) | |
download | tor-6e0b90a90276e90b8a0d7b5c683f4dc5d29fd33f.tar.gz tor-6e0b90a90276e90b8a0d7b5c683f4dc5d29fd33f.zip |
r8838@totoro: nickm | 2006-10-02 15:24:39 -0400
Partial implementation of revised nickname syntax for controllers. Implement ability to look up routers by "verbose" nicknames; add a per-v1-control-connection flag to turn the feature on in events. Needs testing, spec, ability to actually turn on the flag, double-checking that we wont overflow any nickname buffers, and changelog.
svn:r8582
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index f04fcca455..3cdadd3cfc 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -157,6 +157,9 @@ #define MAX_NICKNAME_LEN 19 /* Hex digest plus dollar sign. */ #define MAX_HEX_NICKNAME_LEN (HEX_DIGEST_LEN+1) +/* $Hexdigest=nickname */ +#define MAX_VERBOSE_NICKNAME_LEN (1+HEX_DIGEST_LEN+1+MAX_NICKNAME_LEN) + /** Maximum size, in bytes, for resized buffers. */ #define MAX_BUF_SIZE ((1<<24)-1) #define MAX_DIR_SIZE MAX_BUF_SIZE @@ -783,6 +786,9 @@ typedef struct control_connection_t { uint32_t event_mask; /**< Bitfield: which events does this controller * care about? */ + unsigned int use_long_names:1; /**< True if we should use long nicknames + * on this (v1) connection. Only settable + * via v1 controllers. */ uint32_t incoming_cmd_len; uint32_t incoming_cmd_cur_len; char *incoming_cmd; @@ -1680,6 +1686,7 @@ void assert_buf_ok(buf_t *buf); /********************************* circuitbuild.c **********************/ char *circuit_list_path(origin_circuit_t *circ, int verbose); +char *circuit_list_path_for_controller(origin_circuit_t *circ); void circuit_log_path(int severity, unsigned int domain, origin_circuit_t *circ); void circuit_rep_hist_note_result(origin_circuit_t *circ); @@ -2504,6 +2511,7 @@ int router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router, int is_legal_nickname(const char *s); int is_legal_nickname_or_hexdigest(const char *s); int is_legal_hexdigest(const char *s); +void router_get_verbose_nickname(char *buf, routerinfo_t *router); void router_reset_warnings(void); void router_free_all(void); @@ -2547,6 +2555,7 @@ typedef enum { V1_AUTHORITY, V2_AUTHORITY, HIDSERV_AUTHORITY, } authority_type_t; routerstatus_t *router_pick_trusteddirserver(authority_type_t type, + int requireother, int fascistfirewall, int retry_if_no_servers); |