summaryrefslogtreecommitdiff
path: root/src/or/directory.h
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-11-06 15:45:42 +0200
committerNick Mathewson <nickm@torproject.org>2017-11-17 09:57:46 -0500
commit7e52947d571c8038bfcd82e14f373f3c00924cbe (patch)
tree2b998ec4c30b841d334b772f8dbdbc572101e7e6 /src/or/directory.h
parent9fbc835f10e9fba6a9b0c6643a41aee9c8aa05c2 (diff)
downloadtor-7e52947d571c8038bfcd82e14f373f3c00924cbe.tar.gz
tor-7e52947d571c8038bfcd82e14f373f3c00924cbe.zip
Intoduce unittest for skipping outdated dirservers.
Diffstat (limited to 'src/or/directory.h')
-rw-r--r--src/or/directory.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/or/directory.h b/src/or/directory.h
index b57b7b544b..5e6a91d3e7 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -183,6 +183,48 @@ typedef struct response_handler_args_t {
const char *headers;
} response_handler_args_t;
+struct directory_request_t {
+ /**
+ * These fields specify which directory we're contacting. Routerstatus,
+ * if present, overrides the other fields.
+ *
+ * @{ */
+ tor_addr_port_t or_addr_port;
+ tor_addr_port_t dir_addr_port;
+ char digest[DIGEST_LEN];
+
+ const routerstatus_t *routerstatus;
+ /** @} */
+ /** One of DIR_PURPOSE_* other than DIR_PURPOSE_SERVER. Describes what
+ * kind of operation we'll be doing (upload/download), and of what kind
+ * of document. */
+ uint8_t dir_purpose;
+ /** One of ROUTER_PURPOSE_*; used for uploads and downloads of routerinfo
+ * and extrainfo docs. */
+ uint8_t router_purpose;
+ /** Enum: determines whether to anonymize, and whether to use dirport or
+ * orport. */
+ dir_indirection_t indirection;
+ /** Alias to the variable part of the URL for this request */
+ const char *resource;
+ /** Alias to the payload to upload (if any) */
+ const char *payload;
+ /** Number of bytes to upload from payload</b> */
+ size_t payload_len;
+ /** Value to send in an if-modified-since header, or 0 for none. */
+ time_t if_modified_since;
+ /** Hidden-service-specific information v2. */
+ const rend_data_t *rend_query;
+ /** Extra headers to append to the request */
+ config_line_t *additional_headers;
+ /** Hidden-service-specific information for v3+. */
+ const hs_ident_dir_conn_t *hs_ident;
+ /** Used internally to directory.c: gets informed when the attempt to
+ * connect to the directory succeeds or fails, if that attempt bears on the
+ * directory's usability as a directory guard. */
+ struct circuit_guard_state_t *guard_state;
+};
+
struct get_handler_args_t;
STATIC int handle_get_hs_descriptor_v3(dir_connection_t *conn,
const struct get_handler_args_t *args);