tor  0.4.0.0-alpha-dev
dircache.h
Go to the documentation of this file.
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2018, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
12 #ifndef TOR_DIRCACHE_H
13 #define TOR_DIRCACHE_H
14 
16 
17 #ifdef DIRCACHE_PRIVATE
18 MOCK_DECL(STATIC int, directory_handle_command_get,(dir_connection_t *conn,
19  const char *headers,
20  const char *req_body,
21  size_t req_body_len));
22 MOCK_DECL(STATIC int, directory_handle_command_post,(dir_connection_t *conn,
23  const char *headers,
24  const char *body,
25  size_t body_len));
26 
27 STATIC int handle_post_hs_descriptor(const char *url, const char *body);
29 STATIC enum compression_level_t choose_compression_level(ssize_t n_bytes);
30 
31 struct get_handler_args_t;
32 STATIC int handle_get_hs_descriptor_v3(dir_connection_t *conn,
33  const struct get_handler_args_t *args);
34 
35 STATIC int parse_http_url(const char *headers, char **url);
36 
37 STATIC int parse_hs_version_from_post(const char *url, const char *prefix,
38  const char **end_pos);
39 
40 STATIC unsigned parse_accept_encoding_header(const char *h);
41 #endif
42 
43 #endif /* !defined(TOR_DIRCACHE_H) */
int directory_handle_command(dir_connection_t *conn)
Definition: dircache.c:1722
const char * headers
Definition: dircache.c:317
const uint8_t * body
Definition: conscache.c:51
const char * url
Definition: dircache.c:315
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:94
compression_level_t
Definition: compress.h:35