aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dircache/dircache.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-21 10:26:57 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-21 12:57:22 -0400
commit194acfb51d9b26ae63f9d48d3442c4ff64cbc8cc (patch)
treeb4438cb70d5029db0a7b00fb8865a068737a1cb8 /src/feature/dircache/dircache.h
parent0e4c42a912d020888e811b748925362e1b3dc67b (diff)
downloadtor-194acfb51d9b26ae63f9d48d3442c4ff64cbc8cc.tar.gz
tor-194acfb51d9b26ae63f9d48d3442c4ff64cbc8cc.zip
Split directory.c code into several modules
Parts of this C file naturally belong in dircache, dirclient, and dircommon: so, move them there.
Diffstat (limited to 'src/feature/dircache/dircache.h')
-rw-r--r--src/feature/dircache/dircache.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/feature/dircache/dircache.h b/src/feature/dircache/dircache.h
new file mode 100644
index 0000000000..f05780375a
--- /dev/null
+++ b/src/feature/dircache/dircache.h
@@ -0,0 +1,43 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file dircache.h
+ * \brief Header file for dircache.c.
+ **/
+
+#ifndef TOR_DIRCACHE_H
+#define TOR_DIRCACHE_H
+
+int directory_handle_command(dir_connection_t *conn);
+
+#ifdef DIRCACHE_PRIVATE
+MOCK_DECL(STATIC int, directory_handle_command_get,(dir_connection_t *conn,
+ const char *headers,
+ const char *req_body,
+ size_t req_body_len));
+MOCK_DECL(STATIC int, directory_handle_command_post,(dir_connection_t *conn,
+ const char *headers,
+ const char *body,
+ size_t body_len));
+
+STATIC int handle_post_hs_descriptor(const char *url, const char *body);
+enum compression_level_t;
+STATIC enum compression_level_t choose_compression_level(ssize_t n_bytes);
+
+struct get_handler_args_t;
+STATIC int handle_get_hs_descriptor_v3(dir_connection_t *conn,
+ const struct get_handler_args_t *args);
+
+STATIC int parse_http_url(const char *headers, char **url);
+
+STATIC int parse_hs_version_from_post(const char *url, const char *prefix,
+ const char **end_pos);
+
+STATIC unsigned parse_accept_encoding_header(const char *h);
+#endif
+
+#endif /* !defined(TOR_DIRCACHE_H) */